summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-11-01fix error not propagated when collecting cardsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-11-01replace calls to print by calls to loggingOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-13Add test for joining game without specifying the nameOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-13Get rid of extra newlineOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-13Use callbacks to handle the opcodesOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-13Add test for play_card without card ID specifiedOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-13Use f-string instead of + operator to concat stringsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-13Handle exception when JSON received is not an objectOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Handle JSON with no opcodeOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Add more tests for invalid commandsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Use _ name for unused counterOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Remove useless use of list comprehensionOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Fix accidental use of tuple in enumerationOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Remove unused importsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Fix missing module name in exception typeOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Add requirements.txt fileOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Add test for invalid JSON receivedOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-09-12Move systemd unit file at the right placeOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-28Rename function swiftory connection_handlerOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-28Don't use coroutines for functions sending notificationsOlivier Gayot
Functions which generate notifications for clients were all making use of await and async. This is not great because if we add a notification somewhere, we need to change the function to a coroutine and update all invocations (recursively changing all functions to coroutines). Instead, we now add a task to the event loop whenever a notification needs to be generated. This allows to drop the await and async specifiers from mostly everywhere. On the downside, it means that if we send a notification to n clients, we have to register n tasks. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-21Don't pass both the client and the socketOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-21Properly handle disconnections from remote endOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-21Fix reception of cards after playingOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-21Update version to 0.2Olivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-16Add unit tests for boardOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Store cards as tuples (id, desc)Olivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Don't pass the cards to the constructor of boardOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Rework the recycling of the cardsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Simplify instructionsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Specify the encoding to use when opening card filesOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Update reqs. since a different WS library is now usedOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Store cards as a JSON list instead of plain textOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Use enumerate(...) instead of range(len(...))Olivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Don't use getters and setters because it's PythonOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Add cosmetic changesOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-15Take the listen address and port as optional argumentsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-14Use unittest machanism to assert on exceptionsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-12Use python3 -m pytest syntax instead of pytestOlivier Gayot
On Debian, pytest is installed by the python2 package named python-pytest. On Archlinux, pytest is a python3 package installed by python-pytest. The use of python3 -m pytest allows to get rid of the discrepancy. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-12Add unit tests for swiftstory.StatusOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-12Add unit tests for swifstory.cardsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-05-12Add script to run the unit testsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-03-29Change the websocket library for the standard oneOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-03-29Catch right type of exception when decoding JSONOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2020-03-29Fix build dependenciesOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-09-12Add systemd service fileOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-09Fix typo in the english versionOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-09Fix a few typos in the french translationOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-03-09Fixed two typos in the french versionOlivier Gayot
fatasme -> fantasme sceau -> seau Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-03-09fixed typo in cardOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-03-09connect to the websocket on the same host using wss or wsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>