Changed classname of jstimestamp and added disallowed list
This commit is contained in:
parent
65c627cf4e
commit
2362bc800a
1 changed files with 18 additions and 4 deletions
|
|
@ -1,16 +1,30 @@
|
|||
class generate_timestamp:
|
||||
class generateTimestamp:
|
||||
def list_js_files(self,jsdir,ext='js'):
|
||||
import os
|
||||
all_files= []
|
||||
nono = ['./tiny_mce','./jquery']
|
||||
oldcwd = os.getcwd()
|
||||
os.chdir(jsdir)
|
||||
for root, subfolders, files in os.walk('.'):
|
||||
for filename in files:
|
||||
if filename.endswith(ext):
|
||||
all_files.append(os.path.join(root,filename))
|
||||
if self.is_allowed(nono,root):
|
||||
for filename in files:
|
||||
if filename.endswith(ext):
|
||||
all_files.append(os.path.join(root,filename))
|
||||
|
||||
os.chdir(oldcwd)
|
||||
for i in nono:
|
||||
for j in all_files:
|
||||
if j.startswith(i):
|
||||
all_files.remove(j)
|
||||
return all_files
|
||||
|
||||
def is_allowed(self,disallowed,item):
|
||||
for i in disallowed:
|
||||
if item.startswith(i):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def get_timestamp_dict(self,jsdir,filelist):
|
||||
tsdict={}
|
||||
import os
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue