Skip to content

Commit

Permalink
remove leftovers after ls json streaming lefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Nov 10, 2023
1 parent 319dc3b commit fc77cf1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions b2/console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,6 @@ class Ls(AbstractLsCommand):
# order is file_id, action, date, time, size(, replication), name
LS_ENTRY_TEMPLATE = '%83s %6s %10s %8s %9d %s'
LS_ENTRY_TEMPLATE_REPLICATION = LS_ENTRY_TEMPLATE + ' %s'
_first_row = True

@classmethod
def _setup_parser(cls, parser):
Expand Down Expand Up @@ -2036,19 +2035,12 @@ def _print_file_version(
file_version: FileVersion,
folder_name: Optional[str],
) -> None:
if args.json:
if self._first_row:
self._print_json('[\n', raw=True)
else:
self._print_json(',', raw=True)
self._print_json(file_version)
elif not args.long:
if not args.long:
super()._print_file_version(args, file_version, folder_name)
elif folder_name is not None:
self._print(self.format_folder_ls_entry(folder_name, args.replication))
else:
self._print(self.format_ls_entry(file_version, args.replication))
self._first_row = False

def format_folder_ls_entry(self, name, replication: bool):
if replication:
Expand Down

0 comments on commit fc77cf1

Please sign in to comment.