mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-07-09 08:33:36 +01:00
wa/commands: pep8 fixes
This commit is contained in:
wa/commands
@ -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
|
||||
|
Reference in New Issue
Block a user