Skip to content

Commit

Permalink
Some porting to python 3 to get out of the stone age and be able to u…
Browse files Browse the repository at this point in the history
…se github actions
  • Loading branch information
BSVino committed Nov 18, 2021
1 parent aa80824 commit f84990d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/html/copy/jax
/html/copy/*.woff
.DS_Store
/__pycache__
18 changes: 9 additions & 9 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
args = parser.parse_args()

if args.buildmode == 'full':
print "FULL BUILD"
print("FULL BUILD")
sys.path.append("htmlmin")
import htmlmin
else:
print "FAST BUILD"
print("FAST BUILD")

def create_directory(dir):
if not os.path.exists(dir):
Expand All @@ -40,7 +40,7 @@ def create_directory(dir):

output_dir = "htdocs/"

print "Resetting output dir..."
print("Resetting output dir...")
while os.path.exists(output_dir):
try:
shutil.rmtree(output_dir);
Expand Down Expand Up @@ -77,14 +77,14 @@ def create_directory(dir):
create_directory(dirname)
url = url + filename + suffix
with open(path, 'w') as f:
print "Downloading " + url
print("Downloading " + url)
f.write(urllib2.urlopen(url).read())

for name, filename, url in FONTS:
path = 'html/copy/' + filename
if not os.path.exists(path):
with open(path, 'wb') as f:
print "Downloading " + url
print("Downloading " + url)
f.write(urllib2.urlopen(url).read())

#################### Copy "html/copy" Files To Output Directory ####################
Expand All @@ -111,8 +111,8 @@ def create_directory(dir):
for file in f:
shutil.copy("html/copy/" + file, output_dir + file)

print "Copied " + str(len(f)) + " files"
print "Reading templates..."
print("Copied " + str(len(f)) + " files")
print("Reading templates...")

########################## Select Index.html Template ##########################
#Todo: use one index only
Expand Down Expand Up @@ -631,7 +631,7 @@ def spew_category(name, commands, current_command, api):

written = 0

print "Compiling " + version + " ..."
print("Compiling " + version + " ..." )
header_for_version = header;
footer_for_version = footer;

Expand Down Expand Up @@ -997,7 +997,7 @@ def replace_alias(matchobj):
output.write(output_string)
output.close()

print "Wrote " + str(written) + " commands for " + version
print("Wrote " + str(written) + " commands for " + version)

with zipfile.ZipFile('docs.gl.zip', 'w', compression=zipfile.ZIP_DEFLATED) as docs_gl_zip:
for dirname, _, files in os.walk('htdocs'):
Expand Down
4 changes: 2 additions & 2 deletions glsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def reverse_version_index(command_list):
return reversed

def generate_versions():
print "Generating GLSL version index..."
print("Generating GLSL version index...")
global version_commands
global commands_version
global version_commands_flat
Expand Down Expand Up @@ -138,7 +138,7 @@ def generate_versions():
tutorial_functions_entry['versions'] = get_major_versions(version_commands.keys())
tutorial_functions[aliased_command].append(tutorial_functions_entry)

print "Done."
print("Done.")

command_categories = OrderedDict([
( "Trigonometry", [
Expand Down
4 changes: 2 additions & 2 deletions opengl.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def reverse_version_index(command_list):
return reversed

def generate_versions():
print "Generating OpenGL version index..."
print("Generating OpenGL version index...")
global version_commands
global commands_version
global version_commands_flat
Expand Down Expand Up @@ -456,7 +456,7 @@ def generate_versions():
tutorial_functions_entry['versions'] = get_major_versions(version_commands.keys())
tutorial_functions[aliased_command].append(tutorial_functions_entry)

print "Done."
print("Done.")

command_categories = OrderedDict([
( "Textures", [
Expand Down

0 comments on commit f84990d

Please sign in to comment.