-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pyinstaller build to bundle the booty/lark files
I had turned these files into python modules to avoid dealing with the bundling process but the upcoming package work means I need to touch the grammar again, and having it as a python string without any syntax highlighting is lame. Wasn't that hard anyway.
- Loading branch information
Showing
6 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys | ||
import os | ||
from typing import cast | ||
|
||
|
||
def __get_file_content(file_name: str) -> str: | ||
is_binary = getattr(sys, "_MEIPASS", None) | ||
here: str = cast(str, os.path.join(sys._MEIPASS, "booty", "lang") if is_binary else os.path.dirname(__file__)) # type: ignore | ||
with open(os.path.join(here, file_name), "r") as f: | ||
return f.read() | ||
|
||
|
||
def get_stdlib() -> str: | ||
return __get_file_content("stdlib.booty") | ||
|
||
|
||
def get_grammar() -> str: | ||
return __get_file_content("grammar.lark") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters