Opened 13 years ago
Closed 13 years ago
#17628 closed Cleanup/optimization (fixed)
makemessages command walks through directories that match ignore_patterns
Reported by: | andreiko | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
./manage.py makemessages always walks through all directories in a tree, even if some directory's path matches an ignore pattern.
So we perform meaningless time-consuming scan through .svn, .git and other possible deep directories that we would like to fully ignore:
$ ./manage.py makemessages -l ru -d django -v 2 examining files with the extensions: .html processing language ru ignoring file .DS_Store in . ignoring file .gitignore in . ... ignoring file e974710282570831dbefad0e177403d07205ba in ./.git/objects/07 ignoring file da4359b0e24cb164eace2ac312af8fafff2127 in ./.git/objects/08 ignoring file f195d5a9e0cf3542ef36028fa4820d8cdf560a in ./.git/objects/08 ignoring file 26c086ebf3d6fee600fccddaf6bbc6a7f347a1 in ./.git/objects/0a ...
Suggested patch changes behavior of "walk" function defined in makemessages.py to skip directories which path matches some ignore pattern.
Attachments (2)
Change History (4)
by , 13 years ago
Attachment: | makemessages-ignore-dirs.diff added |
---|
by , 13 years ago
Attachment: | 17628-2.diff added |
---|
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Bug → Cleanup/optimization |
To make it work, I had to transform 'dir/*' style expressions to 'dir'.
Accessorily, to capture sdtout during the test, I had to pass around sdtout to several functions. It would be much simpler if those were methods of a class (hey ramiro).
Patch with test