Merge pull request 'Removed debuging prints. /JL' (#28) from 0.2.5 into main

Reviewed-on: https://gitpot-lerking.servehttp.com/CodingPirates/PyGame-Controller/pulls/28
This commit was merged in pull request #28.
This commit is contained in:
2025-05-07 21:46:57 +02:00
3 changed files with 3 additions and 6 deletions

View File

@@ -3,4 +3,4 @@
Small module to make it easy to add controller support. Small module to make it easy to add controller support.
![Tests](https://gitpot-lerking.servehttp.com/api/v1/badges/CodingPirates/PyGame-Controller/workflows/test.yml) ![Tests](https://gitpot-lerking.servehttp.com/api/v1/badges/CodingPirates/PyGame-Controller/workflows/test.yml)
![Version](https://img.shields.io/badge/version-0.2.4-blue) ![Version](https://img.shields.io/badge/version-0.2.5-blue)

View File

@@ -1,21 +1,18 @@
import pygame import pygame
from . import globals from . import globals
__version__ = "0.2.4" __version__ = "0.2.5"
class Controllers: class Controllers:
def __init__(self, joy): def __init__(self, joy):
globals.init() globals.init()
self.controllers = [] self.controllers = []
cont = self.detect_controller(joy.get_guid()) cont = self.detect_controller(joy.get_guid())
print(cont)
self.controllers.append(cont(joy)) self.controllers.append(cont(joy))
def detect_controller(self, guid): def detect_controller(self, guid):
for gp in globals.GAMEPADS: for gp in globals.GAMEPADS:
print(gp)
for p in globals.GAMEPADS[gp]: for p in globals.GAMEPADS[gp]:
print(p)
if p["guid"] != guid: if p["guid"] != guid:
continue continue
return p["class"] return p["class"]

View File

@@ -3,7 +3,7 @@ if __name__ == "__main__":
setup( setup(
name='pygameControls', name='pygameControls',
version='0.2.4', version='0.2.5',
packages=find_packages(), packages=find_packages(),
install_requires=[], install_requires=[],
author='Jan Lerking', author='Jan Lerking',