Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_role(s: str):
- return s.split(", ")[-1][:-1]
- def find_closing(s: str, start: int):
- c = 1
- first = s.index('(')
- for x in s[first+1:]:
- if x == '(':
- c += 1
- elif x == ')':
- c -= 1
- if x == 0:
- return c
- def get_body(s: str):
- start = s.index('Map.of')
- end = find_closing(s, start)
- return s[start:end]
- text = []
- while 1:
- try:
- text.append(input())
- except:
- break
- last_status = None
- current = 0
- for s in text:
- if 'withResponseStatusCodeAs' in s:
- last_status = s[s.find("(")+1:s.find(")")]
- if not 'params' in s:
- continue
- role = get_role(s)
- body = get_body(s)
- print(f'Arguments.of({current}, "", {last_status}, {role}, {body},')
- current += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement