Skip to content

Commit

Permalink
join
Browse files Browse the repository at this point in the history
  • Loading branch information
eccentricOrange committed Feb 8, 2022
1 parent 26d7d14 commit 73febcb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions npbc_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def editpaper(self):
def getpapers(self):
all_paper_data = self.get_all_papers()

all_paper_data_formatted = ""
all_paper_data_formatted = []

if self.args.names or self.args.days or self.args.prices:
for paper_id, current_paper_data in all_paper_data.items():
Expand All @@ -225,15 +225,17 @@ def getpapers(self):
costs.append(f"{day_data['cost']}")

if self.args.names:
all_paper_data_formatted += f"{current_paper_data['name']}"
all_paper_data_formatted.append(f"{current_paper_data['name']}")

if self.args.days:
all_paper_data_formatted += f", {days_delivered}"
all_paper_data_formatted.append(f"{days_delivered}")

if self.args.prices:
all_paper_data_formatted += f", {';'.join(costs)}"
all_paper_data_formatted.append(f"{';'.join(costs)}")

all_paper_data_formatted += "\n"
all_paper_data_formatted.append("\n")

all_paper_data_formatted = ', '.join(all_paper_data_formatted)

else:
all_paper_data_formatted = dumps(all_paper_data, indent=4)
Expand Down

0 comments on commit 73febcb

Please sign in to comment.