1
0

b/c...py: use term specified for length

This commit is contained in:
Intel A80486DX2-66 2024-01-12 20:52:12 +03:00
parent 01efd27e07
commit c6d9d833d0
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -168,18 +168,18 @@ if __name__ == "__main__":
while True: while True:
no_seconds = args.seconds is None or args.seconds == 0 no_seconds = args.seconds is None or args.seconds == 0
no_samples = args.samples is None or args.samples == 0 no_samples = args.samples is None or args.samples == 0
seconds_exist = not no_seconds seconds_specified = not no_seconds
samples_exist = not no_samples samples_specified = not no_samples
if seconds_exist and args.seconds < 0: if seconds_specified and args.seconds < 0:
print("CLI: Count of seconds can't be less than zero.") print("CLI: Count of seconds can't be less than zero.")
raise SystemExit raise SystemExit
if no_seconds and samples_exist: if no_seconds and samples_specified:
samples = args.samples samples = args.samples
elif seconds_exist and samples_exist: elif seconds_specified and samples_specified:
samples = args.seconds * final_sample_rate + args.samples samples = args.seconds * final_sample_rate + args.samples
elif seconds_exist and no_samples: elif seconds_specified and no_samples:
samples = args.seconds * final_sample_rate samples = args.seconds * final_sample_rate
elif no_seconds and no_samples: elif no_seconds and no_samples:
args.seconds = 30 # default args.seconds = 30 # default