mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2025-12-18 20:10:26 +01:00
Extract getting the title to a new method in wrapper base class
This commit is contained in:
@@ -108,16 +108,10 @@ class Base(object):
|
||||
def _extract(self):
|
||||
"""Extract archive to temp dir"""
|
||||
|
||||
item = ''
|
||||
gui_msg = self.all_options.get('wrapper_gui_msg', '0')
|
||||
if gui_msg == '1':
|
||||
item = self.all_options.get('title')
|
||||
if not item:
|
||||
item = self.all_options['wrapper_archive']
|
||||
|
||||
title = self._get_title()
|
||||
curdir = os.path.abspath('.')
|
||||
os.chdir(self.dir)
|
||||
result = utils.extract_archive(self.arch_filepath, item)
|
||||
result = utils.extract_archive(self.arch_filepath, title)
|
||||
os.chdir(curdir)
|
||||
return result
|
||||
|
||||
@@ -129,6 +123,19 @@ class Base(object):
|
||||
os.chdir(curdir)
|
||||
return True
|
||||
|
||||
def _get_title(self):
|
||||
"""
|
||||
Return the title if found in configuration. As a fallback archive file
|
||||
name will be used as title.
|
||||
"""
|
||||
title = ''
|
||||
gui_msg = self.all_options.get('wrapper_gui_msg', '0')
|
||||
if gui_msg == '1':
|
||||
title = self.all_options.get('title')
|
||||
if not title:
|
||||
title = self.all_options['wrapper_archive']
|
||||
return title
|
||||
|
||||
def _save_save(self):
|
||||
"""
|
||||
Get the saves from emulator and store it where configuration is placed
|
||||
|
||||
Reference in New Issue
Block a user