moved SymlinkName into shared
This commit is contained in:
14
shared.py
14
shared.py
@@ -1,4 +1,5 @@
|
||||
import socket
|
||||
import os
|
||||
|
||||
hostname = socket.gethostname()
|
||||
PROD_HOST="pa_web"
|
||||
@@ -27,3 +28,16 @@ def CreateSelect(name, selected, list, js=""):
|
||||
str += f'>{el}</option>'
|
||||
str += '</select>'
|
||||
return str
|
||||
|
||||
def SymlinkName(path, file):
|
||||
sig_bit=file.replace(path, "")
|
||||
last_dir=os.path.basename(path[0:-1])
|
||||
|
||||
if sig_bit[-1] == '/':
|
||||
last_bit = os.path.dirname(sig_bit)[0:-1]
|
||||
else:
|
||||
last_bit = os.path.dirname(sig_bit)
|
||||
symlink = 'static/'+last_dir+'/'+last_bit
|
||||
if symlink[-1] == '/':
|
||||
symlink=symlink[0:-1]
|
||||
return symlink
|
||||
|
||||
Reference in New Issue
Block a user