From 75bf6abc67b50177292f16aa2042950b189895e9 Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Wed, 16 May 2018 15:39:59 +0200 Subject: Actually check whether selection is a directory `Actions.move()` used `enter_dir()` to determine whether the selection was a directory. Now we explicitly check whether it's a directory. Fixes #1177 --- ranger/core/actions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 6bbb35aa..981df05b 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -483,9 +483,12 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m mode = narg tfile = self.thisfile selection = self.thistab.get_selection() - if not self.thistab.enter_dir(tfile) and selection: - result = self.execute_file(selection, mode=mode) - if result in (False, ASK_COMMAND): + if selection: + if selection.is_directory: + self.thistab.enter_dir(tfile) + else: + result = self.execute_file(selection, mode=mode) + if result in (False, ASK_COMMAND): self.open_console('open_with ') elif direction.vertical() and cwd.files: pos_new = direction.move( -- cgit 1.4.1-2-gfad0 From cd4b2df4304071ea1fc1f035058700433a8b1c4a Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Wed, 16 May 2018 15:39:59 +0200 Subject: Actually check whether selection is a directory `Actions.move()` used `enter_dir()` to determine whether the selection was a directory. Now we explicitly check whether it's a directory. Fixes #1177 --- ranger/core/actions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 6bbb35aa..6ddcdd86 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -483,10 +483,13 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m mode = narg tfile = self.thisfile selection = self.thistab.get_selection() - if not self.thistab.enter_dir(tfile) and selection: - result = self.execute_file(selection, mode=mode) - if result in (False, ASK_COMMAND): - self.open_console('open_with ') + if selection: + if selection.is_directory: + self.thistab.enter_dir(tfile) + else: + result = self.execute_file(selection, mode=mode) + if result in (False, ASK_COMMAND): + self.open_console('open_with ') elif direction.vertical() and cwd.files: pos_new = direction.move( direction=direction.down(), -- cgit 1.4.1-2-gfad0 From 9edc595440e6e64467d36d2f0f60ce8eee8450f8 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 6 Jun 2018 00:07:05 +0200 Subject: Introduce a helper function for versioning The `version_helper` function should make version changes simpler, upon a release simple bump `__version__` and change `__release__` to `True`, afterwards change `__release__` back to `False`. It also tries to call `git describe` so `ranger --version` reports a commit hash if available. This should prevent slip-ups where released versions report ambiguously as being `ranger-master x.y.z` which is what we use for non-release versions. Fixes #1197, which was a misunderstanding caused by a slip-up. --- ranger/__init__.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ranger/__init__.py b/ranger/__init__.py index 0d7c8fdc..ae1ecc48 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -12,9 +12,28 @@ from __future__ import (absolute_import, division, print_function) import os + +# Version helper +def version_helper(): + if __release__: + version_string = 'ranger {0}'.format(__version__) + else: + import subprocess + version_string = 'ranger-master {0}' + try: + git_describe = subprocess.check_output(['git', 'describe'], + universal_newlines=True, + stderr=subprocess.PIPE) + version_string = version_string.format(git_describe.strip('\n')) + except (OSError, subprocess.CalledProcessError): + version_string = version_string.format(__version__) + return version_string + + # Information __license__ = 'GPL3' __version__ = '1.9.1' +__release__ = False __author__ = __maintainer__ = 'Roman Zimbelmann' __email__ = 'hut@hut.pm' @@ -27,7 +46,7 @@ MACRO_DELIMITER = '%' MACRO_DELIMITER_ESC = '%%' DEFAULT_PAGER = 'less' USAGE = '%prog [options] [path]' -VERSION = 'ranger-master {0}'.format(__version__) +VERSION = version_helper() # These variables are ignored if the corresponding # XDG environment variable is non-empty and absolute -- cgit 1.4.1-2-gfad0 From 536de704bafba18be78007d773d79f31c84c49db Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 6 Jun 2018 00:13:04 +0200 Subject: Update the release checklist about version bumps --- doc/howto-publish-a-release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/howto-publish-a-release.md b/doc/howto-publish-a-release.md index 572a2eb7..e8d669ce 100644 --- a/doc/howto-publish-a-release.md +++ b/doc/howto-publish-a-release.md @@ -31,7 +31,7 @@ Test everything Make a release commit --------------------- * [ ] Update the number in the `README` -* [ ] Update `__version__` and `VERSION` in `ranger/__init__.py` +* [ ] Update `__version__` and `__release__` in `ranger/__init__.py` * [ ] Update `__version__` in `ranger/ext/rifle.py` * [ ] `make man` * [ ] Write changelog entry -- cgit 1.4.1-2-gfad0 From bf3456ef4e3744725b198a8540ffa8b9620fb58c Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Wed, 4 Jul 2018 21:58:29 +0200 Subject: Implement the filter stack Inspired by https://github.com/Fuco1/dired-hacks#dired-filter --- ranger/config/commands.py | 48 ++++++++++++++++++ ranger/config/rc.conf | 12 +++++ ranger/container/directory.py | 3 ++ ranger/core/filter_stack.py | 114 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 ranger/core/filter_stack.py diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 7f5fc764..35aa3ffb 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1545,6 +1545,54 @@ class filter_inode_type(Command): self.fm.thisdir.refilter() +class filter_stack(Command): + """ + :filter_stack ... + + Manages the filter stack. + + filter_stack add FILTER_TYPE ARGS... + filter_stack pop + filter_stack decompose + filter_stack clear + filter_stack show + """ + def execute(self): + from ranger.core.filter_stack import SIMPLE_FILTERS, FILTER_COMBINATORS + + subcommand = self.arg(1) + + if subcommand == "add": + try: + self.fm.thisdir.filter_stack.append( + SIMPLE_FILTERS[self.arg(2)](self.rest(3)) + ) + except KeyError: + FILTER_COMBINATORS[self.arg(2)](self.fm.thisdir.filter_stack) + elif subcommand == "pop": + self.fm.thisdir.filter_stack.pop() + elif subcommand == "decompose": + inner_filters = self.fm.thisdir.filter_stack.pop().decompose() + if inner_filters: + self.fm.thisdir.filter_stack.extend(inner_filters) + elif subcommand == "clear": + self.fm.thisdir.filter_stack = [] + elif subcommand == "show": + stack = map(str, self.fm.thisdir.filter_stack) + pager = self.fm.ui.open_pager() + pager.set_source(["Filter stack: "] + stack) + pager.move(to=100, percentage=True) + return + else: + self.fm.notify( + "Unknown subcommand: {}".format(subcommand), + bad=True + ) + return + + self.fm.thisdir.refilter() + + class grep(Command): """:grep diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 62331e22..4d8f1f54 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -557,6 +557,18 @@ map zv set use_preview_script! map zf console filter%space copymap zf zz +# Filter stack +map .n console filter_stack add name%space +map .d filter_stack add type d +map .f filter_stack add type f +map .l filter_stack add type l +map .| filter_stack add or +map .! filter_stack add not +map .c filter_stack clear +map .* filter_stack decompose +map .p filter_stack pop +map .. filter_stack show + # Bookmarks map ` enter_bookmark %any map ' enter_bookmark %any diff --git a/ranger/container/directory.py b/ranger/container/directory.py index e281e6c9..81dabb24 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -155,6 +155,8 @@ class Directory( # pylint: disable=too-many-instance-attributes,too-many-public self.marked_items = [] + self.filter_stack = [] + self._signal_functions = [] func = self.signal_function_factory(self.sort) self._signal_functions += [func] @@ -297,6 +299,7 @@ class Directory( # pylint: disable=too-many-instance-attributes,too-many-public if self.temporary_filter: temporary_filter_search = self.temporary_filter.search filters.append(lambda fobj: temporary_filter_search(fobj.basename)) + filters.extend(self.filter_stack) self.files = [f for f in self.files_all if accept_file(f, filters)] diff --git a/ranger/core/filter_stack.py b/ranger/core/filter_stack.py new file mode 100644 index 00000000..f5b00014 --- /dev/null +++ b/ranger/core/filter_stack.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +# This file is part of ranger, the console file manager. +# License: GNU GPL version 3, see the file "AUTHORS" for details. +# Author: Wojciech Siewierski , 2018 + +from __future__ import (absolute_import, division, print_function) + +import re + +from ranger.container.directory import accept_file, InodeFilterConstants + +# pylint: disable=too-few-public-methods + + +class BaseFilter(object): + def decompose(self): + return [self] + + +SIMPLE_FILTERS = {} +FILTER_COMBINATORS = {} + + +def stack_filter(filter_name): + def decorator(cls): + SIMPLE_FILTERS[filter_name] = cls + return cls + return decorator + + +def filter_combinator(combinator_name): + def decorator(cls): + FILTER_COMBINATORS[combinator_name] = cls + return cls + return decorator + + +@stack_filter("name") +class NameFilter(BaseFilter): + def __init__(self, pattern): + self.pattern = pattern + self.regex = re.compile(pattern) + + def __call__(self, fobj): + return self.regex.search(fobj.relative_path) + + def __str__(self): + return "".format(self.pattern) + + +@stack_filter("type") +class TypeFilter(BaseFilter): + type_to_function = { + InodeFilterConstants.DIRS: + (lambda fobj: fobj.is_directory), + InodeFilterConstants.FILES: + (lambda fobj: fobj.is_file and not fobj.is_link), + InodeFilterConstants.LINKS: + (lambda fobj: fobj.is_link), + } + + def __init__(self, filetype): + if filetype not in self.type_to_function: + raise KeyError(filetype) + self.filetype = filetype + + def __call__(self, fobj): + return self.type_to_function[self.filetype](fobj) + + def __str__(self): + return "".format(self.filetype) + + +@filter_combinator("or") +class OrFilter(BaseFilter): + def __init__(self, stack): + self.subfilters = [stack[-2], stack[-1]] + + stack.pop() + stack.pop() + + stack.append(self) + + def __call__(self, fobj): + # Turn logical AND (accept_file()) into a logical OR with the + # De Morgan's laws. + return not accept_file( + fobj, + ((lambda x, f=filt: not f(x)) + for filt + in self.subfilters), + ) + + def __str__(self): + return "".format(" or ".join(map(str, self.subfilters))) + + def decompose(self): + return self.subfilters + + +@filter_combinator("not") +class NotFilter(BaseFilter): + def __init__(self, stack): + self.subfilter = stack.pop() + stack.append(self) + + def __call__(self, fobj): + return not self.subfilter(fobj) + + def __str__(self): + return "".format(str(self.subfilter)) + + def decompose(self): + return [self.subfilter] -- cgit 1.4.1-2-gfad0 From 4f0cb1333be76c888089c17ca508e7ef17f3400f Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 15 Jul 2018 23:04:47 +0200 Subject: Fix a typo in the manpage --- doc/ranger.1 | 4 ++-- doc/ranger.pod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 5b3afa73..e141011f 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.1" "2018-06-07" "ranger manual" +.TH RANGER 1 "ranger-1.9.1" "2018-07-15" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -690,7 +690,7 @@ scrolling to switch directories. .SH "SETTINGS" .IX Header "SETTINGS" This section lists all built-in settings of ranger. The valid types for the -value are in [brackets]. The hotkey to toggle the setting is in , if +value are in [brackets]. The hotkey to toggle the setting is in , if a hotkey exists. .PP Settings can be changed in the file \fI~/.config/ranger/rc.conf\fR or on the diff --git a/doc/ranger.pod b/doc/ranger.pod index fcee60aa..3062fef5 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -675,7 +675,7 @@ scrolling to switch directories. =head1 SETTINGS This section lists all built-in settings of ranger. The valid types for the -value are in [brackets]. The hotkey to toggle the setting is in , if +value are in [brackets]. The hotkey to toggle the setting is in , if a hotkey exists. Settings can be changed in the file F<~/.config/ranger/rc.conf> or on the -- cgit 1.4.1-2-gfad0 From 4d66aff45c036d085d09cdcfb03c3f51e1641b19 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 15 Jul 2018 23:01:47 +0200 Subject: Add the filter stack docs --- doc/ranger.1 | 29 ++++++++++++++++++++++++++++- doc/ranger.pod | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 5b3afa73..509fc53c 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.1" "2018-06-07" "ranger manual" +.TH RANGER 1 "ranger-1.9.1" "2018-07-15" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -657,6 +657,33 @@ Close the current tab. The last tab cannot be closed this way. A key chain that allows you to quickly change the line mode of all the files of the current directory. For a more permanent solution, use the command \&\*(L"default_linemode\*(R" in your rc.conf. +.IP ".n" 14 +.IX Item ".n" +Apply a new filename filter. +.IP ".d" 14 +.IX Item ".d" +Apply the typefilter \*(L"directory\*(R". +.IP ".f" 14 +.IX Item ".f" +Apply the typefilter \*(L"file\*(R". +.IP ".l" 14 +.IX Item ".l" +Apply the typefilter \*(L"symlink\*(R". +.IP ".|" 14 +Combine te two topmost filters from the filter stack in the \*(L"\s-1OR\*(R"\s0 +relationship, instead of the \*(L"\s-1AND\*(R"\s0 used implicitly. +.IP ".!" 14 +Negate the topmost filter. +.IP ".c" 14 +.IX Item ".c" +Clear the filter stack. +.IP ".*" 14 +Decompose the topmost filter combinator (e.g. \f(CW\*(C`.!\*(C'\fR, \f(CW\*(C`.|\*(C'\fR). +.IP ".p" 14 +.IX Item ".p" +Pop the topmost filter from the filter stack. +.IP ".." 14 +Show the current filter stack state. .SS "READLINE-LIKE \s-1BINDINGS IN THE CONSOLE\s0" .IX Subsection "READLINE-LIKE BINDINGS IN THE CONSOLE" .IP "^B, ^F" 14 diff --git a/doc/ranger.pod b/doc/ranger.pod index fcee60aa..6d7d5a00 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -620,6 +620,47 @@ A key chain that allows you to quickly change the line mode of all the files of the current directory. For a more permanent solution, use the command "default_linemode" in your rc.conf. +=item .n + +Apply a new filename filter. + +=item .d + +Apply the typefilter "directory". + +=item .f + +Apply the typefilter "file". + +=item .l + +Apply the typefilter "symlink". + +=item .| + +Combine te two topmost filters from the filter stack in the "OR" +relationship, instead of the "AND" used implicitly. + +=item .! + +Negate the topmost filter. + +=item .c + +Clear the filter stack. + +=item .* + +Decompose the topmost filter combinator (e.g. C<.!>, C<.|>). + +=item .p + +Pop the topmost filter from the filter stack. + +=item .. + +Show the current filter stack state. + =back =head2 READLINE-LIKE BINDINGS IN THE CONSOLE -- cgit 1.4.1-2-gfad0 From 322479d11c05fdc0264c5eda817b7b3163e99f0a Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 16 Jul 2018 00:29:45 +0200 Subject: Use Pipfile/pipenv to manage the linters We don't want the linters' behavior to suddenly change like right now after the release of pylint 2.0. --- .travis.yml | 13 +++-- Pipfile | 15 +++++ Pipfile.lock | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+), 6 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/.travis.yml b/.travis.yml index f9e31256..7f7ced7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,14 @@ -dist: 'trusty' +dist: 'xenial' language: 'python' python: - - '2.7' - - '3.4' - - '3.5' + - '2.7' + - '3.4' + - '3.5' install: - - 'pip install pytest pylint flake8' + - 'pip install pipenv' + - 'pipenv sync --update' script: - - 'make test' + - 'pipenv run make test' diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..a927408c --- /dev/null +++ b/Pipfile @@ -0,0 +1,15 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[requires] +python_version = "3.5" + +[dev-packages] +pytest = "*" +"flake8" = "*" +pylint = "<2.0.0" +"enum34" = "*" + +[packages] diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 00000000..be0d4a62 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,175 @@ +{ + "_meta": { + "hash": { + "sha256": "ccd51f0d238502cb3001a4b709d4455134eeaebb96800ebaad364567ba1ba784" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.5" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": { + "astroid": { + "hashes": [ + "sha256:0ef2bf9f07c3150929b25e8e61b5198c27b0dca195e156f0e4d5bdd89185ca1a", + "sha256:fc9b582dba0366e63540982c3944a9230cbc6f303641c51483fa547dcc22393a" + ], + "version": "==1.6.5" + }, + "atomicwrites": { + "hashes": [ + "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585", + "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6" + ], + "version": "==1.1.5" + }, + "attrs": { + "hashes": [ + "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", + "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + ], + "version": "==18.1.0" + }, + "enum34": { + "hashes": [ + "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", + "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", + "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", + "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1" + ], + "index": "pypi", + "version": "==1.1.6" + }, + "flake8": { + "hashes": [ + "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", + "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" + ], + "index": "pypi", + "version": "==3.5.0" + }, + "isort": { + "hashes": [ + "sha256:1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", + "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", + "sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" + ], + "version": "==4.3.4" + }, + "lazy-object-proxy": { + "hashes": [ + "sha256:0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", + "sha256:1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39", + "sha256:209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019", + "sha256:27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088", + "sha256:27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b", + "sha256:2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e", + "sha256:2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6", + "sha256:320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b", + "sha256:50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5", + "sha256:5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff", + "sha256:61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd", + "sha256:6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7", + "sha256:7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff", + "sha256:7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d", + "sha256:7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2", + "sha256:7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35", + "sha256:81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4", + "sha256:933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514", + "sha256:94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252", + "sha256:ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109", + "sha256:bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f", + "sha256:cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c", + "sha256:d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92", + "sha256:ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577", + "sha256:e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d", + "sha256:e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d", + "sha256:e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f", + "sha256:eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a", + "sha256:f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b" + ], + "version": "==1.3.1" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, + "more-itertools": { + "hashes": [ + "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8", + "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", + "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0" + ], + "version": "==4.2.0" + }, + "pluggy": { + "hashes": [ + "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff", + "sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c", + "sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5" + ], + "version": "==0.6.0" + }, + "py": { + "hashes": [ + "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7", + "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e" + ], + "version": "==1.5.4" + }, + "pycodestyle": { + "hashes": [ + "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", + "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" + ], + "version": "==2.3.1" + }, + "pyflakes": { + "hashes": [ + "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", + "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" + ], + "version": "==1.6.0" + }, + "pylint": { + "hashes": [ + "sha256:a48070545c12430cfc4e865bf62f5ad367784765681b3db442d8230f0960aa3c", + "sha256:fff220bcb996b4f7e2b0f6812fd81507b72ca4d8c4d05daf2655c333800cb9b3" + ], + "index": "pypi", + "version": "==1.9.2" + }, + "pytest": { + "hashes": [ + "sha256:0453c8676c2bee6feb0434748b068d5510273a916295fd61d306c4f22fbfd752", + "sha256:4b208614ae6d98195430ad6bde03641c78553acee7c83cec2e85d613c0cd383d" + ], + "index": "pypi", + "version": "==3.6.3" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" + }, + "wrapt": { + "hashes": [ + "sha256:d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6" + ], + "version": "==1.10.11" + } + } +} -- cgit 1.4.1-2-gfad0 From fe5a5b64765f8fa5bbfae0a08e026a5c6fb8b47a Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 16 Jul 2018 01:01:49 +0200 Subject: Revert "Use Pipfile/pipenv to manage the linters" This reverts commit 322479d11c05fdc0264c5eda817b7b3163e99f0a. --- .travis.yml | 13 ++--- Pipfile | 15 ----- Pipfile.lock | 175 ----------------------------------------------------------- 3 files changed, 6 insertions(+), 197 deletions(-) delete mode 100644 Pipfile delete mode 100644 Pipfile.lock diff --git a/.travis.yml b/.travis.yml index 7f7ced7b..f9e31256 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ -dist: 'xenial' +dist: 'trusty' language: 'python' python: - - '2.7' - - '3.4' - - '3.5' + - '2.7' + - '3.4' + - '3.5' install: - - 'pip install pipenv' - - 'pipenv sync --update' + - 'pip install pytest pylint flake8' script: - - 'pipenv run make test' + - 'make test' diff --git a/Pipfile b/Pipfile deleted file mode 100644 index a927408c..00000000 --- a/Pipfile +++ /dev/null @@ -1,15 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[requires] -python_version = "3.5" - -[dev-packages] -pytest = "*" -"flake8" = "*" -pylint = "<2.0.0" -"enum34" = "*" - -[packages] diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index be0d4a62..00000000 --- a/Pipfile.lock +++ /dev/null @@ -1,175 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "ccd51f0d238502cb3001a4b709d4455134eeaebb96800ebaad364567ba1ba784" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.5" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": {}, - "develop": { - "astroid": { - "hashes": [ - "sha256:0ef2bf9f07c3150929b25e8e61b5198c27b0dca195e156f0e4d5bdd89185ca1a", - "sha256:fc9b582dba0366e63540982c3944a9230cbc6f303641c51483fa547dcc22393a" - ], - "version": "==1.6.5" - }, - "atomicwrites": { - "hashes": [ - "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585", - "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6" - ], - "version": "==1.1.5" - }, - "attrs": { - "hashes": [ - "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", - "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" - ], - "version": "==18.1.0" - }, - "enum34": { - "hashes": [ - "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", - "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", - "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", - "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1" - ], - "index": "pypi", - "version": "==1.1.6" - }, - "flake8": { - "hashes": [ - "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", - "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" - ], - "index": "pypi", - "version": "==3.5.0" - }, - "isort": { - "hashes": [ - "sha256:1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", - "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", - "sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" - ], - "version": "==4.3.4" - }, - "lazy-object-proxy": { - "hashes": [ - "sha256:0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", - "sha256:1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39", - "sha256:209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019", - "sha256:27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088", - "sha256:27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b", - "sha256:2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e", - "sha256:2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6", - "sha256:320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b", - "sha256:50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5", - "sha256:5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff", - "sha256:61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd", - "sha256:6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7", - "sha256:7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff", - "sha256:7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d", - "sha256:7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2", - "sha256:7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35", - "sha256:81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4", - "sha256:933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514", - "sha256:94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252", - "sha256:ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109", - "sha256:bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f", - "sha256:cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c", - "sha256:d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92", - "sha256:ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577", - "sha256:e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d", - "sha256:e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d", - "sha256:e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f", - "sha256:eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a", - "sha256:f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b" - ], - "version": "==1.3.1" - }, - "mccabe": { - "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" - ], - "version": "==0.6.1" - }, - "more-itertools": { - "hashes": [ - "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8", - "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", - "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0" - ], - "version": "==4.2.0" - }, - "pluggy": { - "hashes": [ - "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff", - "sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c", - "sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5" - ], - "version": "==0.6.0" - }, - "py": { - "hashes": [ - "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7", - "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e" - ], - "version": "==1.5.4" - }, - "pycodestyle": { - "hashes": [ - "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", - "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" - ], - "version": "==2.3.1" - }, - "pyflakes": { - "hashes": [ - "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", - "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" - ], - "version": "==1.6.0" - }, - "pylint": { - "hashes": [ - "sha256:a48070545c12430cfc4e865bf62f5ad367784765681b3db442d8230f0960aa3c", - "sha256:fff220bcb996b4f7e2b0f6812fd81507b72ca4d8c4d05daf2655c333800cb9b3" - ], - "index": "pypi", - "version": "==1.9.2" - }, - "pytest": { - "hashes": [ - "sha256:0453c8676c2bee6feb0434748b068d5510273a916295fd61d306c4f22fbfd752", - "sha256:4b208614ae6d98195430ad6bde03641c78553acee7c83cec2e85d613c0cd383d" - ], - "index": "pypi", - "version": "==3.6.3" - }, - "six": { - "hashes": [ - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" - ], - "version": "==1.11.0" - }, - "wrapt": { - "hashes": [ - "sha256:d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6" - ], - "version": "==1.10.11" - } - } -} -- cgit 1.4.1-2-gfad0 From 53e48ed044b3f69cf21a43a4c9c4450b56972165 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 16 Jul 2018 00:58:30 +0200 Subject: Fix the Travis build I'm so sorry about the accidental push to master! --- .travis.yml | 13 +++-- Pipfile | 15 +++++ Pipfile.lock | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+), 6 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/.travis.yml b/.travis.yml index f9e31256..0efd09fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,14 @@ -dist: 'trusty' +dist: 'xenial' language: 'python' python: - - '2.7' - - '3.4' - - '3.5' + - '2.7' + - '3.4' + - '3.5' install: - - 'pip install pytest pylint flake8' + - 'pip install pipenv' + - 'pipenv update --dev' script: - - 'make test' + - 'make test' diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..a927408c --- /dev/null +++ b/Pipfile @@ -0,0 +1,15 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[requires] +python_version = "3.5" + +[dev-packages] +pytest = "*" +"flake8" = "*" +pylint = "<2.0.0" +"enum34" = "*" + +[packages] diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 00000000..be0d4a62 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,175 @@ +{ + "_meta": { + "hash": { + "sha256": "ccd51f0d238502cb3001a4b709d4455134eeaebb96800ebaad364567ba1ba784" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.5" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": { + "astroid": { + "hashes": [ + "sha256:0ef2bf9f07c3150929b25e8e61b5198c27b0dca195e156f0e4d5bdd89185ca1a", + "sha256:fc9b582dba0366e63540982c3944a9230cbc6f303641c51483fa547dcc22393a" + ], + "version": "==1.6.5" + }, + "atomicwrites": { + "hashes": [ + "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585", + "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6" + ], + "version": "==1.1.5" + }, + "attrs": { + "hashes": [ + "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", + "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + ], + "version": "==18.1.0" + }, + "enum34": { + "hashes": [ + "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", + "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", + "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", + "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1" + ], + "index": "pypi", + "version": "==1.1.6" + }, + "flake8": { + "hashes": [ + "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", + "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" + ], + "index": "pypi", + "version": "==3.5.0" + }, + "isort": { + "hashes": [ + "sha256:1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", + "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", + "sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" + ], + "version": "==4.3.4" + }, + "lazy-object-proxy": { + "hashes": [ + "sha256:0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", + "sha256:1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39", + "sha256:209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019", + "sha256:27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088", + "sha256:27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b", + "sha256:2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e", + "sha256:2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6", + "sha256:320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b", + "sha256:50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5", + "sha256:5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff", + "sha256:61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd", + "sha256:6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7", + "sha256:7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff", + "sha256:7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d", + "sha256:7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2", + "sha256:7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35", + "sha256:81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4", + "sha256:933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514", + "sha256:94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252", + "sha256:ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109", + "sha256:bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f", + "sha256:cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c", + "sha256:d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92", + "sha256:ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577", + "sha256:e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d", + "sha256:e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d", + "sha256:e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f", + "sha256:eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a", + "sha256:f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b" + ], + "version": "==1.3.1" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, + "more-itertools": { + "hashes": [ + "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8", + "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", + "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0" + ], + "version": "==4.2.0" + }, + "pluggy": { + "hashes": [ + "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff", + "sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c", + "sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5" + ], + "version": "==0.6.0" + }, + "py": { + "hashes": [ + "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7", + "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e" + ], + "version": "==1.5.4" + }, + "pycodestyle": { + "hashes": [ + "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", + "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" + ], + "version": "==2.3.1" + }, + "pyflakes": { + "hashes": [ + "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", + "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" + ], + "version": "==1.6.0" + }, + "pylint": { + "hashes": [ + "sha256:a48070545c12430cfc4e865bf62f5ad367784765681b3db442d8230f0960aa3c", + "sha256:fff220bcb996b4f7e2b0f6812fd81507b72ca4d8c4d05daf2655c333800cb9b3" + ], + "index": "pypi", + "version": "==1.9.2" + }, + "pytest": { + "hashes": [ + "sha256:0453c8676c2bee6feb0434748b068d5510273a916295fd61d306c4f22fbfd752", + "sha256:4b208614ae6d98195430ad6bde03641c78553acee7c83cec2e85d613c0cd383d" + ], + "index": "pypi", + "version": "==3.6.3" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" + }, + "wrapt": { + "hashes": [ + "sha256:d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6" + ], + "version": "==1.10.11" + } + } +} -- cgit 1.4.1-2-gfad0 From 712f793e78cde934d3573c6747518d834e7beec8 Mon Sep 17 00:00:00 2001 From: hektr <31568062+hektr@users.noreply.github.com> Date: Wed, 18 Jul 2018 23:54:08 +0300 Subject: Update PYTHON variable `which python3` will likely show the latest version of python installed on system, so, it should go the first. I think, it's not necessary to write all of possible versions of python. You can just use `which python3 || which python`... --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6cd1ec8f..1c3745a6 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,9 @@ VERSION_RIFLE = $(VERSION) SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz # Find suitable python version (need python >= 2.6 or 3.1): PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \ - which python || which python3.3 || which python3.2 || which python3.1 || \ - which python3 || which python2.7 || which python2.6) + which python3 || which python3.6 || which python3.5 || which python3.4 || \ + which python3.3 || which python3.2 || which python3.1 || \ + which python || which python2.7 || which python2.6) SETUPOPTS ?= '--record=install_log.txt' DOCDIR ?= doc/pydoc DESTDIR ?= / -- cgit 1.4.1-2-gfad0 From 3eeb239ec394d0f17656bbf2ec0ea6c9d33a05dd Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Wed, 25 Jul 2018 19:06:33 +1000 Subject: Fix run as root on macOS su on macOS requires the user to be explicitly specified for a command to be run. --- ranger/ext/rifle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index 672b0597..07a76488 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -357,7 +357,7 @@ class Rifle(object): # pylint: disable=too-many-instance-attributes self.hook_before_executing(command, self._mimetype, self._app_flags) try: if 'r' in flags: - prefix = ['sudo', '-E', 'su', '-mc'] + prefix = ['sudo', '-E', 'su', 'root', '-mc'] else: prefix = ['/bin/sh', '-c'] -- cgit 1.4.1-2-gfad0 From 39bf3927332747f791e75163e7847452f4bb1781 Mon Sep 17 00:00:00 2001 From: hektr <31568062+hektr@users.noreply.github.com> Date: Mon, 30 Jul 2018 12:45:21 +0300 Subject: Update rifle I added djview for opening djvu files. --- ranger/config/rifle.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index b1a9bb71..5a87c1a5 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -164,6 +164,7 @@ ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, f ext djvu, has zathura,X, flag f = zathura -- "$@" ext djvu, has evince, X, flag f = evince -- "$@" ext djvu, has atril, X, flag f = atril -- "$@" +ext djvu, has djview, X, flag f = djview -- "$@" ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@" ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@" -- cgit 1.4.1-2-gfad0 From 0e9e9f2e9743b32ad0721b93a7497b640b5bf177 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 31 Jul 2018 01:54:15 +0200 Subject: Fix #1210 for Python 2 (it was never broken for Python 3) The new code from commit 08b08d70 returned a 'unicode' object instead of 'str' but here we were explicitly expecting 'str'. I wanted to use `isinstance(source, basestring)` (or `(str, unicode)` instead of `basestring`)) there but it won't work under Python 3. For now I'm re-encoding every Python 2 unicode string to a UTF-8 encoded 'str' object even though 'unicode' should work just as well, because it would be cumbersome under Python 3 otherwise. --- ranger/core/actions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index ae8e33d4..f8364250 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1088,7 +1088,11 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m data[(-1, -1)] = None data['foundpreview'] = False elif rcode == 2: - data[(-1, -1)] = self.read_text_file(path, 1024 * 32) + text = self.read_text_file(path, 1024 * 32) + if not isinstance(text, str): + # Convert 'unicode' to 'str' in Python 2 + text = text.encode('utf-8') + data[(-1, -1)] = text else: data[(-1, -1)] = None -- cgit 1.4.1-2-gfad0 From 2923398f5049a27fa509d5d5c287e9be089514fa Mon Sep 17 00:00:00 2001 From: Yannick CouziniƩ Date: Mon, 6 Aug 2018 21:07:21 +0200 Subject: Replace StopIteration with bare return A bare return in generators raises StopIteration (this is backwards compatible). Using StopIteration raised a warning in 3.6.x and raises an Error in 3.7.0 (and probably upwards). --- ranger/gui/widgets/pager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 9afbfd15..d64d4ac1 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -234,7 +234,7 @@ class Pager(Widget): # pylint: disable=too-many-instance-attributes def _generate_lines(self, starty, startx): i = starty if not self.source: - raise StopIteration + return while True: try: line = self._get_line(i).expandtabs(4) @@ -244,5 +244,5 @@ class Pager(Widget): # pylint: disable=too-many-instance-attributes line = line[startx:self.wid + startx] yield line.rstrip().replace('\r\n', '\n') except IndexError: - raise StopIteration + return i += 1 -- cgit 1.4.1-2-gfad0 From 89b0c60b69f341a954d898eab031330fb1e1679a Mon Sep 17 00:00:00 2001 From: Mark Blakeney Date: Sun, 19 Aug 2018 14:04:04 +1000 Subject: Remove hard code of ranger path Hard coding the path of ranger prohibits the bash_automatic_cd.sh script from working when the user has installed ranger in a different path such as in /usr/local/bin/, or ~/.local/bin/ etc. --- examples/bash_automatic_cd.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/bash_automatic_cd.sh b/examples/bash_automatic_cd.sh index bdac5757..04b58e24 100644 --- a/examples/bash_automatic_cd.sh +++ b/examples/bash_automatic_cd.sh @@ -6,12 +6,10 @@ # the last visited one after ranger quits. # To undo the effect of this function, you can type "cd -" to return to the # original directory. -# -# On OS X 10 or later, replace `usr/bin/ranger` with `/usr/local/bin/ranger`. function ranger-cd { tempfile="$(mktemp -t tmp.XXXXXX)" - /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" + ranger --choosedir="$tempfile" "${@:-$(pwd)}" test -f "$tempfile" && if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then cd -- "$(cat "$tempfile")" -- cgit 1.4.1-2-gfad0 From 712ec67e1426fe601e99c63ac078d215378299c7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 19 Aug 2018 15:48:45 +0200 Subject: Implement the filter stack rotation Tested to work both ways, so one can rotate by negative number to undo the previous positive rotation. --- doc/ranger.1 | 6 +++++- doc/ranger.pod | 7 ++++++- ranger/config/commands.py | 7 +++++++ ranger/config/rc.conf | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 4ed1e584..8423d068 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -670,10 +670,14 @@ Apply the typefilter \*(L"file\*(R". .IX Item ".l" Apply the typefilter \*(L"symlink\*(R". .IP ".|" 14 -Combine te two topmost filters from the filter stack in the \*(L"\s-1OR\*(R"\s0 +Combine the two topmost filters from the filter stack in the \*(L"\s-1OR\*(R"\s0 relationship, instead of the \*(L"\s-1AND\*(R"\s0 used implicitly. .IP ".!" 14 Negate the topmost filter. +.IP ".r" 14 +.IX Item ".r" +Rotate the filter stack by N elements. Just confirm with enter to +rotate by 1, i.e. move the topmost element to the bottom of the stack. .IP ".c" 14 .IX Item ".c" Clear the filter stack. diff --git a/doc/ranger.pod b/doc/ranger.pod index 849acbb2..6e7075a7 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -638,13 +638,18 @@ Apply the typefilter "symlink". =item .| -Combine te two topmost filters from the filter stack in the "OR" +Combine the two topmost filters from the filter stack in the "OR" relationship, instead of the "AND" used implicitly. =item .! Negate the topmost filter. +=item .r + +Rotate the filter stack by N elements. Just confirm with enter to +rotate by 1, i.e. move the topmost element to the bottom of the stack. + =item .c Clear the filter stack. diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 35aa3ffb..c136db56 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1554,6 +1554,7 @@ class filter_stack(Command): filter_stack add FILTER_TYPE ARGS... filter_stack pop filter_stack decompose + filter_stack rotate [N=1] filter_stack clear filter_stack show """ @@ -1577,6 +1578,12 @@ class filter_stack(Command): self.fm.thisdir.filter_stack.extend(inner_filters) elif subcommand == "clear": self.fm.thisdir.filter_stack = [] + elif subcommand == "rotate": + rotate_by = int(self.arg(2) or 1) + self.fm.thisdir.filter_stack = ( + self.fm.thisdir.filter_stack[-rotate_by:] + + self.fm.thisdir.filter_stack[:-rotate_by] + ) elif subcommand == "show": stack = map(str, self.fm.thisdir.filter_stack) pager = self.fm.ui.open_pager() diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 4d8f1f54..14706dce 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -564,6 +564,7 @@ map .f filter_stack add type f map .l filter_stack add type l map .| filter_stack add or map .! filter_stack add not +map .r console filter_stack rotate map .c filter_stack clear map .* filter_stack decompose map .p filter_stack pop -- cgit 1.4.1-2-gfad0 From 4e326bd9606ef6d4f7851bdca1ea8d5bcce85b73 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 19 Aug 2018 20:27:46 +0200 Subject: Check PYTHON is properly defined We don't need to check for all the various versions, that's just a maintenance burden because `python33` shouldn't ever be available if `python3` isn't. Added a check for whether `PYTHON` is empty or just whitespace because that's useless and could actually lead to problems, if `setup.py` happens to be on the `PATH`. --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1c3745a6..611bb7c3 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,16 @@ NAME_RIFLE = rifle VERSION_RIFLE = $(VERSION) SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz # Find suitable python version (need python >= 2.6 or 3.1): -PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \ - which python3 || which python3.6 || which python3.5 || which python3.4 || \ - which python3.3 || which python3.2 || which python3.1 || \ - which python || which python2.7 || which python2.6) +PYTHON ?= $(shell \ + (python -c 'import sys; sys.exit(sys.version < "2.6")' && \ + which python) \ + || (which python3) \ + || (python2 -c 'import sys; sys.exit(sys.version < "2.6")' && \ + which python2) \ + ) +ifeq ($(strip $(PYTHON)),) + $(error No suitable python found.) +endif SETUPOPTS ?= '--record=install_log.txt' DOCDIR ?= doc/pydoc DESTDIR ?= / -- cgit 1.4.1-2-gfad0 From 5edd2c0f59d7f73c38b49f528d3578dca9e5162b Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 19 Aug 2018 21:18:42 +0200 Subject: Remove strip because whitespace could be a valid name --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 611bb7c3..79b4f9d4 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ PYTHON ?= $(shell \ || (python2 -c 'import sys; sys.exit(sys.version < "2.6")' && \ which python2) \ ) -ifeq ($(strip $(PYTHON)),) +ifeq ($(PYTHON),) $(error No suitable python found.) endif SETUPOPTS ?= '--record=install_log.txt' -- cgit 1.4.1-2-gfad0 From 7d2e57b7a693dd7e8dfc00cb1e52116108b60e9a Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 19 Aug 2018 21:40:13 +0200 Subject: Add an explicit "AND" filter combinator Closes #1268. --- doc/ranger.1 | 4 ++++ doc/ranger.pod | 6 ++++++ ranger/config/rc.conf | 1 + ranger/core/filter_stack.py | 20 ++++++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/doc/ranger.1 b/doc/ranger.1 index 8423d068..060686b8 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -672,6 +672,10 @@ Apply the typefilter \*(L"symlink\*(R". .IP ".|" 14 Combine the two topmost filters from the filter stack in the \*(L"\s-1OR\*(R"\s0 relationship, instead of the \*(L"\s-1AND\*(R"\s0 used implicitly. +.IP ".&" 14 +Explicitly combine the two topmost filters in the \*(L"\s-1AND\*(R"\s0 +relationship. Usually not needed though might be useful in more +complicated scenarios. .IP ".!" 14 Negate the topmost filter. .IP ".r" 14 diff --git a/doc/ranger.pod b/doc/ranger.pod index 6e7075a7..48e6a41e 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -641,6 +641,12 @@ Apply the typefilter "symlink". Combine the two topmost filters from the filter stack in the "OR" relationship, instead of the "AND" used implicitly. +=item .& + +Explicitly combine the two topmost filters in the "AND" +relationship. Usually not needed though might be useful in more +complicated scenarios. + =item .! Negate the topmost filter. diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 14706dce..b112dc2c 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -563,6 +563,7 @@ map .d filter_stack add type d map .f filter_stack add type f map .l filter_stack add type l map .| filter_stack add or +map .& filter_stack add and map .! filter_stack add not map .r console filter_stack rotate map .c filter_stack clear diff --git a/ranger/core/filter_stack.py b/ranger/core/filter_stack.py index f5b00014..ff9f4080 100644 --- a/ranger/core/filter_stack.py +++ b/ranger/core/filter_stack.py @@ -98,6 +98,26 @@ class OrFilter(BaseFilter): return self.subfilters +@filter_combinator("and") +class AndFilter(BaseFilter): + def __init__(self, stack): + self.subfilters = [stack[-2], stack[-1]] + + stack.pop() + stack.pop() + + stack.append(self) + + def __call__(self, fobj): + return accept_file(fobj, self.subfilters) + + def __str__(self): + return "".format(" and ".join(map(str, self.subfilters))) + + def decompose(self): + return self.subfilters + + @filter_combinator("not") class NotFilter(BaseFilter): def __init__(self, stack): -- cgit 1.4.1-2-gfad0 From a3c8c7890014a79689566737418cb111185907ac Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Mon, 20 Aug 2018 22:41:13 +0200 Subject: Check whether tfile is a dir not the entire selection Was erroneously checking the entire selection for being *a* directory but a list of 1 or more files/directories is obviously not a directory. Fixes #1269 --- ranger/core/actions.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 6ddcdd86..443520b1 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -483,13 +483,12 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m mode = narg tfile = self.thisfile selection = self.thistab.get_selection() - if selection: - if selection.is_directory: - self.thistab.enter_dir(tfile) - else: - result = self.execute_file(selection, mode=mode) - if result in (False, ASK_COMMAND): - self.open_console('open_with ') + if tfile.is_directory: + self.thistab.enter_dir(tfile) + elif selection: + result = self.execute_file(selection, mode=mode) + if result in (False, ASK_COMMAND): + self.open_console('open_with ') elif direction.vertical() and cwd.files: pos_new = direction.move( direction=direction.down(), -- cgit 1.4.1-2-gfad0 From 30e5cef1b5b49aa6358dd5eee815ed8b468f7264 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 26 Aug 2018 15:18:43 +0200 Subject: Add as an alias to in console Mimics the behaviour of in Emacs. --- ranger/config/rc.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index b112dc2c..0228725e 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -628,6 +628,7 @@ cmap eval fm.ui.console.delete_rest(-1) cmap eval fm.ui.console.paste() # And of course the emacs way +copycmap copycmap copycmap copycmap -- cgit 1.4.1-2-gfad0 From dbc1ebfd0065576585910730a3f8319297f4dfd7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 28 Aug 2018 11:44:11 +0200 Subject: Fix the filter_stack previews on Python 3 --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index c136db56..d177203a 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1585,7 +1585,7 @@ class filter_stack(Command): + self.fm.thisdir.filter_stack[:-rotate_by] ) elif subcommand == "show": - stack = map(str, self.fm.thisdir.filter_stack) + stack = list(map(str, self.fm.thisdir.filter_stack)) pager = self.fm.ui.open_pager() pager.set_source(["Filter stack: "] + stack) pager.move(to=100, percentage=True) -- cgit 1.4.1-2-gfad0 From 21c51e705e943b4282624b6a23a325ef5cbdaffa Mon Sep 17 00:00:00 2001 From: The Flying Rapist Date: Wed, 29 Aug 2018 20:26:59 -0400 Subject: Applies Tilde Setting to Window Title --- ranger/gui/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 4f76dfab..f357e29d 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -365,7 +365,7 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method DisplayableContainer.draw(self) if self._draw_title and self.settings.update_title: cwd = self.fm.thisdir.path - if cwd.startswith(self.fm.home_path): + if self.settings.tilde_in_titlebar and cwd.startswith(self.fm.home_path): cwd = '~' + cwd[len(self.fm.home_path):] if self.settings.shorten_title: split = cwd.rsplit(os.sep, self.settings.shorten_title) -- cgit 1.4.1-2-gfad0 From 2c04e3364f94c80ecf2f39681b5f380b351fb101 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Fri, 31 Aug 2018 22:54:12 +0200 Subject: Fix the tilde support in the titlebar Previously it was possible to have "/home/user" as one's home and enter "/home/user2", which gets incorrectly abbreviated to "~2/". Now such case is left intact, as expected. --- ranger/gui/ui.py | 4 +++- ranger/gui/widgets/titlebar.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index f357e29d..441e9032 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -365,7 +365,9 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method DisplayableContainer.draw(self) if self._draw_title and self.settings.update_title: cwd = self.fm.thisdir.path - if self.settings.tilde_in_titlebar and cwd.startswith(self.fm.home_path): + if self.settings.tilde_in_titlebar \ + and (cwd == self.fm.home_path + or cwd.startswith(self.fm.home_path + "/")): cwd = '~' + cwd[len(self.fm.home_path):] if self.settings.shorten_title: split = cwd.rsplit(os.sep, self.settings.shorten_title) diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index 042b4b04..765c1248 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -102,8 +102,9 @@ class TitleBar(Widget): bar.add(' ', 'hostname', clr, fixed=True) pathway = self.fm.thistab.pathway - if self.settings.tilde_in_titlebar and \ - self.fm.thisdir.path.startswith(self.fm.home_path): + if self.settings.tilde_in_titlebar \ + and (self.fm.thisdir.path.startswith(self.fm.home_path + "/") + or self.fm.thisdir.path == self.fm.home_path): pathway = pathway[self.fm.home_path.count('/') + 1:] bar.add('~/', 'directory', fixed=True) -- cgit 1.4.1-2-gfad0 From 4201627fc6b05967a5e7d798f452c71713928f23 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 26 Aug 2018 09:51:08 +0200 Subject: Add support for default terminal word-movement commands to console - Alt-b for moving backwards by words, - Alt-f for moving forwards by words. --- ranger/config/rc.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 0228725e..f25589e3 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -617,6 +617,8 @@ cmap eval fm.ui.console.move(right=0, absolute=True) cmap eval fm.ui.console.move(right=-1, absolute=True) cmap eval fm.ui.console.move_word(left=1) cmap eval fm.ui.console.move_word(right=1) +cmap eval fm.ui.console.move_word(left=1) +cmap eval fm.ui.console.move_word(right=1) # Line Editing cmap eval fm.ui.console.delete(-1) -- cgit 1.4.1-2-gfad0 From 66b8e2740c53c21839a08dc2b36cd3289cf12f1f Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 26 Aug 2018 10:08:26 +0200 Subject: Add word-movement commands in console to man-page --- doc/ranger.1 | 30 ++++++++++++++++++++---------- doc/ranger.pod | 8 ++++++++ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 060686b8..380a48dc 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -54,16 +54,20 @@ .\" Avoid warning from groff about undefined register 'F'. .de IX .. -.if !\nF .nr F 0 -.if \nF>0 \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{\ -. nr % 0 -. nr F 2 +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} . \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -169,7 +173,7 @@ plugins, sample configuration files and some programs for integrating ranger with other software. They are usually installed to \&\fI/usr/share/doc/ranger/examples\fR. .PP -The man page of \fIrifle\fR\|(1) describes the functions of the file opener +The man page of \fBrifle\fR\|(1) describes the functions of the file opener .PP The section \fI\s-1LINKS\s0\fR of this man page contains further resources. .SH "POSITIONAL ARGUMENTS" @@ -703,6 +707,12 @@ Move up and down (P for previous, N for Next) .IP "^A, ^E" 14 .IX Item "^A, ^E" Move to the start or to the end +.IP "Alt-B" 14 +.IX Item "Alt-B" +Move backwards by words. +.IP "Alt-F" 14 +.IX Item "Alt-F" +Move forwards by words. .IP "^D" 14 .IX Item "^D" Delete the current character. @@ -1632,7 +1642,7 @@ copy, run: .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fIrifle\fR\|(1) +\&\fBrifle\fR\|(1) .SH "BUGS" .IX Header "BUGS" Report bugs here: diff --git a/doc/ranger.pod b/doc/ranger.pod index 48e6a41e..1b1af68e 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -690,6 +690,14 @@ Move up and down (P for previous, N for Next) Move to the start or to the end +=item Alt-B + +Move backwards by words. + +=item Alt-F + +Move forwards by words. + =item ^D Delete the current character. -- cgit 1.4.1-2-gfad0 From e10321b9f8020bdf4c05a1cddc9f989154de8adf Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 26 Aug 2018 10:09:22 +0200 Subject: Fix punctuation in READLINE-LIKE BINDINGS IN THE CONSOLE Adds full-stops at the end of every entry. --- doc/ranger.1 | 6 +++--- doc/ranger.pod | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 380a48dc..936b10bd 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -700,13 +700,13 @@ Show the current filter stack state. .IX Subsection "READLINE-LIKE BINDINGS IN THE CONSOLE" .IP "^B, ^F" 14 .IX Item "^B, ^F" -Move left and right (B for back, F for forward) +Move left and right (B for back, F for forward). .IP "^P, ^N" 14 .IX Item "^P, ^N" -Move up and down (P for previous, N for Next) +Move up and down (P for previous, N for Next). .IP "^A, ^E" 14 .IX Item "^A, ^E" -Move to the start or to the end +Move to the start or to the end. .IP "Alt-B" 14 .IX Item "Alt-B" Move backwards by words. diff --git a/doc/ranger.pod b/doc/ranger.pod index 1b1af68e..6411292c 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -680,15 +680,15 @@ Show the current filter stack state. =item ^B, ^F -Move left and right (B for back, F for forward) +Move left and right (B for back, F for forward). =item ^P, ^N -Move up and down (P for previous, N for Next) +Move up and down (P for previous, N for Next). =item ^A, ^E -Move to the start or to the end +Move to the start or to the end. =item Alt-B -- cgit 1.4.1-2-gfad0 From 499fb0421b0af276a4c971c0e73f4eb0024a7379 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 26 Aug 2018 13:05:57 +0200 Subject: Revert "Fix punctuation in READLINE-LIKE BINDINGS IN THE CONSOLE" This reverts commit dedbabb8eb6035bcbd44c6163834247f1a0415cd. --- doc/ranger.1 | 6 +++--- doc/ranger.pod | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 936b10bd..380a48dc 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -700,13 +700,13 @@ Show the current filter stack state. .IX Subsection "READLINE-LIKE BINDINGS IN THE CONSOLE" .IP "^B, ^F" 14 .IX Item "^B, ^F" -Move left and right (B for back, F for forward). +Move left and right (B for back, F for forward) .IP "^P, ^N" 14 .IX Item "^P, ^N" -Move up and down (P for previous, N for Next). +Move up and down (P for previous, N for Next) .IP "^A, ^E" 14 .IX Item "^A, ^E" -Move to the start or to the end. +Move to the start or to the end .IP "Alt-B" 14 .IX Item "Alt-B" Move backwards by words. diff --git a/doc/ranger.pod b/doc/ranger.pod index 6411292c..1b1af68e 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -680,15 +680,15 @@ Show the current filter stack state. =item ^B, ^F -Move left and right (B for back, F for forward). +Move left and right (B for back, F for forward) =item ^P, ^N -Move up and down (P for previous, N for Next). +Move up and down (P for previous, N for Next) =item ^A, ^E -Move to the start or to the end. +Move to the start or to the end =item Alt-B -- cgit 1.4.1-2-gfad0 From 442c846f1c4f2f1c1e012008eb15ad57e01d765e Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 1 Sep 2018 10:49:23 +0200 Subject: Add Alt-LEFT and Alt-RIGHT for moving between words in man --- doc/ranger.1 | 8 ++++---- doc/ranger.pod | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 380a48dc..0c55638a 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -707,11 +707,11 @@ Move up and down (P for previous, N for Next) .IP "^A, ^E" 14 .IX Item "^A, ^E" Move to the start or to the end -.IP "Alt-B" 14 -.IX Item "Alt-B" +.IP "Alt-B, Alt-LEFT" 14 +.IX Item "Alt-B, Alt-LEFT" Move backwards by words. -.IP "Alt-F" 14 -.IX Item "Alt-F" +.IP "Alt-F, Alt-RIGHT" 14 +.IX Item "Alt-F, Alt-RIGHT" Move forwards by words. .IP "^D" 14 .IX Item "^D" diff --git a/doc/ranger.pod b/doc/ranger.pod index 1b1af68e..3e269261 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -690,11 +690,11 @@ Move up and down (P for previous, N for Next) Move to the start or to the end -=item Alt-B +=item Alt-B, Alt-LEFT Move backwards by words. -=item Alt-F +=item Alt-F, Alt-RIGHT Move forwards by words. -- cgit 1.4.1-2-gfad0 From 565110840d6a0a54e99b77f797279ccb8e490f94 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 1 Sep 2018 11:01:37 +0200 Subject: Set default and alternative bindings for word-movements - Alt-B and Alt-F are set as the default bindings (cmap), - Alt-LEFT and Alt-RIGHT are set as alternative bindings (copycmap). --- ranger/config/rc.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index f25589e3..59c52084 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -615,11 +615,12 @@ cmap eval fm.ui.console.move(left=1) cmap eval fm.ui.console.move(right=1) cmap eval fm.ui.console.move(right=0, absolute=True) cmap eval fm.ui.console.move(right=-1, absolute=True) -cmap eval fm.ui.console.move_word(left=1) -cmap eval fm.ui.console.move_word(right=1) cmap eval fm.ui.console.move_word(left=1) cmap eval fm.ui.console.move_word(right=1) +copycmap +copycmap + # Line Editing cmap eval fm.ui.console.delete(-1) cmap eval fm.ui.console.delete(0) -- cgit 1.4.1-2-gfad0 From 2c3beb6a8aab819f165956818236892500b13c1a Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 1 Sep 2018 12:07:27 +0200 Subject: Map C-p to `console` for faster history access Allows user to press C-p to open the console from the main view and to press C-p again to go up in the history of previous commands. --- ranger/config/rc.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 59c52084..5ac7cc70 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -349,6 +349,8 @@ map r chain draw_possible_programs; console open_with%%space map f console find%space map cd console cd%space +map console + # Change the line mode map Mf linemode filename map Mi linemode fileinfo -- cgit 1.4.1-2-gfad0 From 94602cd89b4bc9d0b311d16e0ccc6781c829a95b Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 2 Sep 2018 09:50:37 +0200 Subject: Add mapping to open console and pre-fill it with previous command Fixes #1293. Behaviour assigned to Ctrl-p. Non-essential change which can be removed if we find a better use for Ctrl-p. --- ranger/config/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 5ac7cc70..9c1a6a83 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -349,7 +349,7 @@ map r chain draw_possible_programs; console open_with%%space map f console find%space map cd console cd%space -map console +map chain console; eval fm.ui.console.history_move(-1) # Change the line mode map Mf linemode filename -- cgit 1.4.1-2-gfad0 From 3e2cbfe12c760776c66e6b042a5e288a6ee21f26 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 2 Sep 2018 10:03:25 +0200 Subject: Update man --- doc/ranger.1 | 3 +++ doc/ranger.pod | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/doc/ranger.1 b/doc/ranger.1 index 0c55638a..d31b6548 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -643,6 +643,9 @@ to use to open the current file selection. .IP "cd" 14 .IX Item "cd" Open the console with the content \*(L"cd \*(R" +.IP "^P" 14 +.IX Item "^P" +Open the console with the content of the last command. .IP "Alt\-\fIN\fR" 14 .IX Item "Alt-N" Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it diff --git a/doc/ranger.pod b/doc/ranger.pod index 3e269261..a4f6c7df 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -597,6 +597,10 @@ to use to open the current file selection. Open the console with the content "cd " +=item ^P + +Open the console with the content of the last command. + =item Alt-I Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it -- cgit 1.4.1-2-gfad0 From d84a0f10b2a979cb90fb667612cd718d469a549b Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sun, 2 Sep 2018 15:46:28 +0200 Subject: Update man with a clearer entry --- doc/ranger.1 | 2 +- doc/ranger.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index d31b6548..ea010eac 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -645,7 +645,7 @@ to use to open the current file selection. Open the console with the content \*(L"cd \*(R" .IP "^P" 14 .IX Item "^P" -Open the console with the content of the last command. +Open the console with the most recent command. .IP "Alt\-\fIN\fR" 14 .IX Item "Alt-N" Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it diff --git a/doc/ranger.pod b/doc/ranger.pod index a4f6c7df..5c668235 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -599,7 +599,7 @@ Open the console with the content "cd " =item ^P -Open the console with the content of the last command. +Open the console with the most recent command. =item Alt-I -- cgit 1.4.1-2-gfad0