Make --funky print what it should. Normalise() is now __call__()
This commit is contained in:
parent
57d0ab4650
commit
24cd974129
@ -32,7 +32,7 @@ class normalisename:
|
||||
self._separator = separator
|
||||
self._whitelist = set(whitelist)
|
||||
|
||||
def normalise(self, files):
|
||||
def __call__(self, files):
|
||||
for path in files:
|
||||
if not self.check_normal(path):
|
||||
dir = dirname(path)
|
||||
@ -85,11 +85,11 @@ if __name__ == '__main__':
|
||||
|
||||
# define operations
|
||||
listchanges = lambda a, b: print('{}{} --> {}'.format(a, ' '*(60-len(a)), b))
|
||||
listfunky = lambda a, b: print(b)
|
||||
listfunky = lambda a, b: print(a)
|
||||
|
||||
operation = rename
|
||||
if args.dryrun: operation = listchanges
|
||||
elif args.funky: operation = listfunky
|
||||
|
||||
|
||||
normalisename(operation, args.separator, whitelist).normalise(args.files)
|
||||
# do what needs to be done
|
||||
normalisename(operation, args.separator, whitelist)(args.files)
|
||||
|
Loading…
Reference in New Issue
Block a user