-
Notifications
You must be signed in to change notification settings - Fork 215
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
pyjscompressor multi-platform #756
Conversation
import re, os, sys, shutil | ||
|
||
#Set this string to the path to your compiler.jar | ||
COMPILER_PATH = r'' | ||
|
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.
COMPILER
is preferred to match env var, not much reason to deviate. consider setting via arg (using optparse
, or just sys.argv
), and falling back on the environment variable
for the most part your changes look fine to me -- nice work -- thanks :-) just address the handful of comments i've made and we'll go ahead and pull. |
Ok, so i think ive made a bit of a mess of this whole fork-commit-etc thing.
Some general things: I understand I shouldn't just rearrange someones code how I like it, it's because this file seemed distinctly inactive and that I made so many changes that I thought it would be ok. Anyway I hope it's ok now, any more tips always appreciated |
@PJSHAB, this looks pretty good -- there is only one thing I'd like you to change before i merge this: http://docs.python.org/library/subprocess.html#popen-constructor ... take a look at the options there:
what i'm looking for in the end is something like this: retcode = subprocess.call(args=['java', '-jar',
COMPILER, ...,
'--js_output_file', js_output_file],
stderr=open(os.devnull, 'w')) as per your whitespace questions -- don't worry about it too much for this merge -- but i meant you should put the functional changes in this commit, then whitespace/style changes in another commit. as a rule of thumb, they should always be separate, not only for ease of reviewing, but also because it's much simpler to revert changes if they are not mixed (eg. if the commit is deemed bad and breaks stuff ... whitespace changes can cause unnecessary conflicts and make it harder to revert). |
Ok, another version: Other thoughts: |
awesome! this is looking really great. final two tweaks :-) ...
... after that i'll pull straight away! |
meh i'll pull this now, thanks! just be sure to add yourself top credits if your not there already. |
pyjscompressor multi-platform-ification
Replaced all specific OS commands with the general python lib versions
Works for me on windows now, should work elsewhere assuming these added python functions work there:
os.remove()
shutil.rmtree()