moved SymlinkName into shared
This commit is contained in:
14
shared.py
14
shared.py
@@ -1,4 +1,5 @@
|
|||||||
import socket
|
import socket
|
||||||
|
import os
|
||||||
|
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
PROD_HOST="pa_web"
|
PROD_HOST="pa_web"
|
||||||
@@ -27,3 +28,16 @@ def CreateSelect(name, selected, list, js=""):
|
|||||||
str += f'>{el}</option>'
|
str += f'>{el}</option>'
|
||||||
str += '</select>'
|
str += '</select>'
|
||||||
return str
|
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