From 5859de7054d8d03bea0b480ba2939a9f84176d39 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 26 Jan 2022 21:45:28 +0100 Subject: [PATCH] Change to use super() instead of the old py2 style everywhere --- .../workflows/github_action_build_docs.yml | 3 +- docs/source/Contribs/Contrib-Building-Menu.md | 2 +- docs/source/Contribs/Contrib-Ingame-Python.md | 2 +- evennia/accounts/accounts.py | 2 +- evennia/accounts/tests.py | 2 +- evennia/commands/default/general.py | 2 +- .../base_systems/building_menu/README.md | 2 +- .../building_menu/building_menu.py | 6 ++-- .../base_systems/building_menu/tests.py | 2 +- .../base_systems/ingame_python/README.md | 2 +- .../contrib/game_systems/puzzles/puzzles.py | 2 +- evennia/contrib/game_systems/puzzles/tests.py | 2 +- .../game_systems/turnbattle/tb_items.py | 2 +- .../game_systems/turnbattle/tb_magic.py | 2 +- .../game_systems/turnbattle/tb_range.py | 2 +- .../contrib/game_systems/turnbattle/tests.py | 34 +++++++++---------- .../grid/extended_room/extended_room.py | 2 +- .../contrib/tutorials/bodyfunctions/tests.py | 4 +-- evennia/contrib/utils/auditing/server.py | 4 +-- evennia/locks/tests.py | 2 +- evennia/prototypes/menus.py | 4 +-- evennia/prototypes/tests.py | 8 ++--- evennia/server/amp_client.py | 2 +- evennia/server/portal/amp.py | 10 +++--- evennia/server/portal/amp_server.py | 2 +- evennia/server/portal/telnet_ssl.py | 2 +- evennia/server/portal/tests.py | 4 +-- evennia/server/serversession.py | 2 +- evennia/server/tests/test_amp_connection.py | 4 +-- evennia/server/tests/testrunner.py | 2 +- evennia/typeclasses/managers.py | 6 ++-- evennia/web/website/tests.py | 10 +++--- evennia/web/website/views/objects.py | 2 +- 33 files changed, 69 insertions(+), 70 deletions(-) diff --git a/.github/workflows/github_action_build_docs.yml b/.github/workflows/github_action_build_docs.yml index af2f249b0f..c3d0df5ec2 100644 --- a/.github/workflows/github_action_build_docs.yml +++ b/.github/workflows/github_action_build_docs.yml @@ -26,7 +26,7 @@ jobs: with: ref: v0.9.5 - - name: Checkout develop branch + - name: Checkout ${{ github.ref }} branch uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -56,6 +56,5 @@ jobs: git config --global user.email "docbuilder@evennia.com" git config --global user.name "Evennia docbuilder action" git branch - git checkout develop cd docs make release diff --git a/docs/source/Contribs/Contrib-Building-Menu.md b/docs/source/Contribs/Contrib-Building-Menu.md index e5c8d062aa..7a7318a160 100644 --- a/docs/source/Contribs/Contrib-Building-Menu.md +++ b/docs/source/Contribs/Contrib-Building-Menu.md @@ -26,7 +26,7 @@ that will edit any default object, offering to change its key and description. key = "DefaultCharacter" def at_cmdset_creation(self): - super(CharacterCmdSet, self).at_cmdset_creation() + super().at_cmdset_creation() # ... add the line below self.add(GenericBuildingCmd()) ``` diff --git a/docs/source/Contribs/Contrib-Ingame-Python.md b/docs/source/Contribs/Contrib-Ingame-Python.md index 2880b78055..4cb6a621b6 100644 --- a/docs/source/Contribs/Contrib-Ingame-Python.md +++ b/docs/source/Contribs/Contrib-Ingame-Python.md @@ -208,7 +208,7 @@ class CharacterCmdSet(default_cmds.CharacterCmdSet): """ Populates the cmdset """ - super(CharacterCmdSet, self).at_cmdset_creation() + super().at_cmdset_creation() self.add(CmdCallback()) ``` diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index ca2b492c72..0edf186225 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -664,7 +664,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase): could get invalidated. """ - super(DefaultAccount, self).set_password(password) + super().set_password(password) logger.log_sec(f"Password successfully changed for {self}.") self.at_password_change() diff --git a/evennia/accounts/tests.py b/evennia/accounts/tests.py index b975e03a56..6b0c87dbcf 100644 --- a/evennia/accounts/tests.py +++ b/evennia/accounts/tests.py @@ -116,7 +116,7 @@ class TestDefaultGuest(BaseEvenniaTest): class TestDefaultAccountAuth(BaseEvenniaTest): def setUp(self): - super(TestDefaultAccountAuth, self).setUp() + super().setUp() self.password = "testpassword" self.account.delete() diff --git a/evennia/commands/default/general.py b/evennia/commands/default/general.py index 0f64c86502..939d4d753f 100644 --- a/evennia/commands/default/general.py +++ b/evennia/commands/default/general.py @@ -141,7 +141,7 @@ class CmdNick(COMMAND_DEFAULT_CLASS): """ Support escaping of = with \= """ - super(CmdNick, self).parse() + super().parse() args = (self.lhs or "") + (" = %s" % self.rhs if self.rhs else "") parts = re.split(r"(?