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)