From 5d23dc7229a74a2cb4dcb5b0236c9eb7abb2f9b7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 11 Feb 2020 23:41:24 +0100 Subject: [PATCH] publish: 5.5.1 --- poetry.lock | 8 ++++---- publish.bat | 2 ++ pyproject.toml | 2 +- royalpack/commands/steammatch.py | 2 +- royalpack/commands/trivia.py | 4 ++-- royalpack/tables/triviascores.py | 4 ++-- royalpack/version.py | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 publish.bat diff --git a/poetry.lock b/poetry.lock index 76993f55..a28748b7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -586,7 +586,7 @@ description = "A multipurpose bot and web framework" name = "royalnet" optional = false python-versions = ">=3.8,<4.0" -version = "5.5a5" +version = "5.5" [package.dependencies] dateparser = ">=0.7.2,<0.8.0" @@ -867,7 +867,7 @@ python-versions = "*" version = "2020.1.24" [metadata] -content-hash = "03b83f374f0113316752e6df25d265ec5d45a2f932f73de1422c92ba06621f66" +content-hash = "df4780c4db22554a780094003cbfc212af50118fc8b404c9ca25a9c61613ddb5" python-versions = "^3.8" [metadata.files] @@ -1307,8 +1307,8 @@ riotwatcher = [ {file = "riotwatcher-2.7.1.tar.gz", hash = "sha256:5349271c7e00637b7619491a6070e66603705db60558ea2a690e7016f6e6d9a4"}, ] royalnet = [ - {file = "royalnet-5.5a5-py3-none-any.whl", hash = "sha256:f913ec05849c56885bc2a455c6589d960e5af124aacc703bbd3a0e1f004d26b8"}, - {file = "royalnet-5.5a5.tar.gz", hash = "sha256:cbb22f322f6bc8ec0a6404a14d3faf046ad3fb74971917e4f87c16bb2aa300f7"}, + {file = "royalnet-5.5-py3-none-any.whl", hash = "sha256:1df345584d42ea43942606c57e24f8ffc96d0b5ef28296f78707d68dc2d21448"}, + {file = "royalnet-5.5.tar.gz", hash = "sha256:e076355fdf7d8730d258a055c22055ee8f309316a9efb3706da6896e0dc36e39"}, ] royalspells = [ {file = "royalspells-3.2.tar.gz", hash = "sha256:2bd4a9a66514532e35c02c3907425af48c7cb292364c4843c795719a82b25dfe"}, diff --git a/publish.bat b/publish.bat new file mode 100644 index 00000000..33490c42 --- /dev/null +++ b/publish.bat @@ -0,0 +1,2 @@ +git commit -am "publish: %1" +git push && poetry build && poetry publish && hub release create "%1" -m "Royalnet %1" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 48ac0b94..d056bc39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.5" + version = "5.5.1" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/commands/steammatch.py b/royalpack/commands/steammatch.py index 0e80c828..13d59070 100644 --- a/royalpack/commands/steammatch.py +++ b/royalpack/commands/steammatch.py @@ -65,7 +65,7 @@ class SteammatchCommand(Command): users.append(author) for arg in args: - user = await asyncify(Alias.find_by_alias, self.alchemy, data.session, arg) + user = await Alias.find_user(self.alchemy, data.session, arg) users.append(user) if len(users) < 2: diff --git a/royalpack/commands/trivia.py b/royalpack/commands/trivia.py index 51f9e79e..26e28c05 100644 --- a/royalpack/commands/trivia.py +++ b/royalpack/commands/trivia.py @@ -49,7 +49,7 @@ class TriviaCommand(rc.Command): for index, ts in enumerate(sorted(trivia_scores, key=lambda ts: -ts.score)): if index > 3: index = 3 - strings.append(f"{self._medal_emojis[index]} {ts.royal.username}: [b]{ts.score:.0f}p[/b]" + strings.append(f"{self._medal_emojis[index]} {ts.user.username}: [b]{ts.score:.0f}p[/b]" f" ({ts.correct_answers}/{ts.total_answers})") await data.reply("\n".join(strings)) return @@ -128,7 +128,7 @@ class TriviaCommand(rc.Command): for answerer_id in self._answerers[question_id]: answerer = data.session.query(self.alchemy.get(User)).get(answerer_id) if answerer.trivia_score is None: - ts = self.interface.alchemy.get(TriviaScore)(royal=answerer) + ts = self.interface.alchemy.get(TriviaScore)(user=answerer) data.session.add(ts) await ru.asyncify(data.session.commit) previous_score = answerer.trivia_score.score diff --git a/royalpack/tables/triviascores.py b/royalpack/tables/triviascores.py index 49538544..88bd2b13 100644 --- a/royalpack/tables/triviascores.py +++ b/royalpack/tables/triviascores.py @@ -9,11 +9,11 @@ class TriviaScore: __tablename__ = "triviascores" @declared_attr - def royal_id(self): + def user_id(self): return Column(Integer, ForeignKey("users.uid"), primary_key=True) @declared_attr - def royal(self): + def user(self): return relationship("User", backref=backref("trivia_score", uselist=False)) @declared_attr diff --git a/royalpack/version.py b/royalpack/version.py index 63bf6999..4a50633f 100644 --- a/royalpack/version.py +++ b/royalpack/version.py @@ -1 +1 @@ -semantic = "5.5" +semantic = "5.5.1"