[REF] main: refactor the entry function to make it more readable

This commit is contained in:
Ahmed Mohamed
2024-04-15 19:09:04 +02:00
committed by Ahmed Saeed
parent 16ee7355dc
commit c1fcde3ac5
3 changed files with 32 additions and 43 deletions

View File

@@ -95,9 +95,11 @@ def urls_import(path, method, headers, include):
def request_import(path):
"""
imports request from a raw request file
returns dict
returns list
"""
return parse_request(reader(path))
result = []
result.append(parse_request(reader(path)))
return result
def importer(path, method, headers, include):
@@ -112,4 +114,4 @@ def importer(path, method, headers, include):
return urls_import(path, method, headers, include)
elif line.startswith(('GET', 'POST')):
return request_import(path)
return 'unknown'
return []