Include link in new share notification file

main2
Bob Mottram 2019-11-02 12:11:59 +00:00
parent 6fc3eac50d
commit 702ed23d0e
1 changed files with 8 additions and 6 deletions

View File

@ -102,14 +102,15 @@ def addShare(baseDir: str, \
imageFilename=sharesImageFilename+'.gif'
moveImage=True
# copy or move the image for the shared item to its destination
if imageFilename:
if os.path.isfile(imageFilename):
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
if imageFilename:
if os.path.isfile(imageFilename):
if not os.path.isdir(baseDir+'/sharefiles'):
os.mkdir(baseDir+'/sharefiles')
if not os.path.isdir(baseDir+'/sharefiles/'+nickname):
@ -151,9 +152,10 @@ def addShare(baseDir: str, \
accountDir=baseDir+'/accounts/'+handle
newShareFile=accountDir+'/.newShare'
if not os.path.isfile(newShareFile):
nickname=handle.split('@')[0]
try:
with open(newShareFile, 'w') as fp:
fp.write('\n')
fp.write(httpPrefix+'://'+domainFull+'/users/'+nickname+'/tlshares')
except:
pass