Skip to content

Commit

Permalink
wip - fixed config save checkbox bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal-joshi committed Oct 9, 2023
1 parent 596fb84 commit 33f748d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/classes/ConfigManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def setConfig(self, parser, default=False, showFileCreatedText=True):
str(self.consolidationPercentage))
parser.set('config', 'shuffle', 'y')
parser.set('config', 'cacheStockData', 'y')
parser.set('config', 'onlyStageTwoStocks', 'y')
parser.set('config', 'useEMA', 'n')
parser.set('config', 'onlyStageTwoStocks', 'y' if self.stageTwo else 'n')
parser.set('config', 'useEMA', 'y' if self.useEMA else 'n')
try:
fp = open('screenipy.ini', 'w')
parser.write(fp)
Expand Down Expand Up @@ -157,8 +157,12 @@ def getConfig(self, parser):
self.cacheEnabled = True
if 'n' not in str(parser.get('config', 'onlyStageTwoStocks')).lower():
self.stageTwo = True
else:
self.stageTwo = False
if 'y' not in str(parser.get('config', 'useEMA')).lower():
self.useEMA = False
else:
self.useEMA = True
except configparser.NoOptionError:
input(colorText.BOLD + colorText.FAIL +
'[+] Screenipy requires user configuration again. Press enter to continue..' + colorText.END)
Expand Down

0 comments on commit 33f748d

Please sign in to comment.