Remove platform dependent code#377
Open
TWiStErRob wants to merge 1 commit intoFontCustom:masterfrom
TWiStErRob:patch-3
Open
Remove platform dependent code#377TWiStErRob wants to merge 1 commit intoFontCustom:masterfrom TWiStErRob:patch-3
TWiStErRob wants to merge 1 commit intoFontCustom:masterfrom
TWiStErRob:patch-3
Conversation
TWiStErRob
commented
Mar 17, 2019
Author
TWiStErRob
left a comment
There was a problem hiding this comment.
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']) |
Author
There was a problem hiding this comment.
calling without shell makes spaces work in path
|
|
||
| # Convert TTF to WOFF2 | ||
| subprocess.call('woff2_compress \'' + fontfile + '.ttf\'', shell=True) | ||
| subprocess.call(['woff2_compress', fontfile + '.ttf']) |
Author
There was a problem hiding this comment.
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') |
Author
There was a problem hiding this comment.
using a Python builtin removes the need for platform dependent code, additionally supports spaces
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes woff2 and paths containing spaces work on Windows.