RFC: conform to pylint

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-01-16 14:12:19 +02:00
parent 2bcdb0ba54
commit 6fec8b16cd
44 changed files with 2458 additions and 1397 deletions
+44
View File
@@ -1,3 +1,6 @@
import argparse
from dvc.command.base import fix_subparsers
from dvc.command.remote import CmdRemoteAdd
from dvc.command.config import CmdConfig
@@ -9,3 +12,44 @@ class CmdCacheDir(CmdConfig):
self.configobj.filename)
return super(CmdCacheDir, self).run()
def add_parser(subparsers, parent_parser):
from dvc.command.config import parent_config_parser
CACHE_HELP = 'Manage cache settings.'
cache_parser = subparsers.add_parser(
'cache',
parents=[parent_parser],
description=CACHE_HELP,
help=CACHE_HELP)
cache_subparsers = cache_parser.add_subparsers(
dest='cmd',
help='Use dvc cache CMD --help for command-specific help.')
fix_subparsers(cache_subparsers)
parent_cache_config_parser = argparse.ArgumentParser(
add_help=False,
parents=[parent_config_parser])
CACHE_DIR_HELP = 'Configure cache directory location.'
cache_dir_parser = cache_subparsers.add_parser(
'dir',
parents=[parent_cache_config_parser],
description=CACHE_DIR_HELP,
help=CACHE_DIR_HELP)
cache_dir_parser.add_argument(
'-u',
'--unset',
default=False,
action='store_true',
help='Unset option.')
cache_dir_parser.add_argument(
'value',
nargs='?',
default=None,
help="Path to cache directory. Relative paths are resolved relative "
"to the current directory and saved to config relative to the "
"config file location.")
cache_dir_parser.set_defaults(func=CmdCacheDir)