Skip to content

Commit

Permalink
fix: presentation was a bit wonky with doubled progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Apr 24, 2024
1 parent 5e54029 commit 0396566
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tradedangerous/plugins/spansh_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ def run(self) -> bool:

theme = self.tdenv.theme
BOLD, CLOSE, DIM, ITALIC = theme.bold, theme.CLOSE, theme.dim, theme.italic # pylint: disable=invalid-name

if not self.file:
url = self.url or SOURCE_URL
self.print(f'Downloading prices from remote URL: {url}')
self.file = Path(self.tdenv.tmpDir, "galaxy_stations.json")
transfers.download(self.tdenv, url, self.file)
self.print(f'Download complete, saved to local file: "{self.file}"')


sys_desc = f"Importing {ITALIC}spansh{CLOSE} data"
with Timing() as timing, Progresser(self.tdenv, sys_desc, total=len(self.known_systems)) as progress:
Expand Down Expand Up @@ -377,13 +385,6 @@ def run(self) -> bool:
return False

def data_stream(self):
if not self.file:
url = self.url or SOURCE_URL
self.print(f'Downloading prices from remote URL: {url}')
self.file = Path(self.tdenv.tmpDir, "galaxy_stations.json")
transfers.download(self.tdenv, url, self.file)
self.print(f'Download complete, saved to local file: "{self.file}"')

if self.file == '-':
self.print('Reading prices from stdin')
stream = sys.stdin
Expand Down

0 comments on commit 0396566

Please sign in to comment.