mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2026-03-26 14:43:40 +01:00
Compare commits
4 Commits
b015e443eb
...
0.9.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 60139d1728 | |||
| 68b1f2a787 | |||
| 75d2cff96c | |||
| 114984cbee |
@@ -25,7 +25,7 @@ preferably in a archive file vs a bunch of files.
|
|||||||
Requirements
|
Requirements
|
||||||
============
|
============
|
||||||
|
|
||||||
- Python (2 or 3)
|
- Python 3
|
||||||
- `fs-uae`_ (obviously :)
|
- `fs-uae`_ (obviously :)
|
||||||
|
|
||||||
Fs-uae-wrapper supports several types of archives:
|
Fs-uae-wrapper supports several types of archives:
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
"""
|
||||||
Simple class for executing fs-uae with specified parameters. This is a
|
Simple class for executing fs-uae with specified parameters. This is a
|
||||||
failsafe class for running fs-uae.
|
failsafe class for running fs-uae.
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
"""
|
"""
|
||||||
Misc utilities
|
Misc utilities
|
||||||
"""
|
"""
|
||||||
from distutils import spawn
|
import configparser
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
try:
|
|
||||||
import configparser
|
|
||||||
except ImportError:
|
|
||||||
import ConfigParser as configparser
|
|
||||||
|
|
||||||
from fs_uae_wrapper import message
|
from fs_uae_wrapper import message
|
||||||
from fs_uae_wrapper import file_archive
|
from fs_uae_wrapper import file_archive
|
||||||
@@ -46,7 +43,7 @@ class CmdOption(dict):
|
|||||||
|
|
||||||
def get_config_options(conf):
|
def get_config_options(conf):
|
||||||
"""Read config file and return options as a dict"""
|
"""Read config file and return options as a dict"""
|
||||||
parser = configparser.SafeConfigParser()
|
parser = configparser.ConfigParser()
|
||||||
try:
|
try:
|
||||||
parser.read(conf)
|
parser.read(conf)
|
||||||
except configparser.ParsingError:
|
except configparser.ParsingError:
|
||||||
@@ -153,10 +150,10 @@ def interpolate_variables(string, config_path, base=None):
|
|||||||
string = string.replace('$HOME', os.path.expandvars('$HOME'))
|
string = string.replace('$HOME', os.path.expandvars('$HOME'))
|
||||||
|
|
||||||
if '$EXE' in string:
|
if '$EXE' in string:
|
||||||
string = string.replace('$EXE', spawn.find_executable('fs-uae'))
|
string = string.replace('$EXE', shutil.which('fs-uae'))
|
||||||
|
|
||||||
if '$APP' in string:
|
if '$APP' in string:
|
||||||
string = string.replace('$APP', spawn.find_executable('fs-uae'))
|
string = string.replace('$APP', shutil.which('fs-uae'))
|
||||||
|
|
||||||
if '$DOCUMENTS' in string:
|
if '$DOCUMENTS' in string:
|
||||||
xdg_docs = os.getenv('XDG_DOCUMENTS_DIR',
|
xdg_docs = os.getenv('XDG_DOCUMENTS_DIR',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
"""
|
"""
|
||||||
Wrapper for FS-UAE to perform some actions before and or after running the
|
Wrapper for FS-UAE to perform some actions before and or after running the
|
||||||
emulator, if appropriate option is enabled.
|
emulator, if appropriate option is enabled.
|
||||||
@@ -119,7 +118,3 @@ def run():
|
|||||||
|
|
||||||
if not exit_code:
|
if not exit_code:
|
||||||
sys.exit(4)
|
sys.exit(4)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
run()
|
|
||||||
|
|||||||
40
pyproject.toml
Normal file
40
pyproject.toml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools >= 61.0"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "fs-uae-wrapper"
|
||||||
|
authors = [{name = "Roman Dobosz", email = "gryf73@gmail.com"}]
|
||||||
|
license = {text = "BSD"}
|
||||||
|
description = "Automate archives support and state saves for fs-uae"
|
||||||
|
readme = "README.rst"
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
keywords = ["uae", "fs-uae", "amiga", "emulator", "wrapper"]
|
||||||
|
version = "0.9.0"
|
||||||
|
classifiers = [
|
||||||
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
"Environment :: Console",
|
||||||
|
"Intended Audience :: End Users/Desktop",
|
||||||
|
"License :: OSI Approved :: BSD License",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Topic :: System :: Emulators",
|
||||||
|
"Topic :: Games/Entertainment"
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Homepage = "https://github.com/gryf/fs-uae-wrapper"
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
fs-uae-wrapper = "fs_uae_wrapper.wrapper:run"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
py-modules = ["fs_uae_wrapper"]
|
||||||
|
|
||||||
|
[tool.distutils.bdist_wheel]
|
||||||
|
universal = true
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Run CD32 games using fsuae
|
|
||||||
"""
|
|
||||||
|
|
||||||
from fs_uae_wrapper import wrapper
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""run wrapper"""
|
|
||||||
wrapper.run()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
31
setup.py
31
setup.py
@@ -1,31 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
"""
|
|
||||||
Setup for the fs-uae-wrapper
|
|
||||||
"""
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
|
|
||||||
setup(name='fs-uae-wrapper',
|
|
||||||
packages=['fs_uae_wrapper'],
|
|
||||||
version='0.8.1',
|
|
||||||
description='Automate archives and state for fs-uae',
|
|
||||||
author='Roman Dobosz',
|
|
||||||
author_email='gryf73@gmail.com',
|
|
||||||
url='https://github.com/gryf/fs-uea-wrapper',
|
|
||||||
download_url='https://github.com/gryf/fs-uae-wrapper/archive/master.zip',
|
|
||||||
keywords=['uae', 'fs-uae', 'amiga', 'emulator', 'wrapper'],
|
|
||||||
scripts=['script/fs-uae-wrapper'],
|
|
||||||
classifiers=['Programming Language :: Python :: 2',
|
|
||||||
'Programming Language :: Python :: 2.7',
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
'Programming Language :: Python :: 3.4',
|
|
||||||
'Development Status :: 4 - Beta',
|
|
||||||
'Environment :: Console',
|
|
||||||
'Intended Audience :: End Users/Desktop',
|
|
||||||
'License :: OSI Approved :: BSD License',
|
|
||||||
'Operating System :: OS Independent',
|
|
||||||
'Topic :: System :: Emulators',
|
|
||||||
'Topic :: Games/Entertainment'],
|
|
||||||
long_description=open('README.rst').read(),
|
|
||||||
options={'test': {'verbose': False,
|
|
||||||
'coverage': False}})
|
|
||||||
@@ -237,8 +237,8 @@ class TestCmdOptions(TestCase):
|
|||||||
@mock.patch('os.path.exists')
|
@mock.patch('os.path.exists')
|
||||||
@mock.patch('os.getenv')
|
@mock.patch('os.getenv')
|
||||||
@mock.patch('os.path.expandvars')
|
@mock.patch('os.path.expandvars')
|
||||||
@mock.patch('distutils.spawn.find_executable')
|
@mock.patch('shutil.which')
|
||||||
def test_interpolate_variables(self, find_exe, expandv, getenv, os_exists):
|
def test_interpolate_variables(self, which, expandv, getenv, os_exists):
|
||||||
|
|
||||||
os_exists.return_value = True
|
os_exists.return_value = True
|
||||||
itrpl = utils.interpolate_variables
|
itrpl = utils.interpolate_variables
|
||||||
@@ -252,7 +252,7 @@ class TestCmdOptions(TestCase):
|
|||||||
'/home/user')
|
'/home/user')
|
||||||
|
|
||||||
string = '$APP/$EXE'
|
string = '$APP/$EXE'
|
||||||
find_exe.return_value = '/usr/bin/fs-uae'
|
which.return_value = '/usr/bin/fs-uae'
|
||||||
self.assertEqual(itrpl(string, '/home/user/Config.fs-uae'),
|
self.assertEqual(itrpl(string, '/home/user/Config.fs-uae'),
|
||||||
'/usr/bin/fs-uae//usr/bin/fs-uae')
|
'/usr/bin/fs-uae//usr/bin/fs-uae')
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,7 @@ class TestWrapper(TestCase):
|
|||||||
fobj.write('\n')
|
fobj.write('\n')
|
||||||
|
|
||||||
wrapper.run()
|
wrapper.run()
|
||||||
mock_plain_run.called_once_with('Config.fs-uae',
|
mock_plain_run.assert_called_once()
|
||||||
['--fullscreen',
|
|
||||||
'--fade_out_duration=0'],
|
|
||||||
[])
|
|
||||||
|
|
||||||
# This will obviously fail for nonexistent module
|
# This will obviously fail for nonexistent module
|
||||||
sys.argv.append('--wrapper=dummy_wrapper')
|
sys.argv.append('--wrapper=dummy_wrapper')
|
||||||
|
|||||||
11
tox.ini
11
tox.ini
@@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py27,py3,py27-flake8,py3-flake8
|
envlist = py3,py3-flake8
|
||||||
|
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
|
||||||
@@ -10,16 +10,7 @@ commands = py.test --cov=fs_uae_wrapper --cov-report=term-missing
|
|||||||
|
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
[testenv:py27]
|
|
||||||
deps = {[testenv]deps}
|
|
||||||
mock
|
|
||||||
|
|
||||||
[testenv:py3-flake8]
|
[testenv:py3-flake8]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
deps = flake8
|
deps = flake8
|
||||||
commands = flake8 {posargs}
|
commands = flake8 {posargs}
|
||||||
|
|
||||||
[testenv:py27-flake8]
|
|
||||||
basepython = python2.7
|
|
||||||
deps = flake8
|
|
||||||
commands = flake8 {posargs}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user