From 24cd974129f9211599ab1a82551c7f12f97f3593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Wed, 23 Aug 2017 23:27:50 +0200 Subject: [PATCH] Make --funky print what it should. Normalise() is now __call__() --- normalisename.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/normalisename.py b/normalisename.py index 4bf1ea0..da4d163 100755 --- a/normalisename.py +++ b/normalisename.py @@ -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)