Quellcode durchsuchen

Changed classname of jstimestamp and added disallowed list

version-14
Pratik Vyas vor 14 Jahren
Ursprung
Commit
2362bc800a
1 geänderte Dateien mit 18 neuen und 4 gelöschten Zeilen
  1. +18
    -4
      cgi-bin/webnotes/utils/jstimestamp.py

+ 18
- 4
cgi-bin/webnotes/utils/jstimestamp.py Datei anzeigen

@@ -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


Laden…
Abbrechen
Speichern