python: Normalize quotes with Black.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:20:45 -08:00
committed by Tim Abbott
parent 11741543da
commit 6e4c3e41dc
989 changed files with 32792 additions and 32792 deletions

View File

@@ -12,8 +12,8 @@ def process_zcommands(content: str, user_profile: UserProfile) -> Dict[str, Any]
command: str, switch_command: str, setting: str, setting_value: int
) -> str:
msg = (
'Changed to {command} mode! To revert '
'{command} mode, type `/{switch_command}`.'.format(
"Changed to {command} mode! To revert "
"{command} mode, type `/{switch_command}`.".format(
command=command,
switch_command=switch_command,
)
@@ -23,54 +23,54 @@ def process_zcommands(content: str, user_profile: UserProfile) -> Dict[str, Any]
)
return msg
if not content.startswith('/'):
raise JsonableError(_('There should be a leading slash in the zcommand.'))
if not content.startswith("/"):
raise JsonableError(_("There should be a leading slash in the zcommand."))
command = content[1:]
if command == 'ping':
if command == "ping":
return {}
elif command == 'night':
elif command == "night":
if user_profile.color_scheme == UserProfile.COLOR_SCHEME_NIGHT:
return dict(msg='You are still in night mode.')
return dict(msg="You are still in night mode.")
return dict(
msg=change_mode_setting(
command=command,
switch_command='day',
setting='color_scheme',
switch_command="day",
setting="color_scheme",
setting_value=UserProfile.COLOR_SCHEME_NIGHT,
)
)
elif command == 'day':
elif command == "day":
if user_profile.color_scheme == UserProfile.COLOR_SCHEME_LIGHT:
return dict(msg='You are still in day mode.')
return dict(msg="You are still in day mode.")
return dict(
msg=change_mode_setting(
command=command,
switch_command='night',
setting='color_scheme',
switch_command="night",
setting="color_scheme",
setting_value=UserProfile.COLOR_SCHEME_LIGHT,
)
)
elif command == 'fluid-width':
elif command == "fluid-width":
if user_profile.fluid_layout_width:
return dict(msg='You are still in fluid width mode.')
return dict(msg="You are still in fluid width mode.")
return dict(
msg=change_mode_setting(
command=command,
switch_command='fixed-width',
setting='fluid_layout_width',
switch_command="fixed-width",
setting="fluid_layout_width",
setting_value=True,
)
)
elif command == 'fixed-width':
elif command == "fixed-width":
if not user_profile.fluid_layout_width:
return dict(msg='You are still in fixed width mode.')
return dict(msg="You are still in fixed width mode.")
return dict(
msg=change_mode_setting(
command=command,
switch_command='fluid-width',
setting='fluid_layout_width',
switch_command="fluid-width",
setting="fluid_layout_width",
setting_value=False,
)
)
raise JsonableError(_('No such command: {}').format(command))
raise JsonableError(_("No such command: {}").format(command))