Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import os, sys, fnmatch
- mask = '*.tpl'
- string = '\n<!--{$smarty.template}-->'
- def walk(arg,dir,files):
- for file in files:
- if fnmatch.fnmatch(file,mask):
- name = os.path.join(dir,file)
- try:
- data = open(name,'a').write(string)
- print name
- except:
- pass
- os.path.walk('.',walk,[])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement