mirror of
https://github.com/wting/autojump
synced 2026-03-02 03:49:26 +00:00
@@ -21,7 +21,6 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from difflib import SequenceMatcher
|
||||
from itertools import chain
|
||||
from math import sqrt
|
||||
@@ -39,6 +38,8 @@ else:
|
||||
from itertools import ifilter
|
||||
from itertools import imap
|
||||
|
||||
from autojump_argparse import ArgumentParser
|
||||
|
||||
from autojump_data import dictify
|
||||
from autojump_data import entriefy
|
||||
from autojump_data import Entry
|
||||
@@ -206,7 +207,6 @@ def handle_tab_completion(needle, entries):
|
||||
TAB_SEPARATOR)
|
||||
|
||||
|
||||
|
||||
def match_anywhere(needles, haystack, ignore_case=False):
|
||||
"""
|
||||
Matches needles anywhere in the path as long as they're in the same (but
|
||||
@@ -334,7 +334,7 @@ def print_stats(data, data_path):
|
||||
print("\ndata:\t %s" % data_path)
|
||||
|
||||
|
||||
def main(args):
|
||||
def main(args): # noqa
|
||||
config = set_defaults()
|
||||
|
||||
# all arguments are mutually exclusive
|
||||
|
||||
2363
bin/autojump_argparse.py
Normal file
2363
bin/autojump_argparse.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -31,14 +31,16 @@ def create_dir(path):
|
||||
def decode(string):
|
||||
"""Converts byte string to Unicode string."""
|
||||
if is_python2():
|
||||
return string.decode('utf-8', errors='replace')
|
||||
# Python 2.6 does not support kwargs
|
||||
return string.decode('utf-8', 'replace')
|
||||
return string
|
||||
|
||||
|
||||
def encode(string):
|
||||
"""Converts Unicode string to byte string."""
|
||||
if is_python2():
|
||||
return string.encode('utf-8', errors='replace')
|
||||
# Python 2.6 does not support kwargs
|
||||
return string.encode('utf-8', 'replace')
|
||||
return string
|
||||
|
||||
|
||||
@@ -192,8 +194,9 @@ def surround_quotes(string):
|
||||
Bash has problems dealing with certain paths so we're surrounding all
|
||||
path outputs with quotes.
|
||||
"""
|
||||
if in_bash():
|
||||
return '"{}"'.format(string)
|
||||
if in_bash() and string:
|
||||
# Python 2.6 requres field numbers
|
||||
return '"{0}"'.format(string)
|
||||
return string
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user