1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Merge branch 'master' of github.com:wting/autojump

This commit is contained in:
Mitchell Ludwig 2018-12-02 18:49:49 -07:00
commit 8abf4a5cdf
12 changed files with 193 additions and 110 deletions

1
.gitignore vendored
View File

@ -5,5 +5,6 @@ __pycache__
*~ *~
*.tar.gz *.tar.gz
*.patch *.patch
.pytest_cache
.tox .tox
tags tags

View File

@ -1,35 +1,51 @@
- repo: git@github.com:pre-commit/pre-commit-hooks.git repos:
sha: v0.9.1 - repo: git@github.com:pre-commit/pre-commit-hooks.git
hooks: rev: v1.4.0
- id: autopep8-wrapper hooks:
args: - id: autopep8-wrapper
- --in-place language_version: python2
- --aggressive args:
- --aggressive - --in-place
- --max-line-length=131 - --aggressive
- --ignore=E126,E128,E402,E731 - --aggressive
- id: check-added-large-files - --ignore=E731
- id: check-ast - --max-line-length=131
- id: check-case-conflict - id: check-added-large-files
- id: check-docstring-first language_version: python2
- id: debug-statements - id: check-ast
- id: double-quote-string-fixer language_version: python2
- id: end-of-file-fixer - id: check-case-conflict
- id: fix-encoding-pragma language_version: python2
- id: flake8 - id: check-docstring-first
args: language_version: python2
- --max-complexity=10 - id: debug-statements
- --max-line-length=131 language_version: python2
- --ignore=E126,E128,E402,E731 - id: double-quote-string-fixer
- --exclude=bin/autojump_argparse.py language_version: python2
- id: requirements-txt-fixer - id: end-of-file-fixer
- id: trailing-whitespace language_version: python2
- repo: git@github.com:asottile/reorder_python_imports.git exclude_types: [batch, lua]
sha: v0.3.5 - id: fix-encoding-pragma
hooks: language_version: python2
- id: reorder-python-imports - id: flake8
language_version: python2.7 language_version: python2
- repo: https://github.com/asottile/add-trailing-comma args:
sha: v0.6.1 - --max-complexity=10
hooks: - --max-line-length=131
- id: add-trailing-comma - --ignore=E402,E731
- --exclude=bin/autojump_argparse.py
- id: name-tests-test
language_version: python2
- id: requirements-txt-fixer
language_version: python2
- id: trailing-whitespace
language_version: python2
- repo: git@github.com:asottile/reorder_python_imports.git
rev: v1.1.1
hooks:
- id: reorder-python-imports
language_version: python2
- repo: git@github.com:asottile/add-trailing-comma
rev: v0.7.0
hooks:
- id: add-trailing-comma

View File

@ -1,5 +1,5 @@
## Summary of release changes, see commit history for more details: ## Summary of release changes, see commit history for more details:
## https://github.com/joelthelion/autojump/commits/master/ ## https://github.com/wting/autojump/commits/master/
### Release v22.4.0: ### Release v22.4.0:
- minor zsh performance improvement - minor zsh performance improvement

View File

@ -1,15 +1,19 @@
VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump) VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump)
TAGNAME = release-v$(VERSION) TAGNAME = release-v$(VERSION)
.PHONY: clean docs install uninstall pre-commit lint tar test .PHONY: install
install: install:
./install.py ./install.py
.PHONY: uninstall
uninstall: uninstall:
./uninstall.py ./uninstall.py
.PHONY: docs
docs: docs:
@echo "% autojump(1) ${TAGNAME}" >docs/manpage_header.md
@echo "%" >>docs/manpage_header.md
@echo "% $(shell \date +%Y-%m-%d)" >>docs/manpage_header.md
pandoc -s -w man docs/manpage_header.md docs/header.md docs/body.md -o docs/autojump.1 pandoc -s -w man docs/manpage_header.md docs/header.md docs/body.md -o docs/autojump.1
pandoc -s -w markdown docs/header.md docs/install.md docs/body.md -o README.md pandoc -s -w markdown docs/header.md docs/install.md docs/body.md -o README.md
@ -17,9 +21,11 @@ docs:
lint: pre-commit lint: pre-commit
@tox -e pre-commit -- run --all-files @tox -e pre-commit -- run --all-files
.PHONY: pre-commit
pre-commit: pre-commit:
@tox -e pre-commit -- install -f --install-hooks @tox -e pre-commit -- install -f --install-hooks
.PHONY: release
release: docs release: docs
# Check for tag existence # Check for tag existence
# git describe release-$(VERSION) 2>&1 >/dev/null || exit 1 # git describe release-$(VERSION) 2>&1 >/dev/null || exit 1
@ -37,20 +43,25 @@ release: docs
git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz
sha1sum autojump_v$(VERSION).tar.gz sha1sum autojump_v$(VERSION).tar.gz
.PHONY: tar
tar: tar:
# Create tagged archive # Create tagged archive
git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz
sha1sum autojump_v$(VERSION).tar.gz sha1sum autojump_v$(VERSION).tar.gz
.PHONY: test
test: pre-commit test: pre-commit
@tox @tox
.PHONY: test-xfail
test-xfail: pre-commit test-xfail: pre-commit
@tox -- --runxfail @tox -- --runxfail
.PHONY: test-fast
test-fast: pre-commit test-fast: pre-commit
@tox -e py27 @tox -e py27
.PHONY: clean
clean: clean:
@find . -type f -iname '*.py[co]' -delete @find . -type f -iname '*.py[co]' -delete
@find . -type d -iname '__pycache__' -delete @find . -type d -iname '__pycache__' -delete

View File

@ -63,29 +63,61 @@ INSTALLATION
### REQUIREMENTS ### REQUIREMENTS
- Python v2.6+ except v3.2 - Python v2.6+ or Python v3.3+
- Supported shells: - Supported shells
- bash v4.0+ - bash - first class support
- zsh - zsh - first class support
- fish - fish - community supported
- tcsh (experimental) - tcsh - community supported
- clink (Windows, experimental) - clink - community supported
- Supported platforms
- Linux - first class support
- OS X - first class support
- Windows - community supported
- BSD - community supported
- Supported installation methods
- source code - first class support
- Debian and derivatives - first class support
- ArchLinux / Gentoo / openSUSE / RedHat and derivatives -
community supported
- Homebrew / MacPorts - community supported
Due to limited time and resources, only "first class support" items will
be maintained by the primary committers. All "community supported" items
will be updated based on pull requests submitted by the general public.
Please continue opening issues and providing feedback for community
supported items since consolidating information helps other users
troubleshoot and submit enhancements and fixes.
### MANUAL
Grab a copy of autojump:
git clone git://github.com/wting/autojump.git
Run the installation script and follow on screen instructions.
cd autojump
./install.py or ./uninstall.py
### AUTOMATIC ### AUTOMATIC
#### Linux #### Linux
autojump is included in the following distro repositories, please use autojump is included in the following distro repositories, please use
relevant package management utilities to install (e.g. yum, apt-get, relevant package management utilities to install (e.g. apt-get, yum,
etc): pacman, etc):
- Debian testing/unstable, Ubuntu, Linux Mint - Debian, Ubuntu, Linux Mint
All Debian-derived distros require manual activation for policy All Debian-derived distros require manual activation for policy
reasons, please see `/usr/share/doc/autojump/README.Debian`. reasons, please see `/usr/share/doc/autojump/README.Debian`.
- RedHat, Fedora, CentOS (install `autojump-zsh` for zsh, - RedHat, Fedora, CentOS
`autojump-fish` for fish, etc.)
Install `autojump-zsh` for zsh, `autojump-fish` for fish, etc.
- ArchLinux - ArchLinux
- Gentoo - Gentoo
- Frugalware - Frugalware
@ -97,7 +129,7 @@ Homebrew is the recommended installation method for Mac OS X:
brew install autojump brew install autojump
MacPorts also available: MacPorts is also available:
port install autojump port install autojump
@ -107,17 +139,6 @@ Windows
Windows support is enabled by [clink](https://mridgers.github.io/clink/) Windows support is enabled by [clink](https://mridgers.github.io/clink/)
which should be installed prior to installing autojump. which should be installed prior to installing autojump.
### MANUAL
Grab a copy of autojump:
git clone git://github.com/joelthelion/autojump.git
Run the installation script and follow on screen instructions.
cd autojump
./install.py or ./uninstall.py
KNOWN ISSUES KNOWN ISSUES
------------ ------------

View File

@ -65,7 +65,7 @@ from autojump_utils import sanitize
from autojump_utils import take from autojump_utils import take
from autojump_utils import unico from autojump_utils import unico
VERSION = '22.5.1' VERSION = '22.5.3'
FUZZY_MATCH_THRESHOLD = 0.6 FUZZY_MATCH_THRESHOLD = 0.6
TAB_ENTRIES_COUNT = 9 TAB_ENTRIES_COUNT = 9
TAB_SEPARATOR = '__' TAB_SEPARATOR = '__'

View File

@ -311,9 +311,11 @@ class HelpFormatter(object):
return help return help
def _join_parts(self, part_strings): def _join_parts(self, part_strings):
return ''.join([part return ''.join([
for part in part_strings part
if part and part is not SUPPRESS]) for part in part_strings
if part and part is not SUPPRESS
])
def _format_usage(self, usage, actions, groups, prefix): def _format_usage(self, usage, actions, groups, prefix):
if prefix is None: if prefix is None:
@ -1526,9 +1528,11 @@ class _ActionsContainer(object):
def _handle_conflict_error(self, action, conflicting_actions): def _handle_conflict_error(self, action, conflicting_actions):
message = _('conflicting option string(s): %s') message = _('conflicting option string(s): %s')
conflict_string = ', '.join([option_string conflict_string = ', '.join([
for option_string, action option_string
in conflicting_actions]) for option_string, action
in conflicting_actions
])
raise ArgumentError(action, message % conflict_string) raise ArgumentError(action, message % conflict_string)
def _handle_conflict_resolve(self, action, conflicting_actions): def _handle_conflict_resolve(self, action, conflicting_actions):
@ -1760,14 +1764,18 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
return action return action
def _get_optional_actions(self): def _get_optional_actions(self):
return [action return [
for action in self._actions action
if action.option_strings] for action in self._actions
if action.option_strings
]
def _get_positional_actions(self): def _get_positional_actions(self):
return [action return [
for action in self._actions action
if not action.option_strings] for action in self._actions
if not action.option_strings
]
# ===================================== # =====================================
# Command line argument parsing methods # Command line argument parsing methods
@ -1991,7 +1999,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
next_option_string_index = min([ next_option_string_index = min([
index index
for index in option_string_indices for index in option_string_indices
if index >= start_index]) if index >= start_index
])
if start_index != next_option_string_index: if start_index != next_option_string_index:
positionals_end_index = consume_positionals(start_index) positionals_end_index = consume_positionals(start_index)
@ -2040,9 +2049,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
# if no actions were used, report the error # if no actions were used, report the error
else: else:
names = [_get_action_name(action) names = [
for action in group._group_actions _get_action_name(action)
if action.help is not SUPPRESS] for action in group._group_actions
if action.help is not SUPPRESS
]
msg = _('one of the arguments %s is required') msg = _('one of the arguments %s is required')
self.error(msg % ' '.join(names)) self.error(msg % ' '.join(names))
@ -2106,8 +2117,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
result = [] result = []
for i in range(len(actions), 0, -1): for i in range(len(actions), 0, -1):
actions_slice = actions[:i] actions_slice = actions[:i]
pattern = ''.join([self._get_nargs_pattern(action) pattern = ''.join([
for action in actions_slice]) self._get_nargs_pattern(action)
for action in actions_slice
])
match = _re.match(pattern, arg_strings_pattern) match = _re.match(pattern, arg_strings_pattern)
if match is not None: if match is not None:
result.extend([len(string) for string in match.groups()]) result.extend([len(string) for string in match.groups()])

View File

@ -120,11 +120,12 @@ def migrate_osx_xdg_data(config):
def save(config, data): def save(config, data):
"""Save data and create backup, creating a new data file if necessary.""" """Save data and create backup, creating a new data file if necessary."""
create_dir(os.path.dirname(config['data_path'])) data_dir = os.path.dirname(config['data_path'])
create_dir(data_dir)
# atomically save by writing to temporary file and moving to destination # atomically save by writing to temporary file and moving to destination
try: try:
temp = NamedTemporaryFile(delete=False) temp = NamedTemporaryFile(delete=False, dir=data_dir)
# Windows cannot reuse the same open file name # Windows cannot reuse the same open file name
temp.close() temp.close()

View File

@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 1.16.0.2 .\" Automatically generated by Pandoc 1.16.0.2
.\" .\"
.TH "autojump" "1" "10 April 2012" "release\-v22" "" .TH "autojump" "1" "2018\-09\-09" "release\-v22.5.3" ""
.hy .hy
.SS NAME .SS NAME
.PP .PP
@ -120,7 +120,7 @@ For any questions or issues please visit:
.IP .IP
.nf .nf
\f[C] \f[C]
https://github.com/joelthelion/autojump/issues https://github.com/wting/autojump/issues
\f[] \f[]
.fi .fi
.SS AUTHORS .SS AUTHORS

View File

@ -17,7 +17,7 @@ REPORTING BUGS
For any questions or issues please visit: For any questions or issues please visit:
https://github.com/joelthelion/autojump/issues https://github.com/wting/autojump/issues
AUTHORS AUTHORS
------- -------

View File

@ -2,28 +2,59 @@
### REQUIREMENTS ### REQUIREMENTS
- Python v2.6+ except v3.2 - Python v2.6+ or Python v3.3+
- Supported shells: - Supported shells
- bash v4.0+ - bash - first class support
- zsh - zsh - first class support
- fish - fish - community supported
- tcsh (experimental) - tcsh - community supported
- clink (Windows, experimental) - clink - community supported
- Supported platforms
- Linux - first class support
- OS X - first class support
- Windows - community supported
- BSD - community supported
- Supported installation methods
- source code - first class support
- Debian and derivatives - first class support
- ArchLinux / Gentoo / openSUSE / RedHat and derivatives - community supported
- Homebrew / MacPorts - community supported
Due to limited time and resources, only "first class support" items will be
maintained by the primary committers. All "community supported" items will be
updated based on pull requests submitted by the general public.
Please continue opening issues and providing feedback for community supported
items since consolidating information helps other users troubleshoot and submit
enhancements and fixes.
### MANUAL
Grab a copy of autojump:
git clone git://github.com/wting/autojump.git
Run the installation script and follow on screen instructions.
cd autojump
./install.py or ./uninstall.py
### AUTOMATIC ### AUTOMATIC
#### Linux #### Linux
autojump is included in the following distro repositories, please use relevant autojump is included in the following distro repositories, please use relevant
package management utilities to install (e.g. yum, apt-get, etc): package management utilities to install (e.g. apt-get, yum, pacman, etc):
- Debian, Ubuntu, Linux Mint - Debian, Ubuntu, Linux Mint
All Debian-derived distros require manual activation for policy reasons, All Debian-derived distros require manual activation for policy reasons,
please see `/usr/share/doc/autojump/README.Debian`. please see `/usr/share/doc/autojump/README.Debian`.
- RedHat, Fedora, CentOS (install `autojump-zsh` for zsh, `autojump-fish` for - RedHat, Fedora, CentOS
fish, etc.)
Install `autojump-zsh` for zsh, `autojump-fish` for fish, etc.
- ArchLinux - ArchLinux
- Gentoo - Gentoo
- Frugalware - Frugalware
@ -35,7 +66,7 @@ Homebrew is the recommended installation method for Mac OS X:
brew install autojump brew install autojump
MacPorts also available: MacPorts is also available:
port install autojump port install autojump
@ -43,14 +74,3 @@ MacPorts also available:
Windows support is enabled by [clink](https://mridgers.github.io/clink/) which Windows support is enabled by [clink](https://mridgers.github.io/clink/) which
should be installed prior to installing autojump. should be installed prior to installing autojump.
### MANUAL
Grab a copy of autojump:
git clone git://github.com/joelthelion/autojump.git
Run the installation script and follow on screen instructions.
cd autojump
./install.py or ./uninstall.py

View File

@ -1,3 +1,3 @@
% autojump(1) release-v22 % autojump(1) release-v22.5.3
% %
% 10 April 2012 % 2018-09-09