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

Fix flake8 errors.

This commit is contained in:
William Ting 2014-10-04 18:45:36 -07:00
parent 5538cf70f3
commit 3c658dc64f
2 changed files with 23 additions and 24 deletions

View File

@ -94,8 +94,7 @@ def set_defaults():
def parse_arguments(): def parse_arguments():
parser = ArgumentParser( parser = ArgumentParser(
description='Automatically jump to directory passed as an \ description='Automatically jump to directory passed as an argument.',
argument.',
epilog="Please see autojump(1) man pages for full documentation.") epilog="Please see autojump(1) man pages for full documentation.")
parser.add_argument( parser.add_argument(
'directory', metavar='DIRECTORY', nargs='*', default='', 'directory', metavar='DIRECTORY', nargs='*', default='',

View File

@ -44,8 +44,8 @@ def modify_autojump_sh(etc_dir, dryrun=False):
def modify_autojump_lua(clink_dir, bin_dir, dryrun=False): def modify_autojump_lua(clink_dir, bin_dir, dryrun=False):
"""Prepend custom AUTOJUMP_BIN_DIR definition to autojump.lua""" """Prepend custom AUTOJUMP_BIN_DIR definition to autojump.lua"""
custom_install = "local AUTOJUMP_BIN_DIR = \"%s\"\n" % bin_dir.replace( custom_install = "local AUTOJUMP_BIN_DIR = \"%s\"\n" % bin_dir.replace(
"\\", "\\",
"\\\\") "\\\\")
clink_file = os.path.join(clink_dir, 'autojump.lua') clink_file = os.path.join(clink_dir, 'autojump.lua')
with open(clink_file, 'r') as f: with open(clink_file, 'r') as f:
original = f.read() original = f.read()
@ -56,12 +56,12 @@ def modify_autojump_lua(clink_dir, bin_dir, dryrun=False):
def parse_arguments(): # noqa def parse_arguments(): # noqa
if platform.system() == 'Windows': if platform.system() == 'Windows':
default_user_destdir = os.path.join( default_user_destdir = os.path.join(
os.getenv('LOCALAPPDATA', ''), os.getenv('LOCALAPPDATA', ''),
'autojump') 'autojump')
else: else:
default_user_destdir = os.path.join( default_user_destdir = os.path.join(
os.path.expanduser("~"), os.path.expanduser("~"),
'.autojump') '.autojump')
default_user_prefix = '' default_user_prefix = ''
default_user_zshshare = 'functions' default_user_zshshare = 'functions'
default_system_destdir = '/' default_system_destdir = '/'
@ -70,29 +70,29 @@ def parse_arguments(): # noqa
default_clink_dir = os.path.join(os.getenv('LOCALAPPDATA', ''), 'clink') default_clink_dir = os.path.join(os.getenv('LOCALAPPDATA', ''), 'clink')
parser = ArgumentParser( parser = ArgumentParser(
description='Installs autojump globally for root users, otherwise \ description='Installs autojump globally for root users, otherwise \
installs in current user\'s home directory.') installs in current user\'s home directory.')
parser.add_argument( parser.add_argument(
'-n', '--dryrun', action="store_true", default=False, '-n', '--dryrun', action="store_true", default=False,
help='simulate installation') help='simulate installation')
parser.add_argument( parser.add_argument(
'-f', '--force', action="store_true", default=False, '-f', '--force', action="store_true", default=False,
help='skip root user, shell type, Python version checks') help='skip root user, shell type, Python version checks')
parser.add_argument( parser.add_argument(
'-d', '--destdir', metavar='DIR', default=default_user_destdir, '-d', '--destdir', metavar='DIR', default=default_user_destdir,
help='set destination to DIR') help='set destination to DIR')
parser.add_argument( parser.add_argument(
'-p', '--prefix', metavar='DIR', default=default_user_prefix, '-p', '--prefix', metavar='DIR', default=default_user_prefix,
help='set prefix to DIR') help='set prefix to DIR')
parser.add_argument( parser.add_argument(
'-z', '--zshshare', metavar='DIR', default=default_user_zshshare, '-z', '--zshshare', metavar='DIR', default=default_user_zshshare,
help='set zsh share destination to DIR') help='set zsh share destination to DIR')
parser.add_argument( parser.add_argument(
'-c', '--clinkdir', metavar='DIR', default=default_clink_dir, '-c', '--clinkdir', metavar='DIR', default=default_clink_dir,
help='set clink directory location to DIR (Windows only)') help='set clink directory location to DIR (Windows only)')
parser.add_argument( parser.add_argument(
'-s', '--system', action="store_true", default=False, '-s', '--system', action="store_true", default=False,
help='install system wide for all users') help='install system wide for all users')
args = parser.parse_args() args = parser.parse_args()