Skip to content

Commit

Permalink
don't visit dot folders when compiling templates
Browse files Browse the repository at this point in the history
  • Loading branch information
anandology committed Jan 6, 2009
1 parent 3cb395c commit 7360998
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/template.py
Expand Up @@ -1014,8 +1014,11 @@ def compile_templates(root):

for dirpath, dirnames, filenames in os.walk(root):
filenames = [f for f in filenames if not f.startswith('.') and not f.endswith('~') and not f.startswith('__init__.py')]
dirnames = [d for d in dirnames if not d.startswith('.')]


for d in dirnames[:]:
if d.startswith('.'):
dirnames.remove(d) # don't visit this dir

out = open(os.path.join(dirpath, '__init__.py'), 'w')
out.write('from web.template import CompiledTemplate, ForLoop\n\n')
if dirnames:
Expand Down

0 comments on commit 7360998

Please sign in to comment.