mirror of https://gitlab.com/bashrc2/epicyon
Include link in new share notification file
parent
6fc3eac50d
commit
702ed23d0e
14
shares.py
14
shares.py
|
@ -102,14 +102,15 @@ def addShare(baseDir: str, \
|
||||||
imageFilename=sharesImageFilename+'.gif'
|
imageFilename=sharesImageFilename+'.gif'
|
||||||
moveImage=True
|
moveImage=True
|
||||||
|
|
||||||
|
domainFull=domain
|
||||||
|
if port:
|
||||||
|
if port!=80 and port!=443:
|
||||||
|
if ':' not in domain:
|
||||||
|
domainFull=domain+':'+str(port)
|
||||||
|
|
||||||
# copy or move the image for the shared item to its destination
|
# copy or move the image for the shared item to its destination
|
||||||
if imageFilename:
|
if imageFilename:
|
||||||
if os.path.isfile(imageFilename):
|
if os.path.isfile(imageFilename):
|
||||||
domainFull=domain
|
|
||||||
if port:
|
|
||||||
if port!=80 and port!=443:
|
|
||||||
if ':' not in domain:
|
|
||||||
domainFull=domain+':'+str(port)
|
|
||||||
if not os.path.isdir(baseDir+'/sharefiles'):
|
if not os.path.isdir(baseDir+'/sharefiles'):
|
||||||
os.mkdir(baseDir+'/sharefiles')
|
os.mkdir(baseDir+'/sharefiles')
|
||||||
if not os.path.isdir(baseDir+'/sharefiles/'+nickname):
|
if not os.path.isdir(baseDir+'/sharefiles/'+nickname):
|
||||||
|
@ -151,9 +152,10 @@ def addShare(baseDir: str, \
|
||||||
accountDir=baseDir+'/accounts/'+handle
|
accountDir=baseDir+'/accounts/'+handle
|
||||||
newShareFile=accountDir+'/.newShare'
|
newShareFile=accountDir+'/.newShare'
|
||||||
if not os.path.isfile(newShareFile):
|
if not os.path.isfile(newShareFile):
|
||||||
|
nickname=handle.split('@')[0]
|
||||||
try:
|
try:
|
||||||
with open(newShareFile, 'w') as fp:
|
with open(newShareFile, 'w') as fp:
|
||||||
fp.write('\n')
|
fp.write(httpPrefix+'://'+domainFull+'/users/'+nickname+'/tlshares')
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue