mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2026-02-02 22:25:47 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b0ef15eae | |||
| 59bd1b6029 | |||
| f5e6471555 |
@@ -377,8 +377,8 @@ To leverage more pleasant UX, additionally those bits should be installed (or -
|
|||||||
copied into base image filesystem):
|
copied into base image filesystem):
|
||||||
|
|
||||||
- ``Assign`` and whatever commands you'll be use in scripts from your copy of
|
- ``Assign`` and whatever commands you'll be use in scripts from your copy of
|
||||||
- `uaequit`_ - this will allow to quit emulator, after quiting game
|
|
||||||
Workbench
|
Workbench
|
||||||
|
- `uaequit`_ - this will allow to quit emulator, after quiting game
|
||||||
- `kgiconload`_ - tool for reading icon and executing *default tool* with
|
- `kgiconload`_ - tool for reading icon and executing *default tool* with
|
||||||
optionally defined tool types as parameters (in this case: WHDLoad)
|
optionally defined tool types as parameters (in this case: WHDLoad)
|
||||||
- `SKick`_ optionally - for kickstart relocations. Also images of corresponding
|
- `SKick`_ optionally - for kickstart relocations. Also images of corresponding
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class Base(object):
|
|||||||
if not self._validate_options():
|
if not self._validate_options():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.dir = tempfile.mkdtemp()
|
self.dir = tempfile.mkdtemp(prefix='fs-uae-wrapper-')
|
||||||
self._normalize_options()
|
self._normalize_options()
|
||||||
self._set_assets_paths()
|
self._set_assets_paths()
|
||||||
|
|
||||||
|
|||||||
18
fs_uae_wrapper/nogui_message.py
Normal file
18
fs_uae_wrapper/nogui_message.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
"""
|
||||||
|
Display message as simple text on console
|
||||||
|
"""
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
class Message:
|
||||||
|
"""Just a fake message window for systems without TK"""
|
||||||
|
|
||||||
|
def __init__(self, msg):
|
||||||
|
self.msg = msg
|
||||||
|
self._process = None
|
||||||
|
|
||||||
|
def show(self):
|
||||||
|
sys.stdout.write(self.msg + "\n")
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
return None
|
||||||
@@ -8,7 +8,11 @@ import pathlib
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from fs_uae_wrapper import file_archive, message
|
from fs_uae_wrapper import file_archive
|
||||||
|
try:
|
||||||
|
from fs_uae_wrapper.message import Message
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
from fs_uae_wrapper.nogui_message import Message
|
||||||
|
|
||||||
|
|
||||||
class CmdOption(dict):
|
class CmdOption(dict):
|
||||||
@@ -64,7 +68,7 @@ def operate_archive(arch_name, operation, text, params):
|
|||||||
if archiver is None:
|
if archiver is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
msg = message.Message(text)
|
msg = Message(text)
|
||||||
if text:
|
if text:
|
||||||
msg.show()
|
msg.show()
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools >= 61.0", "wheel", "setuptools-git-versioning"]
|
requires = ["setuptools >= 77.0", "wheel", "setuptools-git-versioning"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "fs-uae-wrapper"
|
name = "fs-uae-wrapper"
|
||||||
authors = [{name = "Roman Dobosz", email = "gryf73@gmail.com"}]
|
authors = [{name = "Roman Dobosz", email = "gryf73@gmail.com"}]
|
||||||
license = {text = "BSD"}
|
license = "BSD-3-Clause"
|
||||||
description = "Automate archives support and state saves for fs-uae"
|
description = "Automate archives support and state saves for fs-uae"
|
||||||
readme = "README.rst"
|
readme = "README.rst"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
@@ -15,7 +15,6 @@ classifiers = [
|
|||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Environment :: Console",
|
"Environment :: Console",
|
||||||
"Intended Audience :: End Users/Desktop",
|
"Intended Audience :: End Users/Desktop",
|
||||||
"License :: OSI Approved :: BSD License",
|
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
pytest
|
|
||||||
pytest-cov
|
|
||||||
pytest-pep8
|
|
||||||
coverage
|
|
||||||
flake8
|
|
||||||
@@ -2,6 +2,7 @@ import os
|
|||||||
from unittest import TestCase, mock
|
from unittest import TestCase, mock
|
||||||
|
|
||||||
from fs_uae_wrapper import message
|
from fs_uae_wrapper import message
|
||||||
|
from fs_uae_wrapper import nogui_message
|
||||||
|
|
||||||
if os.environ.get('DISPLAY'):
|
if os.environ.get('DISPLAY'):
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
@@ -38,6 +39,19 @@ class TestMessage(TestCase):
|
|||||||
msg._process.join.assert_called_once()
|
msg._process.join.assert_called_once()
|
||||||
|
|
||||||
|
|
||||||
|
class TestNOPMessage(TestCase):
|
||||||
|
|
||||||
|
@mock.patch('sys.stdout.write')
|
||||||
|
def test_show(self, stdout_write):
|
||||||
|
msg = nogui_message.Message('display that')
|
||||||
|
msg.show()
|
||||||
|
stdout_write.assert_called_once()
|
||||||
|
|
||||||
|
def test_close(self):
|
||||||
|
msg = nogui_message.Message('display that')
|
||||||
|
self.assertIsNone(msg.close())
|
||||||
|
|
||||||
|
|
||||||
if os.environ.get('DISPLAY'):
|
if os.environ.get('DISPLAY'):
|
||||||
# Tkinter needs graphic environment for the widgets
|
# Tkinter needs graphic environment for the widgets
|
||||||
class TestSpawn(TestCase):
|
class TestSpawn(TestCase):
|
||||||
|
|||||||
7
tox.ini
7
tox.ini
@@ -8,7 +8,12 @@ usedevelop=True
|
|||||||
setenv = COVERAGE_FILE = .coverage
|
setenv = COVERAGE_FILE = .coverage
|
||||||
commands = py.test --cov=fs_uae_wrapper --cov-report=term-missing
|
commands = py.test --cov=fs_uae_wrapper --cov-report=term-missing
|
||||||
|
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps =
|
||||||
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
pytest-pep8
|
||||||
|
coverage
|
||||||
|
flake8
|
||||||
|
|
||||||
[testenv:py3-flake8]
|
[testenv:py3-flake8]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
|
|||||||
Reference in New Issue
Block a user