mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2026-01-22 23:15:47 +01:00
Refactor wrapper modules to have a main class with the same name
This commit is contained in:
@@ -11,13 +11,13 @@ from fs_uae_wrapper import base
|
||||
from fs_uae_wrapper import utils
|
||||
|
||||
|
||||
class Archive(base.ArchiveBase):
|
||||
class Wrapper(base.ArchiveBase):
|
||||
"""
|
||||
Class for performing extracting archive, copying emulator files, and
|
||||
cleaning it back again
|
||||
"""
|
||||
def __init__(self, conf_file, fsuae_options, configuration):
|
||||
super(Archive, self).__init__(conf_file, fsuae_options, configuration)
|
||||
super(Wrapper, self).__init__(conf_file, fsuae_options, configuration)
|
||||
self.archive_type = None
|
||||
|
||||
def run(self):
|
||||
@@ -29,7 +29,7 @@ class Archive(base.ArchiveBase):
|
||||
- run the emulation
|
||||
- optionally make archive save state
|
||||
"""
|
||||
if not super(Archive, self).run():
|
||||
if not super(Wrapper, self).run():
|
||||
return False
|
||||
|
||||
if not self._extract():
|
||||
@@ -78,7 +78,7 @@ class Archive(base.ArchiveBase):
|
||||
def run(config_file, fsuae_options, configuration):
|
||||
"""Run fs-uae with provided config file and options"""
|
||||
|
||||
runner = Archive(config_file, fsuae_options, configuration)
|
||||
runner = Wrapper(config_file, fsuae_options, configuration)
|
||||
try:
|
||||
return runner.run()
|
||||
finally:
|
||||
|
||||
@@ -11,7 +11,7 @@ name.
|
||||
from fs_uae_wrapper import base
|
||||
|
||||
|
||||
class CD32(base.ArchiveBase):
|
||||
class Wrapper(base.ArchiveBase):
|
||||
"""
|
||||
Class for performing extracting archive, copying emulator files, and
|
||||
cleaning it back again
|
||||
@@ -28,7 +28,7 @@ class CD32(base.ArchiveBase):
|
||||
- run the emulation
|
||||
- archive save state
|
||||
"""
|
||||
super(CD32, self).run()
|
||||
super(Wrapper, self).run()
|
||||
if not self._validate_options():
|
||||
return False
|
||||
|
||||
@@ -51,7 +51,7 @@ class CD32(base.ArchiveBase):
|
||||
def run(config_file, fsuae_options, configuration):
|
||||
"""Run fs-uae with provided config file and options"""
|
||||
|
||||
runner = CD32(config_file, fsuae_options, configuration)
|
||||
runner = Wrapper(config_file, fsuae_options, configuration)
|
||||
try:
|
||||
return runner.run()
|
||||
finally:
|
||||
|
||||
@@ -4,7 +4,7 @@ Wrapper module with preserved save state in archive file.
|
||||
from fs_uae_wrapper import base
|
||||
|
||||
|
||||
class SaveState(base.Base):
|
||||
class Wrapper(base.Base):
|
||||
"""
|
||||
Preserve save state.
|
||||
"""
|
||||
@@ -16,8 +16,7 @@ class SaveState(base.Base):
|
||||
parameters
|
||||
configuration: is config dictionary created out of config file
|
||||
"""
|
||||
super(SaveState, self).__init__(conf_file, fsuae_options,
|
||||
configuration)
|
||||
super(Wrapper, self).__init__(conf_file, fsuae_options, configuration)
|
||||
self.arch_filepath = None
|
||||
self.all_options['wrapper_save_state'] = '1'
|
||||
|
||||
@@ -31,7 +30,7 @@ class SaveState(base.Base):
|
||||
- run the emulation
|
||||
- optionally make archive save state
|
||||
"""
|
||||
if not super(SaveState, self).run():
|
||||
if not super(Wrapper, self).run():
|
||||
return False
|
||||
|
||||
self._load_save()
|
||||
@@ -52,7 +51,7 @@ class SaveState(base.Base):
|
||||
def run(config_file, fsuae_options, configuration):
|
||||
"""Run fs-uae with provided config file and options"""
|
||||
|
||||
runner = SaveState(config_file, fsuae_options, configuration)
|
||||
runner = Wrapper(config_file, fsuae_options, configuration)
|
||||
try:
|
||||
return runner.run()
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user