diff --git a/wa/commands/create.py b/wa/commands/create.py index eb4397c6..6a598a19 100644 --- a/wa/commands/create.py +++ b/wa/commands/create.py @@ -202,11 +202,13 @@ def create_template_workload(path, name, kind, class_name): with open(source_file, 'w') as wfh: wfh.write(render_template('{}_workload'.format(kind), {'name': name, 'class_name': class_name})) + def create_uiautomator_template_workload(path, name, kind, class_name): uiauto_path = os.path.join(path, 'uiauto') create_uiauto_project(uiauto_path, name) create_template_workload(path, name, kind, class_name) + def create_uiauto_project(path, name): package_name = 'com.arm.wa.uiauto.' + name.lower() @@ -239,14 +241,15 @@ def create_uiauto_project(path, name): # Mapping of workload types to their corresponding creation method create_funcs = { - 'basic' : create_template_workload, - 'apk' : create_template_workload, - 'revent' : create_template_workload, - 'apkrevent' : create_template_workload, - 'uiauto' : create_uiautomator_template_workload, - 'apkuiauto' : create_uiautomator_template_workload, + 'basic': create_template_workload, + 'apk': create_template_workload, + 'revent': create_template_workload, + 'apkrevent': create_template_workload, + 'uiauto': create_uiautomator_template_workload, + 'apkuiauto': create_uiautomator_template_workload, } + # Utility functions def render_template(name, params): filepath = os.path.join(TEMPLATES_DIR, name) @@ -260,6 +263,7 @@ def get_class_name(name, postfix=''): name = identifier(name) return ''.join(map(capitalize, name.split('_'))) + postfix + def touch(path): with open(path, 'w') as _: pass diff --git a/wa/commands/process.py b/wa/commands/process.py index 3627d59e..b6d9e6f9 100644 --- a/wa/commands/process.py +++ b/wa/commands/process.py @@ -48,7 +48,7 @@ class ProcessCommand(Command): Specify an output processor to add from the command line. This can be used to run a processor that is not normally used without - introducing permanent change to the config + introducing permanent change to the config (which one might then forget to revert). This option may be specified multiple times. """) diff --git a/wa/commands/revent.py b/wa/commands/revent.py index 79db3812..6ae2a74b 100644 --- a/wa/commands/revent.py +++ b/wa/commands/revent.py @@ -231,6 +231,7 @@ class RecordCommand(Command): return output_path, file_name + class ReplayCommand(Command): name = 'replay' diff --git a/wa/commands/run.py b/wa/commands/run.py index 5cb5738d..4901b25e 100644 --- a/wa/commands/run.py +++ b/wa/commands/run.py @@ -91,7 +91,7 @@ class RunCommand(Command): description='Run log.') disabled_augmentations = toggle_set([i != '~~' and "~{}".format(i) or i - for i in args.augmentations_to_disable]) + for i in args.augmentations_to_disable]) config.jobs_config.disable_augmentations(disabled_augmentations) config.jobs_config.only_run_ids(args.only_run_ids) @@ -122,7 +122,7 @@ class RunCommand(Command): try: return init_run_output(output_directory, config, args.force) except RuntimeError as e: - if 'path exists' in str(e): + if 'path exists' in str(e): msg = 'Output directory "{}" exists.\nPlease specify another '\ 'location, or use -f option to overwrite.' self.logger.critical(msg.format(output_directory)) diff --git a/wa/commands/show.py b/wa/commands/show.py index ebda053e..1e8ce87f 100644 --- a/wa/commands/show.py +++ b/wa/commands/show.py @@ -110,8 +110,9 @@ def get_rst_from_target(target): def get_rst_for_global_config(): text = underline('Global Configuration') text += 'These parameters control the behaviour of WA/run as a whole, they ' \ - 'should be set inside a config file (either located in $WA_USER_DIRECTORY/config.yaml ' \ - 'or one which is specified with -c), or into config/global section of the agenda.\n\n' + 'should be set inside a config file (either located in ' \ + '$WA_USER_DIRECTORY/config.yaml or one which is specified with -c), ' \ + 'or into config/global section of the agenda.\n\n' cfg_points = MetaConfiguration.config_points + RunConfiguration.config_points text += get_params_rst(cfg_points)