mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-10 03:24:17 +00:00
add pyflakes and fix errors
This commit is contained in:
@@ -109,6 +109,5 @@ class Comparator:
|
||||
opts=self.diffopts, debug=self.debug)
|
||||
if header:
|
||||
lshort = os.path.basename(left)
|
||||
rshort = os.path.basename(right)
|
||||
diff = '=> diff \"{}\":\n{}'.format(lshort, diff)
|
||||
return diff
|
||||
|
||||
@@ -14,7 +14,7 @@ from dotdrop.dotfile import Dotfile
|
||||
from dotdrop.templategen import Templategen
|
||||
from dotdrop.logger import Logger
|
||||
from dotdrop.action import Action, Transform
|
||||
from dotdrop.utils import *
|
||||
from dotdrop.utils import strip_home, shell
|
||||
from dotdrop.linktypes import LinkTypes
|
||||
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ def cmd_update(o):
|
||||
showpatch = o.update_showpatch
|
||||
|
||||
updater = Updater(o.dotpath, o.dotfiles, o.variables,
|
||||
o.dry, o.safe, iskey=iskey, debug=o.debug,
|
||||
dry=o.dry, safe=o.safe, debug=o.debug,
|
||||
ignore=ignore, showpatch=showpatch)
|
||||
if not iskey:
|
||||
# update paths
|
||||
|
||||
@@ -12,8 +12,8 @@ class Dotfile:
|
||||
|
||||
def __init__(self, key, dst, src,
|
||||
actions={}, trans_r=None, trans_w=None,
|
||||
link=LinkTypes.NOLINK, cmpignore=[], noempty=False,
|
||||
upignore=[]):
|
||||
link=LinkTypes.NOLINK, cmpignore=[],
|
||||
noempty=False, upignore=[]):
|
||||
"""constructor
|
||||
@key: dotfile key
|
||||
@dst: dotfile dst (in user's home usually)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
author: deadc0de6 (https://github.com/deadc0de6)
|
||||
Copyright (c) 2017, deadc0de6
|
||||
|
||||
provides logging functions
|
||||
provide logging functions
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
@@ -157,6 +157,7 @@ class Options:
|
||||
# the dotfiles
|
||||
self.dotfiles = self.conf.eval_dotfiles(self.profile, self.variables,
|
||||
debug=self.debug).copy()
|
||||
# the profiles
|
||||
self.profiles = self.conf.get_profiles()
|
||||
|
||||
def _print_attr(self):
|
||||
|
||||
@@ -20,15 +20,14 @@ TILD = '~'
|
||||
|
||||
class Updater:
|
||||
|
||||
def __init__(self, dotpath, dotfiles, variables, dry, safe,
|
||||
iskey=False, debug=False, ignore=[], showpatch=False):
|
||||
def __init__(self, dotpath, dotfiles, variables, dry=False, safe=True,
|
||||
debug=False, ignore=[], showpatch=False):
|
||||
"""constructor
|
||||
@dotpath: path where dotfiles are stored
|
||||
@dotfiles: dotfiles for this profile
|
||||
@variables: dictionary of variables for the templates
|
||||
@dry: simulate
|
||||
@safe: ask for overwrite if True
|
||||
@iskey: will the update be called on keys or path
|
||||
@debug: enable debug
|
||||
@ignore: pattern to ignore when updating
|
||||
@showpatch: show patch if dotfile to update is a template
|
||||
@@ -38,7 +37,6 @@ class Updater:
|
||||
self.variables = variables
|
||||
self.dry = dry
|
||||
self.safe = safe
|
||||
self.iskey = iskey
|
||||
self.debug = debug
|
||||
self.ignore = ignore
|
||||
self.showpatch = showpatch
|
||||
|
||||
@@ -10,8 +10,6 @@ import tempfile
|
||||
import os
|
||||
import uuid
|
||||
import shlex
|
||||
import functools
|
||||
import operator
|
||||
import fnmatch
|
||||
from shutil import rmtree
|
||||
|
||||
|
||||
Reference in New Issue
Block a user