@@ -3402,34 +3402,34 @@ def __process_recorded_actions(self):
3402
3402
if (
3403
3403
(srt_actions[n][0] == "begin" or srt_actions[n][0] == "_url_")
3404
3404
and n > 0
3405
- and srt_actions[n- 1][0] == "sk_op"
3405
+ and srt_actions[n - 1][0] == "sk_op"
3406
3406
):
3407
3407
srt_actions[n][0] = "_skip"
3408
3408
for n in range(len(srt_actions)):
3409
3409
if (
3410
3410
(srt_actions[n][0] == "begin" or srt_actions[n][0] == "_url_")
3411
3411
and n > 1
3412
- and srt_actions[n- 1][0] == "_skip"
3413
- and srt_actions[n- 2][0] == "sk_op"
3414
- and srt_actions[n][2] == srt_actions[n- 1][2]
3412
+ and srt_actions[n - 1][0] == "_skip"
3413
+ and srt_actions[n - 2][0] == "sk_op"
3414
+ and srt_actions[n][2] == srt_actions[n - 1][2]
3415
3415
):
3416
3416
srt_actions[n][0] = "_skip"
3417
3417
for n in range(len(srt_actions)):
3418
3418
if (
3419
3419
(srt_actions[n][0] == "begin" or srt_actions[n][0] == "_url_")
3420
3420
and n > 0
3421
3421
and (
3422
- srt_actions[n- 1][0] == "click"
3423
- or srt_actions[n- 1][0] == "js_cl"
3424
- or srt_actions[n- 1][0] == "js_ca"
3422
+ srt_actions[n - 1][0] == "click"
3423
+ or srt_actions[n - 1][0] == "js_cl"
3424
+ or srt_actions[n - 1][0] == "js_ca"
3425
3425
)
3426
3426
):
3427
- url1 = srt_actions[n- 1][2]
3427
+ url1 = srt_actions[n - 1][2]
3428
3428
if (
3429
- srt_actions[n- 1][0] == "js_cl"
3430
- or srt_actions[n- 1][0] == "js_ca"
3429
+ srt_actions[n - 1][0] == "js_cl"
3430
+ or srt_actions[n - 1][0] == "js_ca"
3431
3431
):
3432
- url1 = srt_actions[n- 1][2][0]
3432
+ url1 = srt_actions[n - 1][2][0]
3433
3433
if url1.endswith("/#/"):
3434
3434
url1 = url1[:-3]
3435
3435
elif url1.endswith("/"):
@@ -3445,19 +3445,19 @@ def __process_recorded_actions(self):
3445
3445
or (len(url1) > 0
3446
3446
and (url2.startswith(url1) or "?search" in url1)
3447
3447
and (int(srt_actions[n][3]) - int(
3448
- srt_actions[n- 1][3]) < 6500))
3448
+ srt_actions[n - 1][3]) < 6500))
3449
3449
):
3450
3450
srt_actions[n][0] = "f_url"
3451
3451
for n in range(len(srt_actions)):
3452
3452
if (
3453
3453
(srt_actions[n][0] == "begin" or srt_actions[n][0] == "_url_")
3454
3454
and n > 0
3455
3455
and (
3456
- srt_actions[n- 1][0] == "begin"
3457
- or srt_actions[n- 1][0] == "_url_"
3456
+ srt_actions[n - 1][0] == "begin"
3457
+ or srt_actions[n - 1][0] == "_url_"
3458
3458
)
3459
3459
):
3460
- url1 = srt_actions[n- 1][2]
3460
+ url1 = srt_actions[n - 1][2]
3461
3461
if url1.endswith("/#/"):
3462
3462
url1 = url1[:-3]
3463
3463
elif url1.endswith("/"):
@@ -3468,64 +3468,66 @@ def __process_recorded_actions(self):
3468
3468
elif url2.endswith("/"):
3469
3469
url2 = url2[:-1]
3470
3470
if url1.replace("www.", "") == url2.replace("www.", ""):
3471
- srt_actions[n- 1][0] = "_skip"
3471
+ srt_actions[n - 1][0] = "_skip"
3472
3472
elif url2.startswith(url1):
3473
3473
srt_actions[n][0] = "f_url"
3474
3474
for n in range(len(srt_actions)):
3475
3475
if (
3476
3476
srt_actions[n][0] == "input"
3477
3477
and n > 0
3478
- and srt_actions[n- 1][0] == "input"
3479
- and srt_actions[n- 1][2] == ""
3478
+ and srt_actions[n - 1][0] == "input"
3479
+ and srt_actions[n - 1][2] == ""
3480
3480
):
3481
- srt_actions[n- 1][0] = "_skip"
3481
+ srt_actions[n - 1][0] = "_skip"
3482
3482
for n in range(len(srt_actions)):
3483
3483
if (
3484
3484
(srt_actions[n][0] == "begin" or srt_actions[n][0] == "_url_")
3485
3485
and n > 0
3486
3486
and (
3487
- srt_actions[n-1][0] == "click"
3488
- or srt_actions[n-1][0] == "js_cl"
3489
- or srt_actions[n-1][0] == "js_ca"
3490
- or srt_actions[n-1][0] == "input"
3487
+ srt_actions[n - 1][0] == "click"
3488
+ or srt_actions[n - 1][0] == "js_cl"
3489
+ or srt_actions[n - 1][0] == "js_ca"
3490
+ or srt_actions[n - 1][0] == "input"
3491
+ )
3492
+ and (
3493
+ int(srt_actions[n][3]) - int(srt_actions[n - 1][3]) < 6500
3491
3494
)
3492
- and (int(srt_actions[n][3]) - int(srt_actions[n-1][3]) < 6500)
3493
3495
):
3494
3496
if (
3495
- srt_actions[n- 1][0] == "click"
3496
- or srt_actions[n- 1][0] == "js_cl"
3497
- or srt_actions[n- 1][0] == "js_ca"
3497
+ srt_actions[n - 1][0] == "click"
3498
+ or srt_actions[n - 1][0] == "js_cl"
3499
+ or srt_actions[n - 1][0] == "js_ca"
3498
3500
):
3499
3501
if (
3500
- srt_actions[n- 1][1].startswith("input")
3501
- or srt_actions[n- 1][1].startswith("button")
3502
+ srt_actions[n - 1][1].startswith("input")
3503
+ or srt_actions[n - 1][1].startswith("button")
3502
3504
):
3503
3505
srt_actions[n][0] = "f_url"
3504
- elif srt_actions[n- 1][0] == "input":
3505
- if srt_actions[n- 1][2].endswith("\n"):
3506
+ elif srt_actions[n - 1][0] == "input":
3507
+ if srt_actions[n - 1][2].endswith("\n"):
3506
3508
srt_actions[n][0] = "f_url"
3507
3509
for n in range(len(srt_actions)):
3508
3510
if (
3509
3511
srt_actions[n][0] == "cho_f"
3510
3512
and n > 0
3511
- and srt_actions[n- 1][0] == "chfil"
3513
+ and srt_actions[n - 1][0] == "chfil"
3512
3514
):
3513
- srt_actions[n- 1][0] = "_skip"
3514
- srt_actions[n][2] = srt_actions[n- 1][1][1]
3515
+ srt_actions[n - 1][0] = "_skip"
3516
+ srt_actions[n][2] = srt_actions[n - 1][1][1]
3515
3517
for n in range(len(srt_actions)):
3516
3518
if (
3517
3519
srt_actions[n][0] == "input"
3518
3520
and n > 0
3519
- and srt_actions[n- 1][0] == "e_mfa"
3521
+ and srt_actions[n - 1][0] == "e_mfa"
3520
3522
):
3521
3523
srt_actions[n][0] = "_skip"
3522
3524
for n in range(len(srt_actions)):
3523
3525
if (
3524
3526
(srt_actions[n][0] == "begin" or srt_actions[n][0] == "_url_")
3525
3527
and n > 0
3526
3528
and (
3527
- srt_actions[n- 1][0] == "submi"
3528
- or srt_actions[n- 1][0] == "e_mfa"
3529
+ srt_actions[n - 1][0] == "submi"
3530
+ or srt_actions[n - 1][0] == "e_mfa"
3529
3531
)
3530
3532
):
3531
3533
srt_actions[n][0] = "f_url"
@@ -3547,13 +3549,13 @@ def __process_recorded_actions(self):
3547
3549
if (
3548
3550
srt_actions[n][0] == "click"
3549
3551
and n > 0
3550
- and srt_actions[n- 1][0] == "ho_cl"
3551
- and srt_actions[n- 1][2] in origins
3552
+ and srt_actions[n - 1][0] == "ho_cl"
3553
+ and srt_actions[n - 1][2] in origins
3552
3554
):
3553
- srt_actions[n- 1][0] = "_skip"
3555
+ srt_actions[n - 1][0] = "_skip"
3554
3556
srt_actions[n][0] = "h_clk"
3555
- srt_actions[n][1] = srt_actions[n- 1][1][0]
3556
- srt_actions[n][2] = srt_actions[n- 1][1][1]
3557
+ srt_actions[n][1] = srt_actions[n - 1][1][0]
3558
+ srt_actions[n][2] = srt_actions[n - 1][1][1]
3557
3559
for n in range(len(srt_actions)):
3558
3560
if srt_actions[n][0] == "chfil" and srt_actions[n][2] in origins:
3559
3561
srt_actions[n][0] = "cho_f"
@@ -3563,9 +3565,9 @@ def __process_recorded_actions(self):
3563
3565
if (
3564
3566
srt_actions[n][0] == "sh_fc"
3565
3567
and n > 0
3566
- and srt_actions[n- 1][0] == "sh_fc"
3568
+ and srt_actions[n - 1][0] == "sh_fc"
3567
3569
):
3568
- srt_actions[n- 1][0] = "_skip"
3570
+ srt_actions[n - 1][0] = "_skip"
3569
3571
ext_actions = []
3570
3572
ext_actions.append("_url_")
3571
3573
ext_actions.append("js_cl")
@@ -3614,8 +3616,8 @@ def __process_recorded_actions(self):
3614
3616
if (
3615
3617
srt_actions[n][0] == "input"
3616
3618
and n > 0
3617
- and srt_actions[n- 1][0] == "js_ty"
3618
- and srt_actions[n][2] == srt_actions[n- 1][2]
3619
+ and srt_actions[n - 1][0] == "js_ty"
3620
+ and srt_actions[n][2] == srt_actions[n - 1][2]
3619
3621
):
3620
3622
srt_actions[n][0] = "_skip"
3621
3623
for n in range(len(srt_actions)):
@@ -8517,13 +8519,13 @@ def get_jqc_button_input(self, message, buttons, options=None):
8517
8519
new_buttons = []
8518
8520
for button in buttons:
8519
8521
if (
8520
- (type(button) is list or type(button) is tuple) and (
8521
- len(button) == 1)
8522
+ (type(button) is list or type(button) is tuple)
8523
+ and ( len(button) == 1)
8522
8524
):
8523
8525
new_buttons.append(button[0])
8524
8526
elif (
8525
- (type(button) is list or type(button) is tuple) and (
8526
- len(button) > 1)
8527
+ (type(button) is list or type(button) is tuple)
8528
+ and ( len(button) > 1)
8527
8529
):
8528
8530
new_buttons.append((button[0], str(button[1]).lower()))
8529
8531
else:
@@ -8587,13 +8589,13 @@ def get_jqc_text_input(self, message, button=None, options=None):
8587
8589
raise Exception('Expecting a string for arg: "message"!')
8588
8590
if button:
8589
8591
if (
8590
- (type(button) is list or type(button) is tuple) and (
8591
- len(button) == 1)
8592
+ (type(button) is list or type(button) is tuple)
8593
+ and ( len(button) == 1)
8592
8594
):
8593
8595
button = (str(button[0]), "")
8594
8596
elif (
8595
- (type(button) is list or type(button) is tuple) and (
8596
- len(button) > 1)
8597
+ (type(button) is list or type(button) is tuple)
8598
+ and ( len(button) > 1)
8597
8599
):
8598
8600
valid_colors = [
8599
8601
"blue",
@@ -8679,13 +8681,13 @@ def get_jqc_form_inputs(self, message, buttons, options=None):
8679
8681
new_buttons = []
8680
8682
for button in buttons:
8681
8683
if (
8682
- (type(button) is list or type(button) is tuple) and (
8683
- len(button) == 1)
8684
+ (type(button) is list or type(button) is tuple)
8685
+ and ( len(button) == 1)
8684
8686
):
8685
8687
new_buttons.append(button[0])
8686
8688
elif (
8687
- (type(button) is list or type(button) is tuple) and (
8688
- len(button) > 1)
8689
+ (type(button) is list or type(button) is tuple)
8690
+ and ( len(button) > 1)
8689
8691
):
8690
8692
new_buttons.append((button[0], str(button[1]).lower()))
8691
8693
else:
0 commit comments