Fix typos in code comments, invisible to end-users.

This commit is contained in:
Sebastian Rasmussen 2018-01-06 18:48:40 +01:00 committed by Curtis Gedak
parent 4a9dc00381
commit dfe88a9681
32 changed files with 65 additions and 65 deletions

View file

@ -30,7 +30,7 @@ def HTML2PlainText(html):
if pandocConverter.isValid():
return pandocConverter.convert(html, _from="html", to="plain")
# Last resort: probably resource ineficient
# Last resort: probably resource inefficient
e = QTextEdit()
e.setHtml(html)
return e.toPlainText()

View file

@ -4,12 +4,12 @@
class abstractConverter:
"""
A convertor is used to convert (duh) between stuff. They provide access
A converter is used to convert (duh) between stuff. They provide access
to external libraries that may or may not be present.
Now, things are a bit messy, since classes in `exporter` (and `importer` to a lesser extent) do
the same. In a better world, classes from `exporter` and `importer` would
use convertors to do their stuff. (TODO)
use converters to do their stuff. (TODO)
"""
name = ""

View file

@ -12,7 +12,7 @@ from manuskript.ui.views.PDFViewer import PDFViewer
class PDF(abstractOutput):
"""PDF Viewer using PDS.js. Cf. https://github.com/mozilla/pdf.js/wiki/Setup-PDF.js-in-a-website"""
"""PDF Viewer using PDF.js. Cf. https://github.com/mozilla/pdf.js/wiki/Setup-PDF.js-in-a-website"""
name = "PDF"
description = qApp.translate("Export", "Needs latex to be installed.")

View file

@ -33,7 +33,7 @@ class abstractImporter:
def startImport(self, filePath, parentItem, settingsWidget):
"""
Takes a str path to the file/folder to import, and the settingsWidget
returnend by `self.settingsWidget()` containing the user set settings,
returned by `self.settingsWidget()` containing the user set settings,
and return `outlineItem`s.
"""
pass

View file

@ -52,7 +52,7 @@ class markdownImporter(abstractImporter):
```
# Level 1
Some texte content.
Some text content.
Level 1 will become a text element.
# Level 1
This content has no name.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# --!-- coding: utf8 --!--
# The loadSave file calls the propper functions to load and save file
# The loadSave file calls the proper functions to load and save file
# trying to detect the proper file format if it comes from an older version
import os
import zipfile

View file

@ -2,7 +2,7 @@
# --!-- coding: utf8 --!--
# Version 0 of file saving format.
# Was used at the begining and up util version XXX when
# Was used at the beginning and up until version XXX when
# it was superseded by Version 1, which is more open and flexible
import os
import zipfile
@ -184,7 +184,7 @@ def loadFilesFromZip(zipname):
def loadStandardItemModelXML(mdl, xml, fromString=False):
"""Load data to a QStandardItemModel mdl from xml.
By default xml is a filename. If fromString=True, xml is a string containg the data."""
By default xml is a filename. If fromString=True, xml is a string containing the data."""
# print(qApp.tr("Loading {}... ").format(xml), end="")

View file

@ -4,7 +4,7 @@
# Version 1 of file saving format.
# Aims at providing a plain-text way of saving a project
# (except for some elements), allowing collaborative work
# versioning and third-partty editing.
# versioning and third-party editing.
import os
import re
@ -101,7 +101,7 @@ def saveProject(zip=None):
Saves the project. If zip is False, the project is saved as a multitude of plain-text files for the most parts
and some XML or zip? for settings and stuff.
If zip is True, everything is saved as a single zipped file. Easier to carry around, but does not allow
collaborative work, versionning, or third-party editing.
collaborative work, versioning, or third-party editing.
@param zip: if True, saves as a single file. If False, saves as plain-text. If None, tries to determine based on
settings.
@return: True if successful, False otherwise.
@ -289,7 +289,7 @@ def saveProject(zip=None):
####################################################################################################################
# Settings
# Saved in readable text (json) for easier versionning. But they mustn't be shared, it seems.
# Saved in readable text (json) for easier versioning. But they mustn't be shared, it seems.
# Maybe include them only if zipped?
# Well, for now, we keep them here...
@ -839,7 +839,7 @@ def loadProject(project, zip=None):
####################################################################################################################
# Texts
# We read outline form the outline folder. If revisions are saved, then there's also a revisions.xml which contains
# everything, but the outline folder takes precedence (in cases it's been edited outside of manuksript.
# everything, but the outline folder takes precedence (in cases it's been edited outside of manuskript.
mdl = mw.mdlOutline
log("\nReading outline:")

View file

@ -97,7 +97,7 @@ def run():
"""
# Need to return and keep `app` otherwise it gets deleted.
app, MW = prepare()
# Seperating launch to avoid segfault, so it seem.
# Separating launch to avoid segfault, so it seem.
# Cf. http://stackoverflow.com/questions/12433491/is-this-pyqt-4-python-bug-or-wrongly-behaving-code
launch(MW)

View file

@ -210,7 +210,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# Hide the dock
d.setVisible(False)
else:
# Restore the dock's visibily based on stored value
# Restore the dock's visibility based on stored value
d.setVisible(self._dckVisibility[d.objectName()])
# Lock is used only once, at start up. We can remove it
@ -221,7 +221,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
"""
While switching to welcome screen, we have to hide all the docks.
Otherwise one could use the search dock, and manuskript would crash.
Plus it's unncessary distraction.
Plus it's unnecessary distraction.
But we also want to restore them to their visibility prior to switching,
so we store states.
"""
@ -632,7 +632,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.setWindowTitle(pName + " - " + self.tr("Manuskript"))
# Stuff
# self.checkPersosID() # Should'n be necessary any longer
# self.checkPersosID() # Shouldn't be necessary any longer
self.currentProject = project
QSettings().setValue("lastProject", project)
@ -699,7 +699,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.dckCheatSheet.objectName() : False,
self.dckSearch.objectName() : False,
}
self._dckVisibility["LOCK"] = True # prevent overiding loaded values
self._dckVisibility["LOCK"] = True # prevent overriding loaded values
if sttgns.contains("metadataState"):
state = [False if v == "false" else True for v in sttgns.value("metadataState")]
@ -712,7 +712,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if sttgns.contains("splitterRedacV"):
self.splitterRedacV.restoreState(sttgns.value("splitterRedacV"))
if sttgns.contains("toolbar"):
# self.toolbar is not initialized yet, so we just store balue
# self.toolbar is not initialized yet, so we just store value
self._toolbarState = sttgns.value("toolbar")
else:
self._toolbarState = ""
@ -747,7 +747,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.saveDatas()
# closeEvent
# QMainWindow.closeEvent(self, event) # Causin segfaults?
# QMainWindow.closeEvent(self, event) # Causing segfaults?
def startTimerNoChanges(self):
if settings.autoSaveNoChanges:
@ -1440,14 +1440,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def viewModeFictionVisibilitySwitch(self, val):
"""
Swtiches the visibility of some UI components useful for fiction only
Switches the visibility of some UI components useful for fiction only
@param val: sets visibility to val
"""
# Menu navigation & boutton in toolbar
# Menu navigation & button in toolbar
self.toolbar.setDockVisibility(self.dckNavigation, val)
# POV in metadatas
# POV in metadata
from manuskript.ui.views.propertiesView import propertiesView
for w in findWidgetsOfClass(propertiesView):
w.lblPOV.setVisible(val)

View file

@ -22,7 +22,7 @@ try:
locale.setlocale(locale.LC_ALL, '')
except:
# Invalid locale, but not really a big deal because it's used only for
# number formating
# number formatting
pass
import time, os
@ -261,7 +261,7 @@ class abstractModel(QAbstractItemModel):
return Qt.CopyAction | Qt.MoveAction
def canDropMimeData(self, data, action, row, column, parent):
"""Ensures that we are not droping an item into itself."""
"""Ensures that we are not dropping an item into itself."""
if not data.hasFormat("application/xml"):
return False
@ -326,7 +326,7 @@ class abstractModel(QAbstractItemModel):
# For example if selecting:
# - Parent
# - Child
# And draging them, items encoded in mime data are: [Parent, Child],
# And dragging them, items encoded in mime data are: [Parent, Child],
# but Child is already contained in Parent, so if we do nothing we end
# up with:
# - Parent

View file

@ -114,7 +114,7 @@ class characterModel(QAbstractItemModel):
return QAbstractItemModel.flags(self, index)
###############################################################################
# CHARACTER QUERRIES
# CHARACTER QUERIES
###############################################################################
def character(self, row):
@ -133,7 +133,7 @@ class characterModel(QAbstractItemModel):
return self.character(row).importance()
###############################################################################
# MODEL QUERRIES
# MODEL QUERIES
###############################################################################
def getCharactersByImportance(self):

View file

@ -17,7 +17,7 @@ try:
locale.setlocale(locale.LC_ALL, '')
except:
# Invalid locale, but not really a big deal because it's used only for
# number formating
# number formatting
pass

View file

@ -44,7 +44,7 @@ class plotModel(QStandardItemModel):
if item.child(i, PlotStep.ID):
_ID = item.child(i, PlotStep.ID).text()
# Don't know why sometimes name is None (while drag'n'droping
# Don't know why sometimes name is None (while drag'n'dropping
# several items)
if item.child(i, PlotStep.name):
name = item.child(i, PlotStep.name).text()
@ -77,7 +77,7 @@ class plotModel(QStandardItemModel):
return "0" # Default to "Minor"
def getSubPlotTextsByID(self, plotID, subplotRaw):
"""Returns a tuple (name, summary) for the suplot whose raw in the model
"""Returns a tuple (name, summary) for the subplot whose raw in the model
is ``subplotRaw``, of plot whose ID is ``plotID``.
"""
plotIndex = self.getIndexFromID(plotID)

View file

@ -89,7 +89,7 @@ def infos(ref):
_type = match.group(1)
_ref = match.group(2)
# A text or outine item
# A text or outline item
if _type == TextLetter:
m = mainWindow().mdlOutline
idx = m.getIndexByID(_ref)

View file

@ -79,7 +79,7 @@ class worldModel(QStandardItemModel):
return c
def listAll(self):
"""Returns a list of tupple ``(name, ID, path)`` for all items."""
"""Returns a list of tuple ``(name, ID, path)`` for all items."""
lst = []
def readAll(item):

View file

@ -486,7 +486,7 @@ class settingsWindow(QWidget, Ui_Settings):
def updateEditorSettings(self):
"""
Stores settings for editor appareance.
Stores settings for editor appearance.
"""
# Background

View file

@ -71,7 +71,7 @@ class collapsibleDockWidgets(QToolBar):
`defaultVisibility` is the default visibility of the item when it is added.
This allows for the widget to be added to `collapsibleDockWidgets` after
they've been created but before they are shown, and yet specify their
desired visibility. Otherwise it creates troubes, see #167 on github:
desired visibility. Otherwise it creates troubles, see #167 on github:
https://github.com/olivierkes/manuskript/issues/167.
"""
a = QAction(text, self)

View file

@ -156,7 +156,7 @@ class editorWidget(QWidget, Ui_editorWidget_ui):
def setView(self):
# index = mainWindow().treeRedacOutline.currentIndex()
# Couting the number of other selected items
# Counting the number of other selected items
# sel = []
# for i in mainWindow().treeRedacOutline.selectionModel().selection().indexes():
# if i.column() != 0: continue

View file

@ -243,7 +243,7 @@ class fullScreenEditor(QWidget):
if hasattr(widget, "_autoHide") and not widget._autoHide:
return
# Hides wiget in the bottom right corner
# Hides widget in the bottom right corner
widget.move(self.geometry().bottomRight() + QPoint(1, 1))
def showWidget(self, widget):

View file

@ -27,8 +27,8 @@ class mainEditor(QWidget, Ui_mainEditor):
It contains two main elements:
1. A `tabSplitter`, which can open any numer of `outlineItem`s either in tabs
(in `QTabWidget`) and/or in splitted views (children `tabSplitter`s).
1. A `tabSplitter`, which can open any number of `outlineItem`s either in tabs
(in `QTabWidget`) and/or in split views (children `tabSplitter`s).
2. An horizontal layout contain a number of buttons and information:
- Go up button
@ -37,7 +37,7 @@ class mainEditor(QWidget, Ui_mainEditor):
- Label showing stats about displayed `outlineItem`
- Fullscreen button
`mainEditor` is responsible for opening indexes, propagating event to relevent
`mainEditor` is responsible for opening indexes, propagating event to relevant
views, opening and closing tabs, etc.
+---------------------------| mainEditor |--------------------------------+
@ -207,7 +207,7 @@ class mainEditor(QWidget, Ui_mainEditor):
if tabWidget is None:
tabWidget = self.currentTabWidget()
# Checking if tab is already openned
# Checking if tab is already opened
for w in self.allTabs(tabWidget):
if w.currentIndex == index:
tabWidget.setCurrentWidget(w)

View file

@ -13,8 +13,8 @@ from manuskript.ui.editors.tabSplitter_ui import Ui_tabSplitter
class tabSplitter(QWidget, Ui_tabSplitter):
"""
`tabSplitter` is used to have mutliple `outlineItem`s open, either in tabs
and/or in splitted views. Each tab contains an `editorWidget` which is responsible
`tabSplitter` is used to have multiple `outlineItem`s open, either in tabs
and/or in split views. Each tab contains an `editorWidget` which is responsible
for showing one single `outlineItem` in several ways.
`tabSplitter` is managed mainly through the `mainEditor` which is responsible
@ -39,7 +39,7 @@ class tabSplitter(QWidget, Ui_tabSplitter):
# try:
# self.tab.setTabBarAutoHide(True)
# except AttributeError:
# print("Info: install Qt 5.4 or higher to use tabbar auto-hide in editor.")
# print("Info: install Qt 5.4 or higher to use tab bar auto-hide in editor.")
# Button to split
self.btnSplit = QPushButton(self)

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# --!-- coding: utf8 --!--
# Lots of stuff from here comes from the excellet focuswriter.
# Lots of stuff from here comes from the excellent focuswriter.
import os
import re

View file

@ -72,7 +72,7 @@ class generalSettings(QWidget, Ui_generalSettings):
def splitScenes(self):
"""
Return wheter the user wants to split scenes.
Return whether the user wants to split scenes.
If unchecked, returns False.
If checked, returns the escaped split mark, or default (in placeholderText).
"""

View file

@ -65,7 +65,7 @@ class importerDialog(QWidget, Ui_importer):
def populateImportList(self):
def addFormat(name, icon, identifier):
# Identifier serves to distingues 2 importers that would have the
# Identifier serves to distinguish 2 importers that would have the
# same name.
self.cmbImporters.addItem(QIcon.fromTheme(icon), name, identifier)
@ -255,7 +255,7 @@ class importerDialog(QWidget, Ui_importer):
# Signal every views that important model changes have happened.
self.mw.mdlOutline.layoutChanged.emit()
# I'm getting seg fault over this message sometimes...
# I'm getting segfault over this message sometimes...
# Using status bar message instead...
#QMessageBox.information(self, self.tr("Import status"),
#self.tr("Import Complete."))

View file

@ -84,7 +84,7 @@ class search(QWidget, Ui_search):
def search(self):
text = self.text.text()
# Chosing the right columns
# Choosing the right columns
lstColumns = [
("Title", Outline.title),
("Text", Outline.text),

View file

@ -15,7 +15,7 @@ from manuskript import functions as F
p = qApp.palette()
# window = "#d6d2d0" #"#eee" / #eff0f1
window = p.color(QPalette.Window).name() # General background
windowText = p.color(QPalette.WindowText).name() # General foregroung
windowText = p.color(QPalette.WindowText).name() # General foreground
base = p.color(QPalette.Base).name() # Other background
alternateBase = p.color(QPalette.AlternateBase).name() # Other background
text = p.color(QPalette.Text).name() # Base Text
@ -68,7 +68,7 @@ def styleMainWindow(mw):
mw.setStyleSheet(mainWindowSS())
mw.lstTabs.verticalScrollBar().setStyleSheet(simpleScrollBarV())
# Custon palette?
# Custom palette?
#qApp.setPalette(appPalette())
mw.treeRedacOutline.setStyleSheet("""

View file

@ -93,7 +93,7 @@ class metadataView(QWidget, Ui_metadataView):
# Behavior 2:
# Allow edition of multiple indexes.
# Bug: Multiple selections of items sometimes gets Notes/references
# field to be ereased. See #10 on github.
# field to be erased. See #10 on github.
#self.txtSummarySentence.setCurrentModelIndexes(indexes)
#self.txtSummaryFull.setCurrentModelIndexes(indexes)
#self.txtNotes.setCurrentModelIndexes(indexes)

View file

@ -331,7 +331,7 @@ class outlineBasics(QAbstractItemView):
def duplicate(self):
"""
Duplicates item(s), while preserving clipbaord content.
Duplicates item(s), while preserving clipboard content.
"""
mimeData = self.model().mimeData(self.selectionModel().selectedIndexes())
self.paste(mimeData)
@ -341,7 +341,7 @@ class outlineBasics(QAbstractItemView):
Move selected items up or down.
"""
# we store selected indexesret
# we store selected indexes
currentID = self.model().ID(self.currentIndex())
selIDs = [self.model().ID(i) for i in self.selectedIndexes()]

View file

@ -147,7 +147,7 @@ class textEditView(QTextEdit):
def currentIndex(self):
"""
Getter function used to normalized views acces with QAbstractItemViews.
Getter function used to normalized views access with QAbstractItemViews.
"""
if self._index:
return self._index
@ -156,7 +156,7 @@ class textEditView(QTextEdit):
def getSelection(self):
"""
Getter function used to normalized views acces with QAbstractItemViews.
Getter function used to normalized views access with QAbstractItemViews.
"""
return [self.currentIndex()]
@ -227,7 +227,7 @@ class textEditView(QTextEdit):
QWidget#{name}{{
background: {bg};
}}""".format(
# We style by name, otherwise all heriting widgets get the same
# We style by name, otherwise all inheriting widgets get the same
# colored background, for example context menu.
name=self.parent().objectName(),
bg=background,
@ -480,7 +480,7 @@ class textEditView(QTextEdit):
QTextEdit.wheelEvent(self, event)
class SpellAction(QAction):
"""A special QAction that returns the text in a signal. Used for spellckech."""
"""A special QAction that returns the text in a signal. Used for spellcheck."""
correct = pyqtSignal(str)
@ -584,7 +584,7 @@ class textEditView(QTextEdit):
def callMainTreeView(self, functionName):
"""
The tree view in mainwindow must have same index as the text
The tree view in main window must have same index as the text
edit that has focus. So we can pass it the call for documents
edits like: duplicate, move up, etc.
"""

View file

@ -14,7 +14,7 @@ from manuskript.ui import style as S
class treeTitleDelegate(QStyledItemDelegate):
"""The main purpose of ``treeTitleDelegate`` is to paint outline items
in the treeview with propers colors according to settings.
in the treeview with proper colors according to settings.
"""
def __init__(self, parent=None):

View file

@ -75,9 +75,9 @@ class welcome(QWidget, Ui_welcome):
def getAutoLoadValues(self):
"""
Reads manuskript system's settings and returns a tupple:
Reads manuskript system's settings and returns a tuple:
- `bool`: whether manuskript should automatically load
the last openend project or display the
the last opened project or display the
welcome widget.
- `str`: the absolute path to the last opened project.
"""
@ -149,7 +149,7 @@ class welcome(QWidget, Ui_welcome):
def saveAsFile(self):
"""File dialog that request a file, existing or not.
Save datas to that file, which then becomes the current project."""
Save data to that file, which then becomes the current project."""
filename = QFileDialog.getSaveFileName(self,
self.tr("Save project as..."),
".",
@ -307,7 +307,7 @@ class welcome(QWidget, Ui_welcome):
def templateAddLevel(self):
if len(self.template[1]) > 0 and \
self.template[1][len(self.template[1]) - 1][1] == None:
# has word cound, so insert before
# has word count, so insert before
self.template[1].insert(len(self.template[1]) - 1, (10, self.tr("Text")))
else:
# No word count, so insert at end
@ -401,7 +401,7 @@ class welcome(QWidget, Ui_welcome):
if t and t[0][2] == "Non-fiction":
settings.viewMode = "simple"
# Données
# Tasks
self.mw.mdlFlatData = QStandardItemModel(2, 8, self.mw)
# Persos