From 0bb174905eb5a3d69616a7cf7787b595b89ea2ab Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 16 Nov 2016 03:29:19 +0100 Subject: [PATCH] [mod] pep8 --- moulinette/actionsmap.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/moulinette/actionsmap.py b/moulinette/actionsmap.py index 26656aec..32390855 100644 --- a/moulinette/actionsmap.py +++ b/moulinette/actionsmap.py @@ -369,10 +369,13 @@ class ActionsMap(object): logger.debug("loading actions map namespace '%s'", n) actionsmap_yml = '%s/actionsmap/%s.yml' % (pkg.datadir, n) - actionsmap_yml_stat=os.stat(actionsmap_yml) - actionsmap_pkl = '%s/actionsmap/%s-%d-%d.pkl' % (pkg.cachedir, n, - actionsmap_yml_stat.st_size, - actionsmap_yml_stat.st_mtime) + actionsmap_yml_stat = os.stat(actionsmap_yml) + actionsmap_pkl = '%s/actionsmap/%s-%d-%d.pkl' % ( + pkg.cachedir, + n, + actionsmap_yml_stat.st_size, + actionsmap_yml_stat.st_mtime + ) if use_cache and os.path.exists(actionsmap_pkl): try: @@ -526,8 +529,10 @@ class ActionsMap(object): os.remove('%s/actionsmap/%s' % (pkg.cachedir, i)) # Cache actions map into pickle file - am_file_stat=os.stat(am_file) - pkl='%s-%d-%d.pkl' % (n, am_file_stat.st_size, am_file_stat.st_mtime) + am_file_stat = os.stat(am_file) + + pkl = '%s-%d-%d.pkl' % (n, am_file_stat.st_size, am_file_stat.st_mtime) + with pkg.open_cachefile(pkl, 'w', subdir='actionsmap') as f: pickle.dump(actionsmaps[n], f)