-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify_param.py
25 lines (23 loc) · 935 Bytes
/
verify_param.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import Application_setup as appsetup
import abc
class VerifyParameters:
@classmethod
def create_appropriate_app_verification(cls, args: dict):
try:
if args['task'] in appsetup.TASKS:
task_name = args['task']
verification_method = appsetup.TASKS[task_name](args)
verified = verification_method.verify_parameters()
if verified:
return verified, verification_method.settings()
else:
return verified, None
else:
# TODO
# Check if this block of code executes or not.
task_list = ''
for each in appsetup.TASKS.keys():
task_list += '-' + each + '\n'
print(f'Invalid Task. Possible tasks are: \n \t {task_list}')
except KeyError as e:
print(f' {e} Not found.')