Skip to content

Commit

Permalink
Bython
Browse files Browse the repository at this point in the history
  • Loading branch information
AsynchronousAI committed Mar 15, 2024
1 parent daf0246 commit c117970
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/rbxpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,7 @@ def usage():
\033[1mInputs:\033[0m
{TAB}\033[1m-j\033[0m input is a jupyter notebook
{TAB}\033[1m-b\033[0m input is bython file
{TAB}\033[1m-py\033[0m input is python file (default)
{TAB}\033[1m-lua\033[0m input is lua file to convert to python""")
sys.exit()
Expand Down Expand Up @@ -2398,6 +2399,7 @@ def main():
reqfile = None
useRequire = False
notebook = False
bython = False

for arg in args:
if skip:
Expand All @@ -2413,6 +2415,8 @@ def main():
sys.exit()
elif arg == "-j":
notebook = True
elif arg == "-b":
bython = True
elif arg == "-c":
continue
elif arg == "-u":
Expand Down Expand Up @@ -2474,7 +2478,19 @@ def main():
print(reqcode)
sys.exit(0)
else:
if not notebook:
if bython:
try:
from bython import parser
except:
error("bython not installed, please install it with 'pip install bython'")
parser.parse_file(input_filename, False, '', 'temp')
print(input_filename)
with open('temp', 'r') as file:
content = file.read()
print(content)
os.remove('temp')
lua_code = translator.translate(content, includeSTD, False, export, False, useRequire, False)
elif not notebook:
pyright = check_pyright()
if pyright and not "-c" in args:
def check():
Expand Down

0 comments on commit c117970

Please sign in to comment.