Skip to content

Commit

Permalink
add file command
Browse files Browse the repository at this point in the history
  • Loading branch information
beasteers committed Oct 9, 2024
1 parent 3a48763 commit 3ab1ad3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ptgctl/tools/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ async def file(api, stream_id, out_dir, include_timestamps=False, **kw):
if sid not in files:
files[sid] = stack.enter_context(open(os.path.join(out_dir, f'{sid}.txt'), 'w'))
pbars[sid] = tqdm.tqdm(desc=sid)
if include_timestamps:
files[sid].write(f'{ts}:')
files[sid].write(f"{data.decode('utf-8')}\n")
files[sid].write(f"{f'{ts}:' if include_timestamps else ''}{data.decode('utf-8')}\n")
pbars[sid].update()
pbars[sid].set_description(f'{sid}: {str(data)[:20]}')

Expand Down

0 comments on commit 3ab1ad3

Please sign in to comment.