Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor build script to Python3 #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion utils/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd "$(dirname "$0")"
python builder.py deploy_files.txt -o ../build/litegraph.min.js -o2 ../build/litegraph.js
python3 builder.py deploy_files.txt -o ../build/litegraph.min.js -o2 ../build/litegraph.js "$@"
chmod a+rw ../build/*
10 changes: 5 additions & 5 deletions utils/builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3

import re, os, sys, time, tempfile, shutil
import argparse
Expand Down Expand Up @@ -58,16 +58,16 @@ def packJSCode(files):
os.system("java -jar %s --js %s --js_output_file %s" % (compiler_path, src_file, "temp.js") )
sys.stderr.write('\033[92m' + "OK\n" + '\033[0m')

os.write(f1,data)
os.write(f1,str.encode(data))
os.close(f1)

#print " + Compiling all..."
#print(" + Compiling all...")
#os.system("java -jar %s --js %s --js_output_file %s" % (compiler_path, fullcode_path, output_file) )
#print " * Done"
#print(" * Done")
return fullcode_path

def compileAndMinify(input_path, output_path):
print " + Compiling and minifying..."
print(" + Compiling and minifying...")
if output_path != None:
os.system("java -jar %s --js %s --js_output_file %s" % (compiler_path, input_path, output_path) )
sys.stderr.write(" * Stored in " + output_path + "\n");
Expand Down