Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 2, 2024
1 parent 82fe3c1 commit 0de18ce
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions WrightTools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def scan(directory=None, no_recursion=False):
if directory is None:
directory = os.getcwd()

table = Table(
title=directory
)
table = Table(title=directory)
table.add_column("", justify="right") # index
table.add_column("path", max_width=60, no_wrap=True)
table.add_column("size (MB)", justify="center")
Expand All @@ -80,25 +78,26 @@ def scan(directory=None, no_recursion=False):
str(desc[k])
for k in ["path", "filesize", "created", "name", "shape", "axes", "nvars", "nchan"]
]
table.title = update_title(i+1)
table.title = update_title(i + 1)
table.add_row(*row)
live.update(table)

# give option to interact
def raise_sys_exit():
raise SystemExit

shell = code.InteractiveConsole(locals={
"exit": raise_sys_exit,
"quit": raise_sys_exit
})
shell = code.InteractiveConsole(locals={"exit": raise_sys_exit, "quit": raise_sys_exit})

while True:
msg = shell.raw_input(" ".join([
"Specify an index to load that entry.",
"Use 't' to rerender table.",
"Use no argument to exit.",
]))
msg = shell.raw_input(
" ".join(
[
"Specify an index to load that entry.",
"Use 't' to rerender table.",
"Use no argument to exit.",
]
)
)
if msg == "t":
with Live(table) as live:
pass
Expand Down

0 comments on commit 0de18ce

Please sign in to comment.