@@ -53,9 +53,9 @@ def make_zulip_client() -> zulip.Client:
53
53
54
54
def to_zulip_username (zephyr_username : str ) -> str :
55
55
if "@" in zephyr_username :
56
- ( user , realm ) = zephyr_username .split ("@" )
56
+ user , realm = zephyr_username .split ("@" )
57
57
else :
58
- ( user , realm ) = (zephyr_username , "ATHENA.MIT.EDU" )
58
+ user , realm = (zephyr_username , "ATHENA.MIT.EDU" )
59
59
if realm .upper () == "ATHENA.MIT.EDU" :
60
60
# Hack to make ctl's fake username setup work :)
61
61
if user .lower () == "golem" :
@@ -65,7 +65,7 @@ def to_zulip_username(zephyr_username: str) -> str:
65
65
66
66
67
67
def to_zephyr_username (zulip_username : str ) -> str :
68
- ( user , realm ) = zulip_username .split ("@" )
68
+ user , realm = zulip_username .split ("@" )
69
69
if "|" not in user :
70
70
# Hack to make ctl's fake username setup work :)
71
71
if user .lower () == "ctl" :
@@ -358,7 +358,7 @@ def process_loop(zulip_queue: "Queue[ZephyrDict]", log: Optional[IO[str]]) -> No
358
358
359
359
def parse_zephyr_body (zephyr_data : str , notice_format : str ) -> Tuple [str , str ]:
360
360
try :
361
- ( zsig , body ) = zephyr_data .split ("\x00 " , 1 )
361
+ zsig , body = zephyr_data .split ("\x00 " , 1 )
362
362
if notice_format in (
363
363
"New transaction [$1] entered in $2\n From: $3 ($5)\n Subject: $4" ,
364
364
"New transaction [$1] entered in $2\n From: $3\n Subject: $4" ,
@@ -374,7 +374,7 @@ def parse_zephyr_body(zephyr_data: str, notice_format: str) -> Tuple[str, str]:
374
374
fields [3 ],
375
375
)
376
376
except ValueError :
377
- ( zsig , body ) = ( "" , zephyr_data )
377
+ zsig , body = "" , zephyr_data
378
378
# Clean body of any null characters, since they're invalid in our protocol.
379
379
body = body .replace ("\x00 " , "" )
380
380
return (zsig , body )
@@ -448,7 +448,7 @@ def process_notice(
448
448
notice : zephyr_ctypes .ZNotice_t , zulip_queue : "Queue[ZephyrDict]" , log : Optional [IO [str ]]
449
449
) -> None :
450
450
assert notice .z_sender is not None
451
- ( zsig , body ) = parse_zephyr_body (
451
+ zsig , body = parse_zephyr_body (
452
452
notice .z_message [: notice .z_message_len ].decode (errors = "replace" ),
453
453
notice .z_default_format .decode (errors = "replace" ),
454
454
)
@@ -852,7 +852,7 @@ class and your mirroring bot does not have access to the relevant \
852
852
logger .debug ("Would have forwarded: %r\n %s" , zwrite_args , wrapped_content )
853
853
return
854
854
855
- ( code , stderr ) = send_authed_zephyr (zwrite_args , wrapped_content )
855
+ code , stderr = send_authed_zephyr (zwrite_args , wrapped_content )
856
856
if code == 0 and stderr == "" :
857
857
return
858
858
elif code == 0 :
@@ -876,7 +876,7 @@ class and your mirroring bot does not have access to the relevant \
876
876
):
877
877
# Retry sending the message unauthenticated; if that works,
878
878
# just notify the user that they need to renew their tickets
879
- ( code , stderr ) = send_unauthed_zephyr (zwrite_args , wrapped_content )
879
+ code , stderr = send_unauthed_zephyr (zwrite_args , wrapped_content )
880
880
if code == 0 :
881
881
if options .ignore_expired_tickets :
882
882
return
@@ -1106,7 +1106,7 @@ def parse_zephyr_subs(verbose: bool = False) -> Set[Tuple[str, str, str]]:
1106
1106
if len (line ) == 0 :
1107
1107
continue
1108
1108
try :
1109
- ( cls , instance , recipient ) = line .split ("," )
1109
+ cls , instance , recipient = line .split ("," )
1110
1110
cls = cls .replace ("%me%" , options .user )
1111
1111
instance = instance .replace ("%me%" , options .user )
1112
1112
recipient = recipient .replace ("%me%" , options .user )
@@ -1252,7 +1252,7 @@ def die_gracefully(signal: int, frame: Optional[FrameType]) -> None:
1252
1252
1253
1253
signal .signal (signal .SIGINT , die_gracefully )
1254
1254
1255
- ( options , args ) = parse_args ()
1255
+ options , args = parse_args ()
1256
1256
1257
1257
logger = open_logger ()
1258
1258
configure_logger (logger , "parent" )
0 commit comments