Skip to content

Commit

Permalink
Merge branch 'master' into fs2020-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexeh authored Sep 8, 2024
2 parents 82da481 + 03a0e3e commit 5c2e45b
Show file tree
Hide file tree
Showing 23 changed files with 1,121 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ diagrams/*.pdf
*.ui
*.bat
debug.txt
poetry.lock
coverage.xml
*.log
*.svg.bkp
Expand Down
20 changes: 10 additions & 10 deletions joystick_diagrams/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class JoystickDiagramsError(Exception):
def __init__(self, value):
def __init__(self, value: str) -> None:
self.value = value

def __str__(self):
def __str__(self) -> str:
return repr(self.value)


Expand All @@ -12,20 +12,20 @@ def __str__(self):


class DirectoryNotValidError(JoystickDiagramsError):
def __init__(self, value=""):
def __init__(self, value: str = "") -> None:
super().__init__(value)


class FileNotValidError(JoystickDiagramsError):
def __init__(self, value=""):
def __init__(self, value: str = "") -> None:
super().__init__(value)

def __str__(self):
def __str__(self) -> str:
return repr("File was invalid: " + self.value)


class FileTypeInvalidError(JoystickDiagramsError):
def __init__(self, value="Default"):
def __init__(self, value: str = "") -> None:
super().__init__(value)


Expand All @@ -35,17 +35,17 @@ def __init__(self, value="Default"):


class PluginNotValidError(JoystickDiagramsError):
def __init__(self, value="", error=""):
def __init__(self, value: str = "", error: str = "") -> None:
super().__init__(value)
self.error = error

def __str__(self):
def __str__(self) -> str:
return repr(f"Plugin {self.value} loaded was invalid: {self.error}")


class NoPluginsExistError(JoystickDiagramsError):
def __init__(self, value=""):
def __init__(self, value: str = "") -> None:
super().__init__(value)

def __str__(self):
def __str__(self) -> str:
return repr("No plugins were found in plugins directory")
5 changes: 4 additions & 1 deletion joystick_diagrams/input/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def __init__(self, guid: str, device_name: str):
INPUT_HAT_KEY: {},
}

def __repr__(self) -> str:
return f"{self.guid[:8]} | {self.name}"

@staticmethod
def validate_guid(guid: str) -> str:
"""Validates a guid using UUID library, returning str representation
Expand All @@ -54,7 +57,7 @@ def validate_guid(guid: str) -> str:
"""

try:
return UUID(guid.strip()).__str__()
return str(UUID(guid.strip()))
except ValueError as e:
raise ValueError(f"GUID {guid} is not valid: {e}") from e

Expand Down
2 changes: 1 addition & 1 deletion joystick_diagrams/input/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __repr__(self):
return f"{self.input_control} - {self.command} - {self.modifiers}"

def __str__(self):
mod_to_string = [x.__str__() for x in self.modifiers]
mod_to_string = [str(x) for x in self.modifiers]
return f"{self.command} - {str(mod_to_string)}"

def __post_init__(self):
Expand Down
4 changes: 2 additions & 2 deletions joystick_diagrams/plugins/dcs_world_plugin/dcs_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def process_profiles(self, profile_list: list | None = None) -> ProfileCollectio

_logger.info(f"Profiles to be processed {self.profiles_to_process}")
for profile in self.profiles_to_process:
_logger.info(f"Processing {profile=}")
_logger.debug(f"Processing {profile=}")
profile_object = collection.create_profile(profile_name=profile)
self.fq_path = os.path.join(
self.path, CONFIG_DIR, INPUT_DIR, profile, JOYSTICK_DIR
Expand All @@ -169,7 +169,7 @@ def process_profiles(self, profile_list: list | None = None) -> ProfileCollectio
return collection

def process_profile_device(self, item: Path, profile: Profile_):
_logger.info(f"Processing {profile=} device {item=}")
_logger.debug(f"Processing {profile=} device {item=}")
guid, name = (
item.name[GUID_POSITION_SLICE],
item.name[NAME_POSITION_SLICE],
Expand Down
6 changes: 6 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ make-version:
ui:
@echo "Generating UI python"
@cmd /C ".\scripts\convert_ui.bat"

pub:
@poetry publish

pub-test:
@poetry publish -r test-pypi
1,064 changes: 1,064 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ qt-material = "^2.14"
dynaconf = "^3.2.4"
pyside6 = "^6.6.1"
semver = "^3.0.2"
pre-commit = "^3.6.0"
qtawesome = "^1.3.0"

[tool.poetry.group.dev.dependencies]
pyuic5-tool = "^0.0.1"
pre-commit = "^3.6.0"
pytest = "^7.2.0"
pytest-qt = "^4.2.0"
pytest-cov = "^4.0.0"
Expand All @@ -45,7 +44,7 @@ dynamic = ["version", "readme"]
packages = ["joystick_diagrams"]

[tool.setuptools.dynamic]
version = { attr = "joystick_diagrams.version.VERSION" }
version = {file = "version.txt"}
readme = { file = "readme.md" }

[tool.distutils.build_exe]
Expand Down
4 changes: 4 additions & 0 deletions templates/Virpil/Virpil Constellation ALPHA L.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions templates/Virpil/Virpil Constellation ALPHA Prime L.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions templates/Virpil/Virpil Constellation ALPHA Prime R.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion templates/Virpil/Virpil Constellation ALPHA R.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion templates/Virpil/Virpil Stick MT-50CM2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c2e45b

Please sign in to comment.