Fixed packagename bug in jstimestamp
This commit is contained in:
parent
4276fee221
commit
800e2fad2a
1 changed files with 20 additions and 2 deletions
|
|
@ -41,11 +41,29 @@ class generateTimestamp:
|
|||
filename = filename.lstrip('./')
|
||||
filename = filename.rstrip('.js')
|
||||
filename = filename.replace('/','.')
|
||||
#TODO Remove _packagename from the end if file is a package
|
||||
if generateTimestamp.is_package(filename):
|
||||
# Whoa its a package
|
||||
# Remove _packagename from the end if file is a package
|
||||
filename = generateTimestamp.convert_to_packagename(filename)
|
||||
tsdict[filename] = ts
|
||||
os.chdir(oldcwd)
|
||||
return tsdict
|
||||
|
||||
@staticmethod
|
||||
def is_package(filename):
|
||||
from webnotes.utils import jsnamespace
|
||||
p = jsnamespace.jsNamespace.package_prefix
|
||||
return filename.split('.')[-1].startswith()
|
||||
|
||||
@staticmethod
|
||||
def convert_to_packagename(filename):
|
||||
t = []
|
||||
for i in filename.split('.')[:-1]:
|
||||
t.append(i)
|
||||
t.append('.')
|
||||
del t[-1]
|
||||
filename = ''.join(t)
|
||||
return filename
|
||||
|
||||
@staticmethod
|
||||
def read_ts_from_file(jsdir):
|
||||
import json
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue