-
Notifications
You must be signed in to change notification settings - Fork 443
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
Support extraction by filename as well as directory #324
Conversation
Hi, can you fix the issues pointed out by the gitmate bot and refactor your stuff into atomic commits as described in http://coala.readthedocs.org/en/latest/Getting_Involved/Writing_Good_Commits/ ? |
Thanks for submitting :) |
Current coverage is
|
Appeased the LineLengthBot with Yelp's preferred syntax (which is vertically long, but eh this line is super-awkward regardless). I'll refactor my commits later today or tomorrow. (I started this change on Yelp's old fork of babel, so this version was more of a copy/paste job. But I'll make the history make some sense.) |
@ENuge cool, ping us when it's done. |
strip_comment_tags=self.strip_comments | ||
) | ||
else: | ||
extracted = check_and_call_extract_file(path, method_map, |
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.
Could you use the same indent style as in the extract_from_dir
call above? :)
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.
Yup! Done.
And aside from the handful of comments I had, great work @ENuge ! :)
EDIT: Wagh, I'm a dummy who can't scroll down. |
@ENuge: Looking good! Please squash all of the commits into one though :) |
Interesting, travis errored out on mac only for pypy 2.6, maybe a nondeterministic bug? |
@sils1297 Heh, yes... race condition against the clock, it seems. If the wallclock ticks forward a second while those tests are being run, they may fail. We should probably freeze time for the duration of those tests or maybe compare the outputs ignoring datetime differences. |
79ddbf4
to
4b0d4c5
Compare
One can now supply a filename or a directory to be extracted. For large codebases, this allows the consumer to optimize their string extraction process by, for instance, only supplying the files that have actually been changed on the given dev's branch compared to master. Relates to python-babel#253 . I don't want to say "fixes", but makes further optimization unnecessary for most use cases.
4b0d4c5
to
19957e2
Compare
Super nice work @ENuge! I'm gonna merge this, but come to think of it, we should add an alias for |
Support extraction by filename as well as directory
Reason for the change: #253 . This obviates the need for parallelizing to make things faster (on the consumer's side, we only scan files that are different in a given branch compared to origin's master, which brings scan time down from ~4min 30s to ~5-20s, depending on how old one's branch is).
Code changes: moved half of the logic from extract_from_dir into its own function. Then added a few "is this a path or directory?" type checks to frontend.py to use the right thing. Those checks are kind of ugly right now but I couldn't think of a more elegant way of doing it. Added/rejiggered a couple of tests.