-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathjs.py
30 lines (19 loc) · 808 Bytes
/
js.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""This is a dummy module that only exists to override the built in pyodide module."""
from __future__ import annotations
import json
from typing import TYPE_CHECKING
def postMessage(message: str) -> None:
"""Fake function for printing messages with JS."""
print(message)
def getFile(filename):
"""Fake function for loading files with Javascript."""
with open(filename, "rb") as file:
return file.read()
def getStringFile(filename):
"""Fake function for loading files with Javascript."""
with open(filename, "r") as file:
return file.read()
with open("./static/patches/pointer_addresses.json", "rb") as file:
pointer_addresses = json.loads(file.read())
with open("./static/patches/symbols.json", "rb") as file:
rom_symbols = json.loads(file.read())