Browse Source

Fixed new line problem on settings file

doc-issue-template
MrS0m30n3 10 years ago
parent
commit
7a233e0b47
1 changed files with 8 additions and 2 deletions
  1. 10
      youtube_dl_gui/OptionsHandler.py

10
youtube_dl_gui/OptionsHandler.py

@ -71,10 +71,16 @@ class OptionsHandler():
f.close() f.close()
return options return options
def load_from_file(self):
def extract_options(self):
opts = [] opts = []
for option in self.read_from_file(): for option in self.read_from_file():
opts.append(option.split('=')[1].rstrip('\n'))
opt = option.split('=')
if not len(opt) < 2:
opts.append(opt[1].rstrip('\n'))
return opts
def load_from_file(self):
opts = self.extract_options()
try: try:
self.ignoreErrors = opts[0] in ['True'] self.ignoreErrors = opts[0] in ['True']
self.idAsName = opts[1] in ['True'] self.idAsName = opts[1] in ['True']

Loading…
Cancel
Save