mirror of https://gitlab.com/bashrc2/epicyon
Only write if file does not exist
parent
d6a17f1209
commit
b877af4ae8
11
shares.py
11
shares.py
|
@ -146,11 +146,12 @@ def addShare(baseDir: str, \
|
||||||
|
|
||||||
# indicate that a new share is available
|
# indicate that a new share is available
|
||||||
newShareFile=baseDir+'/accounts/.newShare'
|
newShareFile=baseDir+'/accounts/.newShare'
|
||||||
try:
|
if not os.path.isfile(newShareFile):
|
||||||
with open(newShareFile, 'w') as fp:
|
try:
|
||||||
fp.write('\n')
|
with open(newShareFile, 'w') as fp:
|
||||||
except:
|
fp.write('\n')
|
||||||
pass
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def expireShares(baseDir: str) -> None:
|
def expireShares(baseDir: str) -> None:
|
||||||
"""Removes expired items from shares
|
"""Removes expired items from shares
|
||||||
|
|
Loading…
Reference in New Issue