mirror of
https://github.com/Syncplay/syncplay
synced 2025-03-21 10:28:51 +00:00
Some fixes for config getter, GUI always shows up when no file selected
This commit is contained in:
parent
df5410dd95
commit
1be4a53627
@ -191,20 +191,26 @@ class ConfigurationGetter(object):
|
|||||||
if(changed):
|
if(changed):
|
||||||
parser.write(codecs.open(iniPath, "wb", "utf_8_sig"))
|
parser.write(codecs.open(iniPath, "wb", "utf_8_sig"))
|
||||||
|
|
||||||
|
|
||||||
|
def _forceGuiPrompt(self):
|
||||||
|
try:
|
||||||
|
self._validateArguments()
|
||||||
|
except InvalidConfigValue:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
for key, value in self._promptForMissingArguments().items():
|
||||||
|
self._config[key] = value
|
||||||
|
except:
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
def getConfiguration(self):
|
def getConfiguration(self):
|
||||||
iniPath = self._getConfigurationFilePath()
|
iniPath = self._getConfigurationFilePath()
|
||||||
self._parseConfigFile(iniPath)
|
self._parseConfigFile(iniPath)
|
||||||
args = self._argparser.parse_args()
|
args = self._argparser.parse_args()
|
||||||
self._overrideConfigWithArgs(args)
|
self._overrideConfigWithArgs(args)
|
||||||
if(self._config['forceGuiPrompt']):
|
#Arguments not validated yet - booleans are still text values
|
||||||
try:
|
if(self._config['forceGuiPrompt'] == "True" or not self._config['file']):
|
||||||
self._validateArguments()
|
self._forceGuiPrompt()
|
||||||
except InvalidConfigValue:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
self._promptForMissingArguments()
|
|
||||||
except:
|
|
||||||
sys.exit()
|
|
||||||
self._checkConfig()
|
self._checkConfig()
|
||||||
self._saveConfig(iniPath)
|
self._saveConfig(iniPath)
|
||||||
return self._config
|
return self._config
|
||||||
|
Loading…
Reference in New Issue
Block a user