Skip to content

Commit

Permalink
Fixed bug in detecting system Chromium and in unsing Pyppeteer's one.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarusso committed Aug 8, 2024
1 parent 8f75ecc commit a0cc365
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions timeseria/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ def dygraphs_plot(series, data_labels='all', data_indexes='all', aggregate=None,
_chrom_executable = None

# Is there a system Chrome or Chromium we can use?
potential_chrom_executables = ['google-chromium', 'google-chrome', 'chromium-browser',
potential_chrom_executables = ['chromium', 'chromium-browser', 'google-chrome',
'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome']

for potential_chrom_executable in potential_chrom_executables:
Expand All @@ -1017,7 +1017,7 @@ def dygraphs_plot(series, data_labels='all', data_indexes='all', aggregate=None,
version = out.stdout.replace('Google', '').replace('Chrome', '').replace('Chromium', '').strip().split(' ')[0]
version_major = int(version.split('.')[0])
if version_major >= 59:
logger.info('Found usable Chrom* executable: "{}"'.format(potential_chrom_executable))
logger.debug('Found usable Chrom* executable: "{}"'.format(potential_chrom_executable))
_chrom_executable = potential_chrom_executable
break
else:
Expand All @@ -1038,7 +1038,7 @@ def dygraphs_plot(series, data_labels='all', data_indexes='all', aggregate=None,
logger.debug('Ok, Chromium present.')

# Convert executable path to string and handle white spaces if present
_chrom_executable = _chrom_executable.replace(' ', '\ ')
_chrom_executable = str(chromium_executable()).replace(' ', '\ ')

# Check path exists and is writable or Chrom* will risk to hang up
png_dest_path = '/'.join(png_dest.split('/')[0:-1])
Expand Down

0 comments on commit a0cc365

Please sign in to comment.