Signed-off-by: Rob Browning <
r...@defaultvalue.org>
Tested-by: Rob Browning <
r...@defaultvalue.org>
---
.pylintrc | 1 +
lib/bup/cmd/web.py | 20 +++++++++-----------
lib/bup/main.py | 24 ++++++++++++------------
3 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/.pylintrc b/.pylintrc
index 4c40adc5..fa47d348 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -26,5 +26,6 @@ enable=
unnecessary-semicolon,
unused-import,
unused-wildcard-import,
+ use-dict-literal,
use-list-literal,
useless-return
diff --git a/lib/bup/cmd/web.py b/lib/bup/cmd/web.py
index 7807a558..80c70af7 100644
--- a/lib/bup/cmd/web.py
+++ b/lib/bup/cmd/web.py
@@ -190,10 +190,10 @@ class BupRequestHandler(tornado.web.RequestHandler):
human_param = ParamInfo(default=1 if human else 0,
from_req=from_req_bool,
normalize=normalize_bool)
- self.bup_param_info = dict(hash=default_false_param,
- hidden=default_false_param,
- human=human_param,
- meta=default_false_param)
+ self.bup_param_info = {'hash': default_false_param,
+ 'hidden': default_false_param,
+ 'human': human_param,
+ 'meta': default_false_param}
def decode_argument(self, value, name=None):
if name == 'path':
@@ -383,11 +383,9 @@ def main(argv):
git.check_repo_or_die()
- settings = dict(
- debug = 1,
- template_path = resource_path(b'web').decode('utf-8'),
- static_path = resource_path(b'web/static').decode('utf-8'),
- )
+ settings = {'debug': 1,
+ 'template_path': resource_path(b'web').decode('utf-8'),
+ 'static_path': resource_path(b'web/static').decode('utf-8')}
# Disable buffering on stdout, for debug messages
try:
@@ -396,8 +394,8 @@ def main(argv):
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
with LocalRepo() as repo:
- handlers = [ (r"(?P<path>/.*)", BupRequestHandler,
- dict(repo=repo, human=opt.human_readable))]
+ handlers = [(r"(?P<path>/.*)", BupRequestHandler,
+ {'repo': repo, 'human': opt.human_readable})]
application = tornado.web.Application(handlers, **settings)
http_server = HTTPServer(application)
diff --git a/lib/bup/main.py b/lib/bup/main.py
index fa2262c2..a8b7f18d 100755
--- a/lib/bup/main.py
+++ b/lib/bup/main.py
@@ -49,18 +49,18 @@ cmdpath = path.cmddir()
def usage(file=sys.stdout):
print('Usage: bup [-?|-h|--help] [-d BUP_DIR] [--debug] [--profile] '
'<command> [options...]\n', file=file)
- common = dict(
- ftp = 'Browse backup sets using an ftp-like client',
- fsck = 'Check backup sets for damage and add redundancy information',
- fuse = 'Mount your backup sets as a filesystem',
- help = 'Print detailed help for the given command',
- index = 'Create or display the index of files to back up',
- on = 'Backup a remote machine to the local one',
- restore = 'Extract files from a backup set',
- save = 'Save files into a backup set (note: run "bup index" first)',
- tag = 'Tag commits for easier access',
- web = 'Launch a web server to examine backup sets',
- )
+ common = {
+ 'ftp': 'Browse backup sets using an ftp-like client',
+ 'fsck': 'Check backup sets for damage and add redundancy information',
+ 'fuse': 'Mount your backup sets as a filesystem',
+ 'help': 'Print detailed help for the given command',
+ 'index': 'Create or display the index of files to back up',
+ 'on': 'Backup a remote machine to the local one',
+ 'restore': 'Extract files from a backup set',
+ 'save': 'Save files into a backup set (note: run "bup index" first)',
+ 'tag': 'Tag commits for easier access',
+ 'web': 'Launch a web server to examine backup sets',
+ }
print('Common commands:\n', file=file)
for cmd,synopsis in sorted(common.items()):
--
2.47.3