Use with_metaclass from future.utils for python3 compat.
This commit is contained in:
parent
79437c0e48
commit
8a66fc40a9
11 changed files with 21 additions and 26 deletions
|
|
@ -30,6 +30,7 @@ Set theory.
|
|||
from weakref import WeakKeyDictionary
|
||||
from django.utils.translation import ugettext as _
|
||||
from evennia.utils.utils import inherits_from, is_iter
|
||||
from future.utils import with_metaclass
|
||||
__all__ = ("CmdSet",)
|
||||
|
||||
|
||||
|
|
@ -56,7 +57,7 @@ class _CmdSetMeta(type):
|
|||
super(_CmdSetMeta, mcs).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class CmdSet(object):
|
||||
class CmdSet(with_metaclass(_CmdSetMeta, object)):
|
||||
"""
|
||||
This class describes a unique cmdset that understands priorities.
|
||||
CmdSets can be merged and made to perform various set operations
|
||||
|
|
@ -138,7 +139,6 @@ class CmdSet(object):
|
|||
|
||||
|
||||
"""
|
||||
__metaclass__ = _CmdSetMeta
|
||||
|
||||
key = "Unnamed CmdSet"
|
||||
mergetype = "Union"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ All commands in Evennia inherit from the 'Command' class in this module.
|
|||
import re
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import is_iter, fill, lazy_property
|
||||
from future.utils import with_metaclass
|
||||
|
||||
|
||||
def _init_command(mcs, **kwargs):
|
||||
|
|
@ -87,7 +88,7 @@ class CommandMeta(type):
|
|||
# parsing errors.
|
||||
|
||||
|
||||
class Command(object):
|
||||
class Command(with_metaclass(CommandMeta, object)):
|
||||
"""
|
||||
Base command
|
||||
|
||||
|
|
@ -127,8 +128,6 @@ class Command(object):
|
|||
system to create the help entry for the command, so it's a good idea to
|
||||
format it similar to this one)
|
||||
"""
|
||||
# Tie our metaclass, for some convenience cleanup
|
||||
__metaclass__ = CommandMeta
|
||||
|
||||
# the main way to call this command (e.g. 'look')
|
||||
key = "command"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue