Skip to content

Commit

Permalink
Fix snapshot export on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinEnjalbert committed Jun 25, 2024
1 parent d1db878 commit 7d38808
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SimExporter/core/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def process(self,

# Get the directory that contains the javascript files and fill the standalone snapshot
static_dir = join(dirname(dirname(__file__)), 'static')
with open(join(static_dir, 'snapshot_standalone.txt'), 'r') as file:
with open(join(static_dir, 'snapshot_standalone.txt'), 'r', encoding='utf-8') as file:
content = file.read()
with open(join(static_dir, 'standalone.js'), 'r') as file:
with open(join(static_dir, 'standalone.js'), 'r', encoding='utf-8') as file:
content = content.replace('[K3D_SOURCE]', b64encode(compress(file.read().encode())).decode('utf-8'))
with open(join(static_dir, 'require.js'), 'r') as file:
with open(join(static_dir, 'require.js'), 'r', encoding='utf-8') as file:
content = content.replace('[REQUIRE_JS]', file.read())
with open(join(static_dir, 'fflate.js'), 'r') as file:
with open(join(static_dir, 'fflate.js'), 'r', encoding='utf-8') as file:
content = content.replace('[FFLATE_JS]', file.read())
content = content.replace('[ADDITIONAL]', '')

Expand All @@ -74,5 +74,5 @@ def process(self,

# Write in the HTML file
filename = f'{filename}.html' if not filename.endswith('.html') else filename
with open(filename, 'w') as file:
with open(filename, 'w', encoding='utf-8') as file:
file.write(content)

0 comments on commit 7d38808

Please sign in to comment.