From 3935601542c38cf3c6cf94cc40142de9d8c3abe7 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 21 Jan 2024 18:43:39 -0800 Subject: [PATCH] tree-wide: spelling corrections Signed-off-by: David Aguilar --- CONTRIBUTING.md | 12 ++++++------ README.md | 10 +++++----- cola/app.py | 3 +-- cola/cmds.py | 20 +++++++++----------- cola/compat.py | 10 +++++----- cola/core.py | 41 ++++++++++++++++++++--------------------- cola/decorators.py | 6 +++--- cola/diffparse.py | 2 +- cola/difftool.py | 2 +- cola/fsmonitor.py | 2 +- cola/git.py | 8 ++++---- cola/gitcfg.py | 2 +- cola/gitcmds.py | 15 +++++++-------- cola/i18n.py | 2 +- cola/icons.py | 4 ++-- cola/main.py | 2 +- cola/qtcompat.py | 2 +- cola/qtutils.py | 34 +++++++++++++++++----------------- cola/resources.py | 6 +++--- cola/textwrap.py | 8 ++++---- cola/themes.py | 10 +++++----- cola/utils.py | 12 ++++++------ cola/widgets/about.py | 6 ++---- cola/widgets/branch.py | 6 +++--- cola/widgets/browse.py | 6 +++--- cola/widgets/clone.py | 2 +- cola/widgets/commitmsg.py | 6 +++--- cola/widgets/dag.py | 20 ++++++++++---------- cola/widgets/diff.py | 4 ++-- cola/widgets/finder.py | 2 +- cola/widgets/grep.py | 2 +- cola/widgets/main.py | 2 +- cola/widgets/standard.py | 8 ++++---- cola/widgets/startup.py | 2 +- cola/widgets/status.py | 27 +++++++++++++-------------- cola/widgets/switcher.py | 10 +++++----- cola/widgets/text.py | 14 ++++++-------- pynsist.cfg | 2 +- 38 files changed, 161 insertions(+), 171 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f168d9b..3fbbe3f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ Find an appropriate test suite and extend it whenever possible. This project is very picky about code style. The style here is the standard Python PEP-8 style: -http://www.python.org/dev/peps/pep-0008/ +https://www.python.org/dev/peps/pep-0008/ * Use the `garden fmt` command to format the source code using `cercis`. @@ -56,11 +56,11 @@ files you are modifying to see the current conventions. The body should provide a meaningful commit message, which: -* explains the problem the change tries to solve, iow, what is wrong - with the current code without the change. +* explains the problem the change tries to solve, in other words, + what is wrong with the current code without the change. -* justifies the way the change solves the problem, iow, why the - result with the change is better. +* justifies the way the change solves the problem, in other words, + why the result with the change is better. * alternate solutions considered but discarded, if any. @@ -152,7 +152,7 @@ for some general tips on bug reporting. ## Internationalization and Localization -git-cola is translated to several languages. When strings are presented to +Git Cola is translated to several languages. When strings are presented to the user they must use the `N_('')` function so that `` is translated into a localized string. diff --git a/README.md b/README.md index 640173db..685fed76 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ This install method lets you upgrade Git Cola by running `git pull`. If you add `env3/bin` (or symlink to `env3/bin/git-cola` ) somewhere in your `$PATH` then you can run `git cola` as if it were a builtin `git` command from outside of the virtualenv -(eg. after running "deactivate" or when opening a new shell). +(e.g. after running "deactivate" or when opening a new shell). ## Standalone Installation from Source @@ -266,13 +266,13 @@ If you upgrade your macOS version and Git Cola no longer runs then then it is recommended that you re-install Git Cola's dependencies after upgrading. A quick fix when upgrading to newer versions of XCode or macOS is to -reinstall pyqt5. +reinstall PyQt6. - brew reinstall pyqt@5 + brew reinstall pyqt@6 You may also need to relink your pyqt installation: - brew link pyqt@5 + brew link pyqt@6 This is required when upgrading to a modern (post-10.11 El Capitan) Mac OS X. Homebrew now bundles its own Python3 installation instead of using the @@ -422,7 +422,7 @@ When submitting patches, consult the ## Packaging Notes Git Cola installs its modules into the default Python site-packages directory -(eg. `lib/python3.7/site-packages`) using setuptools. +(e.g. `lib/python3.7/site-packages`) using setuptools. While end-users can use `pip install git-cola` to install Git Cola, distribution packagers should use the `garden -D prefix=/usr install` process. Git Cola's Garden diff --git a/cola/app.py b/cola/app.py index e2cbfcc3..5c129517 100644 --- a/cola/app.py +++ b/cola/app.py @@ -202,7 +202,7 @@ class ColaApplication: self._app.setPalette(theme.build_palette(self._app.palette())) def _install_hidpi_config(self): - """Sets QT HIDPI scalling (requires Qt 5.6)""" + """Sets QT HiDPI scaling (requires Qt 5.6)""" value = self.context.cfg.get('cola.hidpi', default=hidpi.Option.AUTO) hidpi.apply_choice(value) @@ -511,7 +511,6 @@ def async_update(context): """Update the model in the background git-cola should startup as quickly as possible. - """ update_status = partial(context.model.update_status, update_index=True) task = qtutils.SimpleTask(update_status) diff --git a/cola/cmds.py b/cola/cmds.py index d246e24a..e21bff34 100644 --- a/cola/cmds.py +++ b/cola/cmds.py @@ -79,7 +79,7 @@ class ConfirmAction(ContextCommand): """Confirm an action before running it""" def ok_to_run(self): - """Return True when the command is ok to run""" + """Return True when the command is okay to run""" return True def confirm(self): @@ -320,7 +320,7 @@ class LFSInstall(ContextCommand): class ApplyPatch(ContextCommand): - """Apply the specfied patch to the worktree or index""" + """Apply the specified patch to the worktree or index""" def __init__( self, @@ -439,10 +439,8 @@ class Archive(ContextCommand): class Checkout(EditModel): """A command object for git-checkout. - 'argv' is handed off directly to git. - + The argv list is forwarded directly to git. """ - def __init__(self, context, argv, checkout_branch=False): super().__init__(context) self.argv = argv @@ -1295,7 +1293,7 @@ class DiffImage(EditModel): """Query the diff type to use based on cola.imagediff.""" _, ext = os.path.splitext(filename) if ext.startswith('.'): - # Check eg. "cola.imagediff.svg" to see if we should imagediff. + # Check e.g. "cola.imagediff.svg" to see if we should imagediff. cfg = 'cola.imagediff' + ext if self.cfg.get(cfg, True): result = main.Types.IMAGE @@ -1815,7 +1813,7 @@ class OpenDir(OpenDefaultApp): dirnames = self._dirnames if not dirnames: return - # An empty dirname defaults to CWD. + # An empty dirname defaults to to the current directory. dirs = [(dirname or core.getcwd()) for dirname in dirnames] utils.launch_default_app(dirs) @@ -1959,7 +1957,7 @@ class NewBareRepo(ContextCommand): def unix_path(path, is_win32=utils.is_win32): - """Git for Windows requires unix paths, so force them here""" + """Git for Windows requires Unix paths, so force them here""" if is_win32(): path = path.replace('\\', '/') first = path[0] @@ -2454,7 +2452,7 @@ class ShowUntracked(EditModel): class SignOff(ContextCommand): - """Append a signoff to the commit message""" + """Append a sign-off to the commit message""" UNDOABLE = True @@ -2467,7 +2465,7 @@ class SignOff(ContextCommand): self.old_commitmsg = self.model.commitmsg def do(self): - """Add a signoff to the commit message""" + """Add a sign-off to the commit message""" signoff = self.signoff() if signoff in self.model.commitmsg: return @@ -2479,7 +2477,7 @@ class SignOff(ContextCommand): self.model.set_commitmsg(self.old_commitmsg) def signoff(self): - """Generate the signoff string""" + """Generate the sign-off string""" name, email = self.cfg.get_author() return f'\nSigned-off-by: {name} <{email}>' diff --git a/cola/compat.py b/cola/compat.py index 7060b3e1..6e98960c 100644 --- a/cola/compat.py +++ b/cola/compat.py @@ -46,14 +46,14 @@ else: uchr = unichr # noqa int_types = (int, long) # noqa -# Qt's max 32-bit signed integer range (-2147483648 to 2147483647) +# The max 32-bit signed integer range for Qt is (-2147483648 to 2147483647) maxint = (2**31) - 1 def setenv(key, value): """Compatibility wrapper for setting environment variables - Why? win32 requires putenv(). UNIX only requires os.environ. + Windows requires putenv(). Unix only requires os.environ. """ if not PY3 and isinstance(value, ustr): value = value.encode(ENCODING, 'replace') @@ -62,7 +62,7 @@ def setenv(key, value): def unsetenv(key): - """Compatibility wrapper for unsetting environment variables""" + """Compatibility wrapper for clearing environment variables""" os.environ.pop(key, None) if hasattr(os, 'unsetenv'): os.unsetenv(key) @@ -74,9 +74,9 @@ def no_op(value): def byte_offset_to_int_converter(): - """Return a function to convert byte string offsets into ints + """Return a function to convert byte string offsets into integers - Indexing into python3 bytes returns ints, Python2 returns str. + Indexing into python3 bytes returns integers. Python2 returns str. Thus, on Python2 we need to use `ord()` to convert the byte into an integer. It's already an int on Python3, so we use no_op there. """ diff --git a/cola/core.py b/cola/core.py index 28e2a382..e907f080 100644 --- a/cola/core.py +++ b/cola/core.py @@ -1,8 +1,7 @@ -"""This module provides core functions for handling unicode and UNIX quirks +"""This module provides core functions for handling Unicode and Unix quirks The @interruptable functions retry when system calls are interrupted, e.g. when python raises an IOError or OSError with errno == EINTR. - """ import functools import itertools @@ -49,7 +48,7 @@ _encoding_tests = [ class UStr(ustr): """Unicode string wrapper that remembers its encoding - UStr wraps unicode strings to provide the `encoding` attribute. + UStr wraps Unicode strings to provide the `encoding` attribute. UStr is used when decoding strings of an unknown encoding. In order to generate patches that contain the original byte sequences, we must preserve the original encoding when calling decode() @@ -79,7 +78,7 @@ def decode_maybe(value, encoding, errors='strict'): def decode(value, encoding=None, errors='strict'): - """decode(encoded_string) returns an unencoded unicode string""" + """decode(encoded_string) returns an un-encoded Unicode string""" if value is None: result = None elif isinstance(value, ustr): @@ -109,14 +108,14 @@ def decode(value, encoding=None, errors='strict'): def encode(string, encoding=None): - """encode(unencoded_string) returns a string encoded in utf-8""" + """encode(string) returns a byte string encoded to UTF-8""" if not isinstance(string, ustr): return string return string.encode(encoding or ENCODING, 'replace') def mkpath(path, encoding=None): - # The Windows API requires unicode strings regardless of python version + # The Windows API requires Unicode strings regardless of python version if WIN32: return decode(path, encoding=encoding) # UNIX prefers bytes @@ -139,7 +138,7 @@ def read(filename, size=-1, encoding=None, errors='strict'): def write(path, contents, encoding=None, append=False): - """Writes a unicode string to a file""" + """Writes a Unicode string to a file""" if append: mode = 'ab' else: @@ -150,13 +149,13 @@ def write(path, contents, encoding=None, append=False): @interruptable def xread(fh, size=-1, encoding=None, errors='strict'): - """Read from a filehandle and retry when interrupted""" + """Read from a file handle and retry when interrupted""" return decode(fh.read(size), encoding=encoding, errors=errors) @interruptable def xwrite(fh, content, encoding=None): - """Write to a filehandle and retry when interrupted""" + """Write to a file handle and retry when interrupted""" return fh.write(encode(content, encoding=encoding)) @@ -194,20 +193,20 @@ def start_command( env.update(add_env) # Python3 on windows always goes through list2cmdline() internally inside - # of subprocess.py so we must provide unicode strings here otherwise + # of subprocess.py so we must provide Unicode strings here otherwise # Python3 breaks when bytes are provided. # - # Additionally, the preferred usage on Python3 is to pass unicode + # Additionally, the preferred usage on Python3 is to pass Unicode # strings to subprocess. Python will automatically encode into the - # default encoding (utf-8) when it gets unicode strings. + # default encoding (UTF-8) when it gets Unicode strings. shell = extra.get('shell', False) cmd = prep_for_subprocess(cmd, shell=shell) if WIN32 and cwd == getcwd(): - # Windows cannot deal with passing a cwd that contains unicode + # Windows cannot deal with passing a cwd that contains Unicode # but we luckily can pass None when the supplied cwd is the same # as our current directory and get the same effect. - # Not doing this causes unicode encoding errors when launching + # Not doing this causes Unicode encoding errors when launching # the subprocess. cwd = None @@ -290,7 +289,7 @@ def _fork_posix(args, cwd=None, shell=False): def _fork_win32(args, cwd=None, shell=False): """Launch a background process using crazy win32 voodoo.""" - # This is probably wrong, but it works. Windows.. wow. + # This is probably wrong, but it works. Windows.. Wow. if args[0] == 'git-dag': # win32 can't exec python scripts args = [sys.executable] + args @@ -318,7 +317,7 @@ def _win32_find_exe(exe): variables. This allows us to avoid passing shell=True to subprocess.Popen. For reference, see: - http://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection127121120120 + https://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection127121120120 """ # try the argument itself @@ -397,24 +396,24 @@ def guess_mimetype(filename): def xopen(path, mode='r', encoding=None): """Open a file with the specified mode and encoding - The path is decoded into unicode on Windows and encoded into bytes on Unix. + The path is decoded into Unicode on Windows and encoded into bytes on Unix. """ # pylint: disable=unspecified-encoding return open(mkpath(path, encoding=encoding), mode) def open_append(path, encoding=None): - """Open a file for appending in utf-8 text mode""" + """Open a file for appending in UTF-8 text mode""" return open(mkpath(path, encoding=encoding), 'a', encoding='utf-8') def open_read(path, encoding=None): - """Open a file for reading in utf-8 text mode""" + """Open a file for reading in UTF-8 text mode""" return open(mkpath(path, encoding=encoding), encoding='utf-8') def open_write(path, encoding=None): - """Open a file for writing in utf-8 text mode""" + """Open a file for writing in UTF-8 text mode""" return open(mkpath(path, encoding=encoding), 'w', encoding='utf-8') @@ -491,7 +490,7 @@ def sync(): def rename(old, new): - """Rename a path. Transform arguments to handle non-ascii file paths""" + """Rename a path. Transform arguments to handle non-ASCII file paths""" os.rename(mkpath(old), mkpath(new)) diff --git a/cola/decorators.py b/cola/decorators.py index 2862105d..9c43b7c3 100644 --- a/cola/decorators.py +++ b/cola/decorators.py @@ -40,7 +40,7 @@ def memoize(func): """ A decorator for memoizing function calls - http://en.wikipedia.org/wiki/Memoization + https://en.wikipedia.org/wiki/Memoization """ func.cache = {} @@ -65,9 +65,9 @@ def _memoize(func, *args, **opts): def interruptable(func, *args, **opts): """Handle interruptible system calls - OSX and others are known to interrupt system calls + macOS and others are known to interrupt system calls - http://en.wikipedia.org/wiki/PCLSRing + https://en.wikipedia.org/wiki/PCLSRing http://en.wikipedia.org/wiki/Unix_philosophy#Worse_is_better The @interruptable decorator handles this situation diff --git a/cola/diffparse.py b/cola/diffparse.py index 79674ecb..859c9ba2 100644 --- a/cola/diffparse.py +++ b/cola/diffparse.py @@ -324,7 +324,7 @@ class Patch: # line and switches it to addition, it appends the line to the pending_additions # list, while additions that get switched to deletions are appended directly to # the content_lines list. Each time a context line is encountered, any pending - # additions are then appended to the content_lines list immmediately before the + # additions are then appended to the content_lines list immediately before the # context line and the pending_additions list is cleared. new_content_lines = [] pending_additions = [] diff --git a/cola/difftool.py b/cola/difftool.py index 03123ff3..ff6e0e3d 100644 --- a/cola/difftool.py +++ b/cola/difftool.py @@ -280,7 +280,7 @@ def difftool_launch( :param paths: paths to diff :param staged: activate `git difftool --staged` :param dir_diff: activate `git difftool --dir-diff` - :param left_take_magic: whether to append the magic ^! diff expression + :param left_take_magic: whether to append the magic "^!" diff expression :param left_take_parent: whether to append the first-parent ~ for diffing """ diff --git a/cola/fsmonitor.py b/cola/fsmonitor.py index 9671a02a..5907d92d 100644 --- a/cola/fsmonitor.py +++ b/cola/fsmonitor.py @@ -293,7 +293,7 @@ if AVAILABLE == 'inotify': inotify.rm_watch(self._inotify_fd, wd) except OSError as e: if e.errno == errno.EINVAL: - # This error can occur if the target of the wd was + # This error can occur if the target of the watch was # removed on the filesystem before we call # inotify.rm_watch() so ignore it. continue diff --git a/cola/git.py b/cola/git.py index 01eb8bc5..2df10e45 100644 --- a/cola/git.py +++ b/cola/git.py @@ -20,7 +20,7 @@ STATUS = 0 STDOUT = 1 STDERR = 2 -# Object ID / SHA1-related constants +# Object ID / SHA-1-related constants # Git's empty tree is a built-in constant object name. EMPTY_TREE_OID = '4b825dc642cb6eb9a060e54bf8d69288fbee4904' # Git's diff machinery returns zeroes for modified files whose content exists @@ -362,8 +362,8 @@ class Git: result = self.execute(call, **_kwargs) except OSError as exc: if WIN32 and exc.errno == errno.ENOENT: - # see if git exists at all. on win32 it can fail with ENOENT in - # case of argv overflow. we should be safe from that but use + # see if git exists at all. On win32 it can fail with ENOENT in + # case of argv overflow. We should be safe from that but use # defensive coding for the worst-case scenario. On UNIX # we have ENAMETOOLONG but that doesn't exist on Windows. if _git_is_installed(): @@ -375,7 +375,7 @@ class Git: def _git_is_installed(): """Return True if git is installed""" - # On win32 Git commands can fail with ENOENT in case of argv overflow. we + # On win32 Git commands can fail with ENOENT in case of argv overflow. We # should be safe from that but use defensive coding for the worst-case # scenario. On UNIX we have ENAMETOOLONG but that doesn't exist on # Windows. diff --git a/cola/gitcfg.py b/cola/gitcfg.py index dbc2f289..bb93c3b1 100644 --- a/cola/gitcfg.py +++ b/cola/gitcfg.py @@ -298,7 +298,7 @@ class GitConfig(QtCore.QObject): self.repo_config_changed.emit(key, value) def find(self, pat): - """Return a a dict of values for all keys matching the specified pattern""" + """Return a dict of values for all keys matching the specified pattern""" pat = pat.lower() match = fnmatch.fnmatch result = {} diff --git a/cola/gitcmds.py b/cola/gitcmds.py index 0a8ae2bc..befdd569 100644 --- a/cola/gitcmds.py +++ b/cola/gitcmds.py @@ -158,7 +158,7 @@ class CurrentBranchCache: def reset(): - """Reset cached value in this module (eg. the cached current branch)""" + """Reset cached value in this module (e.g. the cached current branch)""" CurrentBranchCache.key = None @@ -381,7 +381,7 @@ def oid_diff(context, oid, filename=None): def oid_diff_range(context, start, end, filename=None): - """Reeturn the diff for a commit range""" + """Return the diff for a commit range""" args = [start, end] git = context.git opts = common_diff_opts(context) @@ -427,7 +427,7 @@ def diff_helper( reverse=False, untracked=False, ): - 'Invokes git diff on a filepath.' + """Invoke git diff on a path""" git = context.git cfg = context.cfg if commit: @@ -522,7 +522,7 @@ def extract_diff_header(deleted, with_diff_header, suppress_header, diffoutput): def format_patchsets(context, to_export, revs, output='patches'): """ - Group contiguous revision selection into patchsets + Group contiguous revision selection into patch sets Exists to handle multi-selection. Multiple disparate ranges in the revision selection @@ -556,7 +556,7 @@ def format_patchsets(context, to_export, revs, output='patches'): cur_rev_idx = rev_idx patchset_idx += 1 - # Export each patchsets + # Export each patch set status = 0 for patchset in patches_to_export: stat, out, err = export_patchset( @@ -613,7 +613,6 @@ def worktree_state( :rtype: dict, keys are staged, unstaged, untracked, unmerged, changed_upstream, and submodule. - """ git = context.git if update_index: @@ -727,7 +726,7 @@ def diff_upstream(context, head): def list_submodule(context): - """Return submodules in the format(state, sha1, path, describe)""" + """Return submodules in the format(state, sha_1, path, describe)""" git = context.git status, data, _ = git.submodule('status') ret = [] @@ -1036,7 +1035,7 @@ def annex_path(context, head, filename): def is_binary(context, filename): - """A heustic to determine whether `filename` contains (non-text) binary content""" + """A heuristic to determine whether `filename` contains (non-text) binary content""" cfg_is_binary = context.cfg.is_binary(filename) if cfg_is_binary is not None: return cfg_is_binary diff --git a/cola/i18n.py b/cola/i18n.py index fdc5ea1b..60561719 100644 --- a/cola/i18n.py +++ b/cola/i18n.py @@ -43,7 +43,7 @@ class Translation: self.load() def load(self): - """Read the pofile content into memory""" + """Read the .po file content into memory""" po = polib.pofile(self.filename, encoding='utf-8') messages = self.messages for entry in po.translated_entries(): diff --git a/cola/icons.py b/cola/icons.py index 499f5bd1..f7faf0a5 100644 --- a/cola/icons.py +++ b/cola/icons.py @@ -59,7 +59,7 @@ def icon_themes(): def name_from_basename(basename): """Prefix the basename with "icons:" so that git-cola's icons are found - "icons" is registered with Qt's resource system during install(). + "icons" is registered with the Qt resource system during install(). """ return 'icons:' + basename @@ -163,7 +163,7 @@ def branch(): def check_name(): - """Checkmark icon name""" + """Check mark icon name""" return name_from_basename('check.svg') diff --git a/cola/main.py b/cola/main.py index 69e4d53d..a71cb35b 100644 --- a/cola/main.py +++ b/cola/main.py @@ -12,7 +12,7 @@ def main(argv=None): app.initialize() if argv is None: argv = sys.argv[1:] - # we're using argparse with subparser, but argparse + # we're using argparse with subparsers, but argparse # does not allow us to assign a default subparser # when none has been specified. We fake it by injecting # 'cola' into the command-line so that parse_args() diff --git a/cola/qtcompat.py b/cola/qtcompat.py index 4ac8520c..4243b1eb 100644 --- a/cola/qtcompat.py +++ b/cola/qtcompat.py @@ -41,7 +41,7 @@ def _map_rect_to_scene(self, rect): def wheel_translation(event): - """Return the Tx Ty translation delta for a pan""" + """Return the (Tx, Ty) translation delta for a pan""" if PYQT4: tx = event.delta() ty = 0.0 diff --git a/cola/qtutils.py b/cola/qtutils.py index a1d669d0..7cf41eda 100644 --- a/cola/qtutils.py +++ b/cola/qtutils.py @@ -187,7 +187,7 @@ def grid(margin, spacing, *widgets): def splitter(orientation, *widgets): - """Create a spliter over the specified widgets + """Create a splitter over the specified widgets :param orientation: Qt.Horizontal or Qt.Vertical @@ -224,7 +224,7 @@ def label(text=None, align=None, fmt=None, selectable=True): class ComboBox(QtWidgets.QComboBox): - """Custom read-only combobox with a convenient API""" + """Custom read-only combo box with a convenient API""" def __init__(self, items=None, editable=False, parent=None, transform=None): super().__init__(parent) @@ -257,7 +257,7 @@ class ComboBox(QtWidgets.QComboBox): def combo(items, editable=False, tooltip='', parent=None): - """Create a readonly (by default) combobox from a list of items""" + """Create a readonly (by default) combo box from a list of items""" combobox = ComboBox(editable=editable, items=items, parent=parent) if tooltip: combobox.setToolTip(tooltip) @@ -265,7 +265,7 @@ def combo(items, editable=False, tooltip='', parent=None): def combo_mapped(data, editable=False, transform=None, parent=None): - """Create a readonly (by default) combobox from a list of items""" + """Create a readonly (by default) combo box from a list of items""" widget = ComboBox(editable=editable, transform=transform, parent=parent) for k, v in data: widget.add_item(k, v) @@ -612,7 +612,7 @@ def _add_action(widget, text, tip, func, connect, *shortcuts): def set_selected_item(widget, idx): - """Sets a the currently selected item to the item at index idx.""" + """Sets the currently selected item to the item at index idx.""" if isinstance(widget, QtWidgets.QTreeWidget): item = widget.topLevelItem(idx) if item: @@ -765,7 +765,7 @@ def tool_button(): def create_action_button(tooltip=None, icon=None, visible=None): - """Create a small toolbutton for use in dock title widgets""" + """Create a small tool button for use in dock title widgets""" button = tool_button() if tooltip is not None: button.setToolTip(tooltip) @@ -918,11 +918,11 @@ def create_menu(title, parent): class DebouncingMenu(QtWidgets.QMenu): - """Menu that debounces mouse release action ie. stops it if occurred + """Menu that debounces mouse release action i.e. stops it if occurred right after menu creation. Disables annoying behaviour when RMB is pressed to show menu, cursor is - moved accidentally 1px onto newly created menu and released causing to + moved accidentally 1 px onto newly created menu and released causing to execute menu action """ @@ -966,7 +966,7 @@ def create_toolbutton(text=None, layout=None, tooltip=None, icon=None): def create_toolbutton_with_callback(callback, text, icon, tooltip, layout=None): - """Create a toolbutton that runs the specified callback""" + """Create a tool button that runs the specified callback""" toolbutton = create_toolbutton(text=text, layout=layout, tooltip=tooltip, icon=icon) connect_button(toolbutton, callback) return toolbutton @@ -974,16 +974,16 @@ def create_toolbutton_with_callback(callback, text, icon, tooltip, layout=None): # pylint: disable=line-too-long def mimedata_from_paths(context, paths, include_urls=True): - """Return mimedata with a list of absolute path URLs + """Return mime data with a list of absolute path URLs Set `include_urls` to False to prevent URLs from being included - in the mimedata. This is useful in some terminals that do not gracefully handle + in the mime data. This is useful in some terminals that do not gracefully handle multiple URLs being included in the payload. - This allows the mimedata to contain just plain a plain text value that we + This allows the mime data to contain just plain a plain text value that we are able to format ourselves. - Older verisons of gnome-terminal expected a utf-16 encoding, but that + Older versions of gnome-terminal expected a UTF-16 encoding, but that behavior is no longer needed. """ # noqa abspaths = [core.abspath(path) for path in paths] @@ -993,8 +993,8 @@ def mimedata_from_paths(context, paths, include_urls=True): # mimedata.removeFormat('text/x-moz-url') has no effect. # http://www.qtcentre.org/threads/44643-Dragging-text-uri-list-Qt-inserts-garbage # - # Older versions of gnome-terminal expect utf-16 encoded text, but other terminals, - # e.g. terminator, expect utf-8, so use cola.dragencoding to override the default. + # Older versions of gnome-terminal expect UTF-16 encoded text, but other terminals, + # e.g. terminator, expect UTF-8, so use cola.dragencoding to override the default. # NOTE: text/x-moz-url does not seem to be used/needed by modern versions of # gnome-terminal, kitty, and terminator. mimedata = QtCore.QMimeData() @@ -1010,7 +1010,7 @@ def mimedata_from_paths(context, paths, include_urls=True): def path_mimetypes(include_urls=True): - """Return a list of mimetypes that we generate""" + """Return a list of mime types that we generate""" mime_types = [ 'text/plain', 'text/plain;charset=utf-8', @@ -1053,7 +1053,7 @@ class Task(QtCore.QRunnable): self.channel = Channel() self.result = None # Python's garbage collector will try to double-free the task - # once it's finished, so disable Qt's auto-deletion as a workaround. + # once it's finished so disable the Qt auto-deletion. self.setAutoDelete(False) def run(self): diff --git a/cola/resources.py b/cola/resources.py index bd72d50a..4648152e 100644 --- a/cola/resources.py +++ b/cola/resources.py @@ -66,7 +66,7 @@ def doc(*args): def i18n(*args): - """Return a path relative to cola's i18n locale directory, eg. cola/i18n""" + """Return a path relative to cola's i18n locale directory, e.g. cola/i18n""" return package_data('i18n', *args) @@ -136,7 +136,7 @@ def xdg_config_home(*args): def xdg_data_home(*args): - """Return the XDG_DATA_HOME configuration directory, eg. ~/.local/share""" + """Return the XDG_DATA_HOME configuration directory, e.g. ~/.local/share""" config = core.getenv( 'XDG_DATA_HOME', os.path.join(core.expanduser('~'), '.local', 'share') ) @@ -175,5 +175,5 @@ def find_first(subpath, paths, validate=os.path.isfile): def config_home(*args): - """Return git-cola's configuration directory, eg. ~/.config/git-cola""" + """Return git-cola's configuration directory, e.g. ~/.config/git-cola""" return xdg_config_home('git-cola', *args) diff --git a/cola/textwrap.py b/cola/textwrap.py index 4bb9d674..25f16ad7 100644 --- a/cola/textwrap.py +++ b/cola/textwrap.py @@ -25,7 +25,7 @@ class TextWrapper: The width of a tab used when calculating line length. break_on_hyphens (default: false) Allow breaking hyphenated words. If true, wrapping will occur - preferably on whitespaces and right after hyphens part of + preferably on whitespace and right after the hyphenated part of compound words. drop_whitespace (default: true) Drop leading and trailing whitespace from lines. @@ -99,7 +99,7 @@ class TextWrapper: 'self.width' or less. Some lines may be longer than this. Chunks correspond roughly to words and the whitespace between them: each chunk is indivisible, but a line break can come between any two - chunks. Chunks should not have internal whitespace; ie. a chunk is + chunks. Chunks should not have internal whitespace; i.e. a chunk is either all whitespace or a "word". Whitespace chunks will be removed from the beginning and end of lines, but apart from that whitespace is preserved. @@ -120,7 +120,7 @@ class TextWrapper: width = self.width # First chunk on line is a space -- drop it, unless this - # is the very beginning of the text (ie. no lines started yet). + # is the very beginning of the text (i.e. no lines started yet). if self.drop_whitespace and is_blank(chunks[-1]) and lines: chunks.pop() @@ -143,7 +143,7 @@ class TextWrapper: if not cur_line: cur_line.append(chunks.pop()) - # Avoid whitespace at the beginining of split lines + # Avoid whitespace at the beginning of split lines if ( linebreak and self.drop_whitespace diff --git a/cola/themes.py b/cola/themes.py index 67dba5d4..6b63178e 100644 --- a/cola/themes.py +++ b/cola/themes.py @@ -511,7 +511,7 @@ class Theme: return palette def highlight_color_rgb(self): - """Return an rgb(r,g,b) css color value for the selection highlight""" + """Return an rgb(r,g,b) CSS color value for the selection highlight""" if self.highlight_color: highlight_rgb = self.highlight_color elif self.main_color: @@ -534,7 +534,7 @@ class Theme: return color def text_colors_rgb(self): - """Return a pair of rgb(r,g,b) css color values for text and selected text""" + """Return a pair of rgb(r,g,b) CSS color values for text and selected text""" if self.text_color: text_rgb = self.text_color highlight_text_rgb = self.text_color @@ -548,7 +548,7 @@ class Theme: return text_rgb, highlight_text_rgb def disabled_text_color_rgb(self): - """Return an rgb(r,g,b) css color value for the disabled text""" + """Return an rgb(r,g,b) CSS color value for the disabled text""" if self.disabled_text_color: disabled_text_rgb = self.disabled_text_color else: @@ -558,7 +558,7 @@ class Theme: return disabled_text_rgb def background_color_rgb(self): - """Return an rgb(r,g,b) css color value for the window background""" + """Return an rgb(r,g,b) CSS color value for the window background""" if self.background_color: background_color = self.background_color else: @@ -729,7 +729,7 @@ def get_all_themes(): def apply_platform_theme(theme): - """Apply platform-specific themes (eg. dark mode on macOS)""" + """Apply platform-specific themes (e.g. dark mode on macOS)""" # https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app # https://github.com/git-cola/git-cola/issues/905#issuecomment-461118465 if utils.is_darwin(): diff --git a/cola/utils.py b/cola/utils.py index 7ce1de8e..8ce63e55 100644 --- a/cola/utils.py +++ b/cola/utils.py @@ -254,17 +254,17 @@ def _shell_split_py2(value): result = shlex.split(core.encode(value)) except ValueError: result = core.encode(value).strip().split() - # Decode to unicode strings + # Decode to Unicode strings return [core.decode(arg) for arg in result] def _shell_split_py3(value): - """Python3 requires unicode inputs to shlex.split(). Converts to unicode""" + """Python3 requires Unicode inputs to shlex.split(). Convert to Unicode""" try: result = shlex.split(value) except ValueError: result = core.decode(value).strip().split() - # Already unicode + # Already Unicode return result @@ -287,17 +287,17 @@ def tmp_filename(label, suffix=''): def is_linux(): - """Is this a linux machine?""" + """Is this a Linux machine?""" return sys.platform.startswith('linux') def is_debian(): - """Is it debian?""" + """Is this a Debian/Linux machine?""" return os.path.exists('/usr/bin/apt-get') def is_darwin(): - """Return True on OSX.""" + """Is this a macOS machine?""" return sys.platform == 'darwin' diff --git a/cola/widgets/about.py b/cola/widgets/about.py index 522fee70..de815a0f 100644 --- a/cola/widgets/about.py +++ b/cola/widgets/about.py @@ -30,9 +30,7 @@ class ExpandingTabBar(QtWidgets.QTabBar): The setExpanding(True) method does not work in practice because it respects the OS style. We override the style by implementing tabSizeHint() so that we can specify the size explicitly. - """ - def tabSizeHint(self, tab_index): width = self.parent().width() // max(2, self.count()) - 1 size = super().tabSizeHint(tab_index) @@ -201,7 +199,7 @@ def mailto(email, text, palette): def render_authors(authors): - """Render a list of author details into richtext html""" + """Render a list of author details into rich text html""" for x in authors: x.setdefault('email', '') @@ -470,7 +468,7 @@ def show_shortcuts(): try: from qtpy import QtWebEngineWidgets # pylint: disable=all except (ImportError, qtpy.PythonQtError): - # redhat disabled QtWebKit in their qt build but don't punish the users + # Redhat disabled QtWebKit in their Qt build but don't punish the users webbrowser.open_new_tab('file://' + hotkeys_html) return diff --git a/cola/widgets/branch.py b/cola/widgets/branch.py index 98e3b07c..3d7a5edc 100644 --- a/cola/widgets/branch.py +++ b/cola/widgets/branch.py @@ -286,7 +286,7 @@ class BranchesTreeWidget(standard.TreeWidget): menu.addSeparator() menu.addAction(delete_menu_action) - # manage upstreams for local branches + # manage upstream branches for local branches if root.name == N_('Local'): upstream_menu = menu.addMenu(N_('Set Upstream Branch')) upstream_menu.setIcon(icons.branch()) @@ -640,7 +640,7 @@ def create_tree_entries(names): """ # Phase 1: build a nested dictionary representing the intermediate - # names in the branches. e.g. {'xxx': {'abc': {}, 'def': {}}} + # names in the branches, e.g. {'xxx': {'abc': {}, 'def': {}}} tree_names = create_name_dict(names) # Loop over the names again, this time we'll create tree entries @@ -679,7 +679,7 @@ def create_tree_entries(names): def create_name_dict(names): # Phase 1: build a nested dictionary representing the intermediate - # names in the branches. e.g. {'xxx': {'abc': {}, 'def': {}}} + # names in the branches, e.g. {'xxx': {'abc': {}, 'def': {}}} tree_names = {} for item in names: part_names = tree_names diff --git a/cola/widgets/browse.py b/cola/widgets/browse.py index 4c54d659..b34d003f 100644 --- a/cola/widgets/browse.py +++ b/cola/widgets/browse.py @@ -507,12 +507,12 @@ class RepoTreeView(standard.TreeView): cmds.do(cmds.VisualizePaths, self.context, paths) def untrack_selected(self): - """untrack selected paths.""" + """Untrack selected paths.""" context = self.context cmds.do(cmds.Untrack, context, self.selected_tracked_paths()) def rename_selected(self): - """untrack selected paths.""" + """Untrack selected paths.""" context = self.context cmds.do(cmds.Rename, context, self.selected_tracked_paths()) @@ -818,7 +818,7 @@ class GitTreeModel(GitFileTreeModel): class GitTreeItem(QtGui.QStandardItem): """ - Represents a cell in a treeview. + Represents a cell in a tree view. Many GitRepoItems could map to a single repository path, but this tree only has a single column. diff --git a/cola/widgets/clone.py b/cola/widgets/clone.py index bb9042a6..78262e8c 100644 --- a/cola/widgets/clone.py +++ b/cola/widgets/clone.py @@ -204,7 +204,7 @@ class Clone(standard.Dialog): msg = N_('"%s" already exists, cola will create a new directory') % destdir Interaction.information(N_('Directory Exists'), msg) - # Make sure the new destdir doesn't exist + # Make sure the directory doesn't exist while core.exists(destdir): destdir = olddestdir + str(count) count += 1 diff --git a/cola/widgets/commitmsg.py b/cola/widgets/commitmsg.py index c54526b8..957daea2 100644 --- a/cola/widgets/commitmsg.py +++ b/cola/widgets/commitmsg.py @@ -68,7 +68,7 @@ class CommitMessageEditor(QtWidgets.QFrame): self.move_up = actions.move_up(self) self.move_down = actions.move_down(self) - # Menu acctions + # Menu actions self.menu_actions = menu_actions = [ self.signoff_action, self.commit_action, @@ -180,7 +180,7 @@ class CommitMessageEditor(QtWidgets.QFrame): self.check_spelling_action, self.toggle_check_spelling ) - # Handle the one-off autowrapping + # Handle the one-off auto-wrapping qtutils.connect_action_bool(self.autowrap_action, self.set_linebreak) self.summary.accepted.connect(self.focus_description) @@ -255,7 +255,7 @@ class CommitMessageEditor(QtWidgets.QFrame): self.focus_description() def commit_message(self, raw=True): - """Return the commit message as a unicode string""" + """Return the commit message as a Unicode string""" summary = get(self.summary) if raw: description = get(self.description) diff --git a/cola/widgets/dag.py b/cola/widgets/dag.py index 3d597b2a..266a1ec5 100644 --- a/cola/widgets/dag.py +++ b/cola/widgets/dag.py @@ -104,7 +104,7 @@ class ViewerMixin: return result def selected_oids(self): - """Return the currently selected comit object IDs""" + """Return the currently selected commit object IDs""" return [i.commit for i in self.selected_items()] def clicked_oid(self): @@ -349,7 +349,7 @@ def set_icon(icon, action): def viewer_actions(widget): - """Return commont actions across the tree and graph widgets""" + """Return common actions across the tree and graph widgets""" return { 'diff_this_selected': set_icon( icons.compare(), @@ -596,7 +596,7 @@ class CommitTreeWidget(standard.TreeWidget, ViewerMixin): def export_state(self): """Export the widget's state""" # The base class method is intentionally overridden because we only - # care about the details below for this subwidget. + # care about the details below for this sub-widget. state = {} state['column_widths'] = self.column_widths() return state @@ -1112,7 +1112,7 @@ class GitDAG(standard.MainWindow): ) def grab_file(self, filename): - """Save the selected file from the filelist widget""" + """Save the selected file from the file list widget""" oid = self.treewidget.selected_oid() model = browse.BrowseModel(oid, filename=filename) browse.save_path(self.context, filename, model) @@ -1261,12 +1261,12 @@ class Edge(QtWidgets.QGraphicsItem): path.moveTo(self.source.x(), self.source.y()) path.lineTo(self.dest.x(), self.dest.y()) else: - # Define points starting from source + # Define points starting from the source. point1 = QPointF(self.source.x(), self.source.y()) point2 = QPointF(point1.x(), point1.y() - connector_length) point3 = QPointF(point2.x() + arc_rect, point2.y() - arc_rect) - # Define points starting from dest + # Define points starting from the destination. point4 = QPointF(self.dest.x(), self.dest.y()) point5 = QPointF(point4.x(), point3.y() - arc_rect) point6 = QPointF(point5.x() - arc_rect, point5.y() + arc_rect) @@ -1276,8 +1276,8 @@ class Edge(QtWidgets.QGraphicsItem): start_angle_arc2 = 90 span_angle_arc2 = -90 - # If the dest is at the left of the source, then we - # need to reverse some values + # If the destination is at the left of the source, then we need to + # reverse some values. if self.source.x() > self.dest.x(): point3 = QPointF(point2.x() - arc_rect, point3.y()) point6 = QPointF(point5.x() + arc_rect, point6.y()) @@ -1448,7 +1448,7 @@ class Commit(QtWidgets.QGraphicsItem): return self.item_shape def paint(self, painter, option, _widget): - # Do not draw outside the exposed rect + # Do not draw outside the exposed rectangle. painter.setClipRect(option.exposedRect) # Draw ellipse @@ -2080,7 +2080,7 @@ class GraphView(QtWidgets.QGraphicsView, ViewerMixin): def reset_columns(self): # Some children of displayed commits might not be accounted in # 'commits' list. It is common case during loading of big graph. - # But, they are assigned a column that must be reseted. Hence, use + # But, they are assigned a column that must be reset. Hence, use # depth-first traversal to reset all columns assigned. for node in self.commits: if node.column is None: diff --git a/cola/widgets/diff.py b/cola/widgets/diff.py index c5b7e5ed..8b7a28fd 100644 --- a/cola/widgets/diff.py +++ b/cola/widgets/diff.py @@ -1309,7 +1309,7 @@ def _add_patch_actions(widget, context, menu): def _build_patch_append_menu(widget, context, menu): - """Build the "Append Patch" submenu""" + """Build the "Append Patch" sub-menu""" # Build the menu when first displayed only. This initial check avoids # re-populating the menu with duplicate actions. menu_actions = menu.actions() @@ -1634,7 +1634,7 @@ def new_apply_patches(context, patches=None, parent=None): def get_patches_from_paths(paths): - """Returns all patches benath a given path""" + """Returns all patches beneath a given path""" paths = [core.decode(p) for p in paths] patches = [p for p in paths if core.isfile(p) and p.endswith(('.patch', '.mbox'))] dirs = [p for p in paths if core.isdir(p)] diff --git a/cola/widgets/finder.py b/cola/widgets/finder.py index ab74e8b2..484cc0c6 100644 --- a/cola/widgets/finder.py +++ b/cola/widgets/finder.py @@ -41,7 +41,7 @@ def new_finder(context, paths=None, parent=None): def add_wildcards(arg): - """Add "*" around user input to generate ls-files pathspecs matches + """Add "*" around user input to generate ls-files pathspec matches >>> '*x*' == \ add_wildcards('x') == \ diff --git a/cola/widgets/grep.py b/cola/widgets/grep.py index 87becdef..0976a04e 100644 --- a/cola/widgets/grep.py +++ b/cola/widgets/grep.py @@ -358,7 +358,7 @@ class PreviewTextView(VimTextBrowser): self.runtask = qtutils.RunTask(parent=self) def preview(self, filename, line_number): - """Preview the a file at the specified line number""" + """Preview a file at the specified line number""" if filename != self.filename: request = PreviewTask(filename, line_number) diff --git a/cola/widgets/main.py b/cola/widgets/main.py index 9b5e7e02..7ea96c09 100644 --- a/cola/widgets/main.py +++ b/cola/widgets/main.py @@ -1383,7 +1383,7 @@ class FocusProxy: return callback def delete(self): - """Specialized delete() to deal with QLineEdit vs QTextEdit""" + """Specialized delete() to deal with QLineEdit vs. QTextEdit""" focus = self.focus('delete') if hasattr(focus, 'del_'): focus.del_() diff --git a/cola/widgets/standard.py b/cola/widgets/standard.py index b8d6abdf..27d08620 100644 --- a/cola/widgets/standard.py +++ b/cola/widgets/standard.py @@ -48,7 +48,7 @@ class WidgetMixin: self.resize(width, height) else: shown = self.isVisible() - # earlier show() fools Windows focus stealing prevention. the main + # earlier show() fools Windows focus stealing prevention. The main # window is blocked for the duration of "git rebase" and we don't # want to present a blocked window with git-cola-sequence-editor # hidden somewhere. @@ -303,7 +303,7 @@ class TreeMixin: # Vim keybindings... event = _create_vim_navigation_key_event(event) - # Read the updated event key to take the remappings into account + # Read the updated event key to take the mappings into account key = event.key() if key == Qt.Key_Up: idxs = widget.selectedIndexes() @@ -525,7 +525,7 @@ class Dialog(WidgetMixin, QtWidgets.QDialog): return self.Base.reject(self) def dispose(self): - """Extension method for model deregistration in sub-classes""" + """Extension method for model de-registration in sub-classes""" return def close(self): @@ -730,7 +730,7 @@ class ProgressAnimationThread(QtCore.QThread): class ProgressTickThread(QtCore.QThread): - """Emits a an int stream for progress bars""" + """Emits an int stream for progress bars""" # The updated signal emits progress tick values. updated = Signal(int) diff --git a/cola/widgets/startup.py b/cola/widgets/startup.py index 5fa3d530..83db61fe 100644 --- a/cola/widgets/startup.py +++ b/cola/widgets/startup.py @@ -292,7 +292,7 @@ class StartupDialog(standard.Dialog): def get_all_repos(context, settings): - """Return a sorted list of bookmarks and recent repositorties""" + """Return a sorted list of bookmarks and recent repositories""" bookmarks = settings.bookmarks recent = settings.recent all_repos = [(repo, True) for repo in bookmarks] + [ diff --git a/cola/widgets/status.py b/cola/widgets/status.py index 3baa5d3c..352d4c90 100644 --- a/cola/widgets/status.py +++ b/cola/widgets/status.py @@ -505,7 +505,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): cmds.do(cmds.StageModifiedAndUntracked, context) return # Nothing more to do. # At this point we may stage all modified and untracked, and then - # possibly a subset of the other category (eg. all modified and + # possibly a subset of the other category (e.g. all modified and # some untracked). We don't return here so that StageOrUnstage # gets a chance to run below. if is_modified: @@ -613,7 +613,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): self.copy_basename_action.setEnabled(enabled) def _set_staged(self, items): - """Adds items to the 'Staged' subtree.""" + """Adds items to the 'Staged' sub-tree.""" with qtutils.BlockSignals(self): self._set_subtree( items, @@ -624,7 +624,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): ) def _set_modified(self, items): - """Adds items to the 'Modified' subtree.""" + """Adds items to the 'Modified' sub-tree.""" with qtutils.BlockSignals(self): self._set_subtree( items, @@ -634,7 +634,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): ) def _set_unmerged(self, items): - """Adds items to the 'Unmerged' subtree.""" + """Adds items to the 'Unmerged' sub-tree.""" deleted_set = {path for path in items if not core.exists(path)} with qtutils.BlockSignals(self): self._set_subtree( @@ -642,7 +642,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): ) def _set_untracked(self, items): - """Adds items to the 'Untracked' subtree.""" + """Adds items to the 'Untracked' sub-tree.""" with qtutils.BlockSignals(self): self._set_subtree(items, UNTRACKED_IDX, N_('Untracked'), untracked=True) @@ -745,9 +745,8 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): widget = CopyLeadingPathWidget( N_('Copy Leading Path to Clipboard'), self.context, copy_menu ) - - # Store the value of the leading paths spinbox so that the value does not reset - # everytime the menu is shown and recreated. + # Store the value of the leading paths spin-box so that the value does not reset + # every time the menu is shown and recreated. widget.set_value(self.copy_leading_paths_value) widget.spinbox.valueChanged.connect( partial(setattr, self, 'copy_leading_paths_value') @@ -1026,7 +1025,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): ) def all_files(self): - """Return all of the current active files as a flast list""" + """Return all of the current active files as a flat list""" c = self.contents() return c.staged + c.unmerged + c.modified + c.untracked @@ -1248,7 +1247,7 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): return qtutils.mimedata_from_paths(context, paths, include_urls=include_urls) def mimeTypes(self): - """Return the mimetypes that this widget generates""" + """Return the mime types that this widget generates""" return qtutils.path_mimetypes(include_urls=not self._alt_drag) @@ -1572,7 +1571,7 @@ def _transplant_selection_across_sections( modified_paths = modified[NEW_PATHS_IDX] untracked_paths = untracked[NEW_PATHS_IDX] - # These callbacks select a path in the corresponding widget subtree lists. + # These callbacks select a path in the corresponding widget sub-tree lists. select_staged = staged[SELECT_FN_IDX] select_unmerged = unmerged[SELECT_FN_IDX] select_modified = modified[SELECT_FN_IDX] @@ -1636,7 +1635,7 @@ def _transplant_selection_across_sections( class CopyLeadingPathWidget(QtWidgets.QWidget): - """A widget that holds a label and a spinbox for the number of paths to strip""" + """A widget that holds a label and a spin-box for the number of paths to strip""" def __init__(self, title, context, parent): QtWidgets.QWidget.__init__(self, parent) @@ -1693,9 +1692,9 @@ class CopyLeadingPathWidget(QtWidgets.QWidget): self.setStyleSheet(stylesheet) def value(self): - """Return the current value of the spinbox""" + """Return the current value of the spin-box""" return self.spinbox.value() def set_value(self, value): - """Set the spinbox value""" + """Set the spin-box value""" self.spinbox.setValue(value) diff --git a/cola/widgets/switcher.py b/cola/widgets/switcher.py index 94b3d57c..3395e486 100644 --- a/cola/widgets/switcher.py +++ b/cola/widgets/switcher.py @@ -52,13 +52,13 @@ class Switcher(standard.Dialog): This will be inherited by outer-view class(SwitcherOuterView) or inner-view class (SwitcherInnerView). - inner-view class is a quick-switcher widget including view. In this case, this + The inner-view class is a quick-switcher widget including view. In this case, this switcher will have switcher_list field, and show the items list in itself. - outer-view class is a quick-switcher widget without view(only input field), which - means sharing model with other view class. + The outer-view class is a quick-switcher widget without view(only input field), + which shares model with other view class. - switcher_selection_move signal is for the event that selection move key like UP, - DOWN has pressed while focusing on input field. + The switcher_selection_move signal is the event that the selection move actions + emit while the input field is focused. """ def __init__( diff --git a/cola/widgets/text.py b/cola/widgets/text.py index 28fb2126..13481767 100644 --- a/cola/widgets/text.py +++ b/cola/widgets/text.py @@ -40,7 +40,7 @@ class LineEdit(QtWidgets.QLineEdit): self.setClearButtonEnabled(True) def get(self): - """Return the raw unicode value from Qt""" + """Return the raw Unicode value from Qt""" return self.text() def value(self): @@ -115,7 +115,7 @@ class BaseTextEditExtension(QtCore.QObject): ) def get(self): - """Return the raw unicode value from Qt""" + """Return the raw Unicode value from Qt""" return self.widget.toPlainText() def value(self): @@ -294,7 +294,7 @@ class PlainTextEdit(QtWidgets.QPlainTextEdit): self.menu_actions = [] def get(self): - """Return the raw unicode value from Qt""" + """Return the raw Unicode value from Qt""" return self.ext.get() # For compatibility with QTextEdit @@ -528,7 +528,7 @@ class TextEdit(QtWidgets.QTextEdit): self.menu_actions = [] def get(self): - """Return the raw unicode value from Qt""" + """Return the raw Unicode value from Qt""" return self.ext.get() def value(self): @@ -707,7 +707,7 @@ class HintWidget(QtCore.QObject): ) def init(self): - """Defered initialization""" + """Deferred initialization""" if self.modern: self.widget().setPlaceholderText(self.value()) else: @@ -862,7 +862,7 @@ class VimMixin: def __init__(self, widget): self.widget = widget self.Base = widget.Base - # Common vim/unix-ish keyboard actions + # Common vim/Unix-ish keyboard actions self.add_navigation('End', hotkeys.GOTO_END) self.add_navigation('Up', hotkeys.MOVE_UP, shift=hotkeys.MOVE_UP_SHIFT) self.add_navigation('Down', hotkeys.MOVE_DOWN, shift=hotkeys.MOVE_DOWN_SHIFT) @@ -985,9 +985,7 @@ class VimHintedPlainTextEdit(HintedPlainTextEdit): """HintedPlainTextEdit with vim hotkeys This can only be used in read-only mode. - """ - Base = HintedPlainTextEdit Mixin = VimMixin diff --git a/pynsist.cfg b/pynsist.cfg index 214913f0..5297f8f5 100644 --- a/pynsist.cfg +++ b/pynsist.cfg @@ -9,7 +9,7 @@ extra_preamble=contrib/win32/pynsist-preamble.py console=false # We might want to pursue shell integration, which would at minimum require a -# custom template. https://pynsist.readthedocs.io/en/latest/design.html +# custom template. https://pynsist.readthedocs.io/en/latest/design.html # [Build] # nsi_template=contrib/win32/pynsist-template.nsi -- 2.11.4.GIT