fix ignore/ungignore
This commit is contained in:
parent
e16c9a8e74
commit
93921dfd01
@ -13,12 +13,15 @@ def addScreenToIgnoreList(ignoreFileName = '/tmp/fenrirSuspend', screen = '1', u
|
|||||||
if os.access(ignoreFileName, os.R_OK):
|
if os.access(ignoreFileName, os.R_OK):
|
||||||
with open(ignoreFileName, 'r') as fp:
|
with open(ignoreFileName, 'r') as fp:
|
||||||
try:
|
try:
|
||||||
ignoreScreens = fp.read().split(',')#.replace('\n','').split(',')
|
ignoreScreens = []
|
||||||
|
content = str(fp.read())
|
||||||
|
if content != '':
|
||||||
|
ignoreScreens = content.split(',')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
added = False
|
added = False
|
||||||
if not screen in ignoreScreens:
|
if not screen in ignoreScreens:
|
||||||
ignoreScreens.extend(screen)
|
ignoreScreens.append(screen)
|
||||||
added = True
|
added = True
|
||||||
ignoreScreensStr = ','.join(ignoreScreens)
|
ignoreScreensStr = ','.join(ignoreScreens)
|
||||||
|
|
||||||
|
@ -13,7 +13,10 @@ def removeScreenFromIgnoreList(ignoreFileName = '/tmp/fenrirSuspend', screen = '
|
|||||||
if os.access(ignoreFileName, os.R_OK):
|
if os.access(ignoreFileName, os.R_OK):
|
||||||
with open(ignoreFileName, 'r') as fp:
|
with open(ignoreFileName, 'r') as fp:
|
||||||
try:
|
try:
|
||||||
ignoreScreens = fp.read().split(',')#.replace('\n','').split(',')
|
ignoreScreens = []
|
||||||
|
content = str(fp.read())
|
||||||
|
if content != '':
|
||||||
|
ignoreScreens = content.split(',')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
removed = False
|
removed = False
|
||||||
|
Loading…
Reference in New Issue
Block a user