Opened 12 years ago

Closed 12 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)

makemessages-ignore-dirs.diff (1.8 KB ) - added by andreiko 12 years ago.
17628-2.diff (8.1 KB ) - added by Claude Paroz 12 years ago.
Patch with test

Download all attachments as: .zip

Change History (4)

by andreiko, 12 years ago

by Claude Paroz, 12 years ago

Attachment: 17628-2.diff added

Patch with test

comment:1 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted
Type: BugCleanup/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).

comment:2 by Jannis Leidel, 12 years ago

Resolution: fixed
Status: newclosed

In [17441]:

Fixed #17628 -- Extended makemessages command to also ignore directories when walking, not only when looking for files. Thanks, Claude Paroz.

Note: See TracTickets for help on using tickets.
Back to Top