-
Notifications
You must be signed in to change notification settings - Fork 423
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
Remove platform dependent code #377
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See self-review for reasons.
subprocess.call('move ' + fontfile + '.eotlite ' + fontfile + '.eot', shell=True) | ||
else: | ||
subprocess.call('mv ' + fontfile + '.eotlite ' + fontfile + '.eot', shell=True) | ||
subprocess.call(['python', scriptPath + '/eotlitetool.py', fontfile + '.ttf', '-o', fontfile + '.eot']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling without shell makes spaces work in path
manifest['fonts'].append(fontfile + '.eot') | ||
|
||
# Convert TTF to WOFF2 | ||
subprocess.call('woff2_compress \'' + fontfile + '.ttf\'', shell=True) | ||
subprocess.call(['woff2_compress', fontfile + '.ttf']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling without shell and remove '
makes woff2 work on Windows. apostrophes are not supported by cmd.exe
else: | ||
subprocess.call('mv ' + fontfile + '.eotlite ' + fontfile + '.eot', shell=True) | ||
subprocess.call(['python', scriptPath + '/eotlitetool.py', fontfile + '.ttf', '-o', fontfile + '.eot']) | ||
shutil.move(fontfile + '.eotlite', fontfile + '.eot') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a Python builtin removes the need for platform dependent code, additionally supports spaces
Makes woff2 and paths containing spaces work on Windows.