mirror of https://gitlab.com/bashrc2/epicyon
Write first entry in index
parent
6b7120dca7
commit
a318f299ca
17
inbox.py
17
inbox.py
|
@ -1512,11 +1512,18 @@ def inboxUpdateIndex(baseDir: str,handle: str,destinationFilename: str,debug: bo
|
||||||
indexFilename=baseDir+'/accounts/'+handle+'/inbox.index'
|
indexFilename=baseDir+'/accounts/'+handle+'/inbox.index'
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: Updating index '+indexFilename)
|
print('DEBUG: Updating index '+indexFilename)
|
||||||
with open(indexFilename, 'r+') as indexFile:
|
if os.path.isfile(indexFilename):
|
||||||
content = indexFile.read()
|
with open(indexFilename, 'r+') as indexFile:
|
||||||
indexFile.seek(0, 0)
|
content = indexFile.read()
|
||||||
indexFile.write(destinationFilename+'\n'+content)
|
indexFile.seek(0, 0)
|
||||||
return True
|
indexFile.write(destinationFilename+'\n'+content)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
indexFile=open(indexFilename,'w+')
|
||||||
|
if indexFile:
|
||||||
|
indexFile.write(destinationFilename+'\n')
|
||||||
|
indexFile.close()
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
||||||
|
|
Loading…
Reference in New Issue