Repository: evennia/evennia

Issue:
[BUG] "evennia xyzgrid help" causes TypeError: NoneType takes no arguments
#### Describe the bug
Fresh migration from git master to main and then installing xyzgrid prevents evennia xyzgrid commands from working. For example, "evennia xyzgrid help" causes TypeError: NoneType takes no arguments

#### To Reproduce
1. Migrated from git master branch to main branch for 1.x release of Evennia.
2. Installed [extra](use to be in requirements_extra). 

At this point, I can run the server and log in.

3. Added the xyzgrid command set and restarted. 

'path', 'goto', 'map' are seen in the command list. The Limbo room does not have a map. Everything appears to work fine.

4. Modify the server/conf/settings.py.

xyzgrid is now available.

When I use xyzgrid, such as 'evennia xyzgrid help', or any other xyzgrid command:
TypeError: NoneType takes no arguments

#### Expected behavior
'evennia xyzgrid <command>' should call the xyzgrid command.

#### Environment, Evennia version, OS etc

    Evennia 1.0.1 (rev 38011cc48d)
    OS: nt
    Python: 3.11.1
    Twisted: 22.10.0
    Django: 4.1.4

#### Additional context

This is based off helix4's message in #general on discord. I added my current steps that seem to reproduce the same issue down below. Here is the original message from helix4, with steps for reproducing on the older version of the code.

I am trying to test XYZGrid on a brand new install but failing. 1. cloned the single branch of evennia-develop, and initiated an evennia game. 2. installed requirements_extra, and migrated. I can run the server and log in. 3. i added the command set and reloadead, i see path, goto, map ingame. the Limbo room does not have a map. seems to work well. 4. modify the server/conf/settings.py, xyzgrid is now available.

When I use xyzgrid, such as evennia xyzgrid help, or any other xyzgrid command:
    from evennia.utils.eveditor import EvEditor
  File "/home/ubuntu/3ProjectMUD/evennia/evennia/utils/eveditor.py", line 201, in <module>
    class SaveYesNoCmdSet(CmdSet):
TypeError: NoneType takes no arguments

Original message

https://discord.com/channels/246323978879107073/246323978879107073/937578545704730624

Griatch's response

https://discord.com/channels/246323978879107073/246323978879107073/937610453184561183

Steps:

1. Migrated from git master branch to main branch for 1.x release of Evennia.
2. Installed [extra](use to be in requirements_extra). 

At this point, I can run the server and log in.

3. Added the xyzgrid command set and restarted. 

'path', 'goto', 'map' are seen in the command list. The Limbo room does not have a map. Everything appears to work fine.

4. Modify the server/conf/settings.py.

xyzgrid is now available.

When I use xyzgrid, such as 'evennia xyzgrid help', or any other xyzgrid command:

Traceback (most recent call last):
  File "C:\muddev\evenv\Scripts\evennia_launcher.py", line 18, in <module>
    main()
  File "C:\muddev\evennia\evennia\server\evennia_launcher.py", line 2422, in main
    if run_custom_commands(option, *unknown_args):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\muddev\evennia\evennia\server\evennia_launcher.py", line 2023, in run_custom_commands
    mod = importlib.import_module(modpath)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\muddev\evennia\evennia\contrib\grid\xyzgrid\__init__.py", line 6, in <module>
    from . import commands  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\muddev\evennia\evennia\contrib\grid\xyzgrid\commands.py", line 15, in <module>
    from evennia.commands.default import building
  File "C:\muddev\evennia\evennia\commands\default\building.py", line 14, in <module>
    from evennia.prototypes import menus as olc_menus
  File "C:\muddev\evennia\evennia\prototypes\menus.py", line 20, in <module>
    from evennia.utils.evmenu import EvMenu, list_node
  File "C:\muddev\evennia\evennia\utils\evmenu.py", line 350, in <module>
    class CmdEvMenuNode(Command):
TypeError: NoneType takes no arguments




Discussion:
edited: I found the regression! In a recent import-formatting commit, `from . import commands` was moved from the bottom of the import list to the top. It needs to be at the bottom.

Resolving patch:
diff --git a/evennia/contrib/grid/xyzgrid/__init__.py b/evennia/contrib/grid/xyzgrid/__init__.py
--- a/evennia/contrib/grid/xyzgrid/__init__.py
+++ b/evennia/contrib/grid/xyzgrid/__init__.py
@@ -2,14 +2,15 @@
 XYZGrid - Griatch 2021
 
 """
-
-from . import commands  # noqa
-from . import example  # noqa
-from . import launchcmd  # noqa
-from . import prototypes  # noqa
-from . import tests  # noqa
-from . import utils  # noqa
-from . import xymap  # noqa
-from . import xymap_legend  # noqa
-from . import xyzgrid  # noqa
-from . import xyzroom  # noqa
+from . import (
+    example,
+    launchcmd,
+    prototypes,
+    tests,
+    utils,
+    xymap,
+    xymap_legend,
+    xyzgrid,
+    xyzroom,
+    commands,
+)


Test patch: