Browse Source

Allow --steps without --altered

tags/v1.2.10
Ivan Bravo Bravo 1 year ago
parent
commit
2a97ee89e6
2 changed files with 17 additions and 5 deletions
  1. 1
    1
      argv/run/config.py
  2. 16
    4
      processing/image.py

+ 1
- 1
argv/run/config.py View File

@@ -17,7 +17,7 @@ def set_args_run_parser(args):
def check_args_run_parser(parser, args):
check_arg_input(parser, args)
check_arg_output(parser, args)
check_args_altered(parser, args)
#check_args_altered(parser, args)
check_arg_checkpoints(parser, args)



+ 16
- 4
processing/image.py View File

@@ -39,6 +39,11 @@ class ImageProcessing(Processing):

self._args['folder_altered'] = folder_path
path = self._args['folder_altered']

self.__image_steps = [self.__input_path] + [
os.path.join(path, "{}.png".format(p().__class__.__name__))
for p in self.__phases[:self.__starting_step]
]
elif (self.__altered_path):
folder_name = imagename_no_ext + '_' + str(hashlib.md5(open(self.__input_path, 'rb').read()).hexdigest())
folder_path = os.path.join(self.__altered_path, folder_name)
@@ -49,10 +54,17 @@ class ImageProcessing(Processing):
self.__altered_path = folder_path
path = self.__altered_path

self.__image_steps = [self.__input_path] + [
os.path.join(path, "{}.png".format(p().__class__.__name__))
for p in self.__phases[:self.__starting_step]
]
self.__image_steps = [self.__input_path] + [
os.path.join(path, "{}.png".format(p().__class__.__name__))
for p in self.__phases[:self.__starting_step]
]
else:
# TODO: refactor me, please!
self.__image_steps = [self.__input_path] + [
self.__input_path
for p in self.__phases[0:(self.__starting_step - 1)]
]

Conf.log.info("Processing on {}".format(str(self.__image_steps)[2:-2]))
Conf.log.debug(self.__image_steps)


Loading…
Cancel
Save