diff --git a/tools/fenrir-ignore-screen b/tools/fenrir-ignore-screen index f19735e5..fe005196 100755 --- a/tools/fenrir-ignore-screen +++ b/tools/fenrir-ignore-screen @@ -13,12 +13,15 @@ def addScreenToIgnoreList(ignoreFileName = '/tmp/fenrirSuspend', screen = '1', u if os.access(ignoreFileName, os.R_OK): with open(ignoreFileName, 'r') as fp: try: - ignoreScreens = fp.read().split(',')#.replace('\n','').split(',') + ignoreScreens = [] + content = str(fp.read()) + if content != '': + ignoreScreens = content.split(',') except Exception as e: print(e) added = False if not screen in ignoreScreens: - ignoreScreens.extend(screen) + ignoreScreens.append(screen) added = True ignoreScreensStr = ','.join(ignoreScreens) diff --git a/tools/fenrir-unignore-screen b/tools/fenrir-unignore-screen index c69b47f9..84727a72 100755 --- a/tools/fenrir-unignore-screen +++ b/tools/fenrir-unignore-screen @@ -13,7 +13,10 @@ def removeScreenFromIgnoreList(ignoreFileName = '/tmp/fenrirSuspend', screen = ' if os.access(ignoreFileName, os.R_OK): with open(ignoreFileName, 'r') as fp: try: - ignoreScreens = fp.read().split(',')#.replace('\n','').split(',') + ignoreScreens = [] + content = str(fp.read()) + if content != '': + ignoreScreens = content.split(',') except Exception as e: print(e) removed = False