Skip to content

Commit 9c76b1d

Browse files
committed
chore: run ruff format to fix ci
1 parent 75f469d commit 9c76b1d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/bitsrun/cli.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Replace the default implementation
2222
warnings.showwarning = (
2323
lambda message, category, filename, lineno, file=None, line=None: click.echo(
24-
f"{click.style('warning:', fg='yellow')} {message}", err=True
24+
f'{click.style("warning:", fg="yellow")} {message}', err=True
2525
)
2626
)
2727

@@ -64,13 +64,13 @@ def status(json: bool):
6464
if login_status.get('user_name'):
6565
click.echo(
6666
click.style('bitsrun: ', fg='green')
67-
+ f"{login_status['user_name']} ({login_status['online_ip']}) is online"
67+
+ f'{login_status["user_name"]} ({login_status["online_ip"]}) is online'
6868
)
6969
print_status_table(login_status)
7070
else:
7171
click.echo(
7272
click.style('bitsrun: ', fg='cyan')
73-
+ f"{login_status['online_ip']} is offline"
73+
+ f'{login_status["online_ip"]} is offline'
7474
)
7575

7676

@@ -113,17 +113,17 @@ def do_action(action, username, password, verbose):
113113

114114
if action == 'login':
115115
resp = user.login()
116-
message = f"{user.username} ({resp['online_ip']}) logged in"
116+
message = f'{user.username} ({resp["online_ip"]}) logged in'
117117
elif action == 'logout':
118118
resp = user.logout()
119-
message = f"{resp['online_ip']} logged out"
119+
message = f'{resp["online_ip"]} logged out'
120120
else:
121121
# Should not reach here, but just in case
122122
raise ValueError(f'Unknown action `{action}`')
123123

124124
# Output direct result of the API response if verbose
125125
if verbose:
126-
click.echo(f"{click.style('bitsrun:', fg='cyan')} Response from API:")
126+
click.echo(f'{click.style("bitsrun:", fg="cyan")} Response from API:')
127127
print_json(data=resp)
128128

129129
# Handle error from API response. When field `error` is not `ok`, then the
@@ -136,11 +136,11 @@ def do_action(action, username, password, verbose):
136136
)
137137

138138
# Print success message
139-
click.echo(f"{click.style('bitsrun:', fg='green')} {message}")
139+
click.echo(f'{click.style("bitsrun:", fg="green")} {message}')
140140

141141
except Exception as e:
142142
# Exception is caught and printed to stderr
143-
click.echo(f"{click.style('error:', fg='red')} {e}", err=True)
143+
click.echo(f'{click.style("error:", fg="red")} {e}', err=True)
144144
# Throw with error code 1 for scripts to pick up error state
145145
sys.exit(1)
146146

src/bitsrun/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def print_status_table(login_status: LoginStatusRespType) -> None:
3434
table.add_row(
3535
naturalsize(login_status.get('sum_bytes', 0), binary=True), # type: ignore
3636
naturaldelta(login_status.get('sum_seconds', 0)), # type: ignore
37-
f"{login_status.get('user_balance', 0):0.2f}",
38-
f"{login_status.get('wallet_balance', 0):0.2f}",
37+
f'{login_status.get("user_balance", 0):0.2f}',
38+
f'{login_status.get("wallet_balance", 0):0.2f}',
3939
)
4040

4141
console = Console()

0 commit comments

Comments
 (0)