Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added verbose arg #245

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions user_apps/web/compose_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def run_main(args):
'lines' : lines
}
}
if args.verbose:
print('Json: ')
print(json.dumps(payload, indent=2))

send_to_endpoint(url, payload)

if args.output and args.pattern and args.segment:
Expand All @@ -67,6 +71,10 @@ def run_main(args):
'segment': args.segment,
}
}
if args.verbose:
print('Json: ')
print(json.dumps(payload, indent=2))

send_to_endpoint(url, payload)

if args.next_seg:
Expand All @@ -76,8 +84,6 @@ def run_main(args):

def send_to_endpoint(url, payload):
print(f"\nSending to {url}")
print('Json: ')
print(json.dumps(payload, indent=2))
try:
r = requests.post(url, json=payload)
print(f"[{r.status_code}] {r.text}")
Expand All @@ -102,6 +108,7 @@ def get_parser():
parser.add_argument('--nreps', default='', help="Number of pattern repetitions")
parser.add_argument('--segment', default='', choices=['A', 'B', 'C', 'D', 'E'], help="Set segment")
parser.add_argument('--next_seg', default=None, type=list_of_strings, help="Queue next_seg active segments")
parser.add_argument('--verbose', default=0, type=int, help="increase verbosity")

parser.add_argument('pattern', nargs='*', help="Pattern to compose ie 5*AA 5*BB")
parser.add_argument('uut', help="uut hostname")
Expand Down