# caller know. We'll just return, since we're done
return
# we found a target! we'll do stuff to them.
- target.msg(f"{self.caller} pokes you.")
- self.caller.msg(f"You poke {target}.")
+ target.msg(f"{self.caller} pokes you.")
+ self.caller.msg(f"You poke {target}.")
By default, the search method of a Character will attempt to find a unique object match for the
@@ -202,7 +202,7 @@ Command to do this:
def func(self):
"""Executes 'hangouts' command"""
hangouts = search_tag(key="hangout", category="location tags")
- self.caller.msg(f"Hangouts available: {', '.join(str(ob) for ob in hangouts)}")
+ self.caller.msg(f"Hangouts available: {', '.join(str(ob) for ob in hangouts)}")
This uses the search_tag function to find all objects previously tagged with Tags
diff --git a/docs/0.9.5/Tutorial-Tweeting-Game-Stats.html b/docs/0.9.5/Tutorial-Tweeting-Game-Stats.html
index 08795ab789..e9eaeaa419 100644
--- a/docs/0.9.5/Tutorial-Tweeting-Game-Stats.html
+++ b/docs/0.9.5/Tutorial-Tweeting-Game-Stats.html
@@ -141,7 +141,7 @@ regularly, from player deaths to how much currency is in the economy etc.
self.key = "tweet_stats"
self.desc = "Tweets interesting stats about the game"
self.interval = 86400 # 1 day timeout
- self.start_delay = False
+ self.start_delay = False
def at_repeat(self):
"""
@@ -162,16 +162,16 @@ regularly, from player deaths to how much currency is in the economy etc.
nobjs = ObjectDB.objects.count()
base_char_typeclass = settings.BASE_CHARACTER_TYPECLASS
nchars = ObjectDB.objects.filter(db_typeclass_path=base_char_typeclass).count()
- nrooms = ObjectDB.objects.filter(db_location__isnull=True).exclude(db_typeclass_path=bas
+ nrooms = ObjectDB.objects.filter(db_location__isnull=True).exclude(db_typeclass_path=bas
e_char_typeclass).count()
- nexits = ObjectDB.objects.filter(db_location__isnull=False,
-db_destination__isnull=False).count()
+ nexits = ObjectDB.objects.filter(db_location__isnull=False,
+db_destination__isnull=False).count()
nother = nobjs - nchars - nrooms - nexits
tweet = "Chars: %s, Rooms: %s, Objects: %s" %(nchars, nrooms, nother)
else:
if tweet_output == 2: ##Number of prototypes and 3 random keys - taken from @spawn
command
- prototypes = spawner.spawn(return_prototypes=True)
+ prototypes = spawner.spawn(return_prototypes=True)
keys = prototypes.keys()
nprots = len(prototypes)
diff --git a/docs/0.9.5/Tutorial-Vehicles.html b/docs/0.9.5/Tutorial-Vehicles.html
index 3b49818051..4c414daa04 100644
--- a/docs/0.9.5/Tutorial-Vehicles.html
+++ b/docs/0.9.5/Tutorial-Vehicles.html
@@ -400,17 +400,17 @@ and leave it.
def at_object_creation(self):
self.cmdset.add_default(CmdSetTrain)
- self.db.driving = False
+ self.db.driving = False
# The direction our train is driving (1 for forward, -1 for backwards)
self.db.direction = 1
# The rooms our train will pass through (change to fit your game)
self.db.rooms = ["#2", "#47", "#50", "#53", "#56", "#59"]
def start_driving(self):
- self.db.driving = True
+ self.db.driving = True
def stop_driving(self):
- self.db.driving = False
+ self.db.driving = False
def goto_next_room(self):
currentroom = self.location.dbref
@@ -498,9 +498,9 @@ care of the driving.
def at_script_creation(self):
self.key = "trainstopped"
self.interval = 30
- self.persistent = True
+ self.persistent = True
self.repeats = 1
- self.start_delay = True
+ self.start_delay = True
def at_repeat(self):
self.obj.start_driving()
@@ -514,7 +514,7 @@ care of the driving.
def at_script_creation(self):
self.key = "traindriving"
self.interval = 1
- self.persistent = True
+ self.persistent = True
def is_valid(self):
return self.obj.db.driving
diff --git a/docs/0.9.5/Tutorial-for-basic-MUSH-like-game.html b/docs/0.9.5/Tutorial-for-basic-MUSH-like-game.html
index 77d1eb6448..e42ccde366 100644
--- a/docs/0.9.5/Tutorial-for-basic-MUSH-like-game.html
+++ b/docs/0.9.5/Tutorial-for-basic-MUSH-like-game.html
@@ -297,7 +297,7 @@ It’s cleaner to put it on a room, so it’s only available when players are in
"""
def at_object_creation(self):
"this is called only at first creation"
- self.cmdset.add(ChargenCmdset, permanent=True)
+ self.cmdset.add(ChargenCmdset, permanent=True)
Note how new rooms created with this typeclass will always start with ChargenCmdset on themselves.
@@ -736,7 +736,7 @@ principle re-work our old def parse(self):
"We need to do some parsing here"
args = self.args
- propname, propval = None, None
+ propname, propval = None, None
if "=" in args:
args, propval = [part.strip() for part in args.rsplit("=", 1)]
if "/" in args:
@@ -745,7 +745,7 @@ principle re-work our old self.name = args
self.propname = propname
# a propval without a propname is meaningless
- self.propval = propval if propname else None
+ self.propval = propval if propname else None
def func(self):
"do the editing"
@@ -764,22 +764,22 @@ principle re-work our old return
if not self.propname:
# this means we just list the values
- output = f"Properties of {npc.key}:"
+ output = f"Properties of {npc.key}:"
for propname in allowed_propnames:
- output += f"\n {propname} = {npc.attributes.get(propname, default='N/A')}"
+ output += f"\n {propname} = {npc.attributes.get(propname, default='N/A')}"
caller.msg(output)
elif self.propname not in allowed_propnames:
- caller.msg(f"You may only change {', '.join(allowed_propnames)}.")
+ caller.msg(f"You may only change {', '.join(allowed_propnames)}.")
elif self.propval:
# assigning a new propvalue
# in this example, the properties are all integers...
intpropval = int(self.propval)
npc.attributes.add(self.propname, intpropval)
- caller.msg(f"Set {npc.key}'s property {self.propname} to {self.propval}")
+ caller.msg(f"Set {npc.key}'s property {self.propname} to {self.propval}")
else:
# propname set, but not propval - show current value
- caller.msg(f"{npc.key} has property {self.propname} = {npc.attributes.get(self.propname,
-default='N/A')}")
+ caller.msg(f"{npc.key} has property {self.propname} = {npc.attributes.get(self.propname,
+default='N/A')}")
This command example shows off the use of more advanced parsing but otherwise it’s mostly error
@@ -859,7 +859,7 @@ Anna says, 'Hello!'
def parse(self):
"Simple split of the = sign"
- name, cmdname = None, None
+ name, cmdname = None, None
if "=" in self.args:
name, cmdname = self.args.rsplit("=", 1)
name = name.strip()
@@ -880,7 +880,7 @@ Anna says, 'Hello!'
return
# send the command order
npc.execute_cmd(self.cmdname)
- caller.msg(f"You told {npc.key} to do '{self.cmdname}'.")
+ caller.msg(f"You told {npc.key} to do '{self.cmdname}'.")
Note that if you give an erroneous command, you will not see any error message, since that error
diff --git a/docs/0.9.5/Typeclasses.html b/docs/0.9.5/Typeclasses.html
index f7cfbcb936..e4dc74d813 100644
--- a/docs/0.9.5/Typeclasses.html
+++ b/docs/0.9.5/Typeclasses.html
@@ -187,7 +187,7 @@ and can thus only hold a string. This is one way of making sure to update the chair.db_key = "Table"
chair.save()
-print(chair.db_key)
+print(chair.db_key)
<<< Table
|
@@ -199,7 +199,7 @@ fields. These are named the same as the field, but without the chair.key = "Table"
-print(chair.key)
+print(chair.key)
<<< Table
@@ -319,7 +319,7 @@ it all in-game using ; and list
comprehensions, like this (ignore the
line break, that’s only for readability in the wiki):
-@py from typeclasses.furniture import Furniture;
+@py from typeclasses.furniture import Furniture;
[obj.at_object_creation() for obj in Furniture.objects.all() if not obj.db.worth]
@@ -344,8 +344,8 @@ to re-run the creation hook on an existing class.
In code you instead use the swap_typeclass method which you can find on all typeclassed entities:
| obj_to_change.swap_typeclass(new_typeclass_path, clean_attributes=False,
- run_start_hooks="all", no_default=True, clean_cmdsets=False)
+2 | obj_to_change.swap_typeclass(new_typeclass_path, clean_attributes=False,
+ run_start_hooks="all", no_default=True, clean_cmdsets=False)
|
The arguments to this method are described in the API docs
diff --git a/docs/0.9.5/Unit-Testing.html b/docs/0.9.5/Unit-Testing.html
index e40c59b766..d83b8ffe06 100644
--- a/docs/0.9.5/Unit-Testing.html
+++ b/docs/0.9.5/Unit-Testing.html
@@ -149,7 +149,7 @@ can optionally do cleanup after each test.
def test_alternative_call(self):
"test method. Calls with a keyword argument."
expected_return = "This is me being baaaad."
- actual_return = myfunc(bad=True)
+ actual_return = myfunc(bad=True)
# test
self.assertEqual(expected_return, actual_return)
@@ -309,7 +309,7 @@ testing#503435) is currently untested! Please report your findings.
from django.core.management import call_command
from django.db.models import loading
-
loading.cache.loaded = False
+
loading.cache.loaded = False
call_command('syncdb', verbosity=0)
def tearDown(self):
@@ -318,7 +318,7 @@ testing#503435) is currently untested! Please report your findings.
from django.core.management import call_command
from django.db.models import loading
-
loading.cache.loaded = False
+
loading.cache.loaded = False
call_command('syncdb', verbosity=0)
# test cases below ...
diff --git a/docs/0.9.5/Web-Character-Generation.html b/docs/0.9.5/Web-Character-Generation.html
index 40cbaabb80..8efbb6d052 100644
--- a/docs/0.9.5/Web-Character-Generation.html
+++ b/docs/0.9.5/Web-Character-Generation.html
@@ -156,12 +156,12 @@ attributes and so on.
from django.db import models
class CharApp(models.Model):
-
app_id = models.AutoField(primary_key=True)
+
app_id = models.AutoField(primary_key=True)
char_name = models.CharField(max_length=80, verbose_name='Character Name')
date_applied = models.DateTimeField(verbose_name='Date Applied')
background = models.TextField(verbose_name='Background')
account_id = models.IntegerField(default=1, verbose_name='Account ID')
-
submitted = models.BooleanField(default=False)
+
submitted = models.BooleanField(default=False)
You should consider how you are going to link your application to your account. For this tutorial,
@@ -213,7 +213,7 @@ given Character.
current_user = request.user # current user logged in
p_id = current_user.id # the account id
# submitted Characters by this account
- sub_apps = CharApp.objects.filter(account_id=p_id, submitted=True)
+ sub_apps = CharApp.objects.filter(account_id=p_id, submitted=True)
context = {'sub_apps': sub_apps}
# make the variables in 'context' available to the web page template
return render(request, 'chargen/index.html', context)
@@ -339,9 +339,9 @@ name and background. This form we create in name = form.cleaned_data['name']
background = form.cleaned_data['background']
applied_date = datetime.now()
- submitted = True
+ submitted = True
if 'save' in request.POST:
- submitted = False
+ submitted = False
app = CharApp(char_name=name, background=background,
date_applied=applied_date, account_id=user.id,
submitted=submitted)
@@ -463,7 +463,7 @@ setting custom attributes is as easy as doing it in the meat of your Evennia gam
current_user = request.user # current user logged in
p_id = current_user.id # the account id
# submitted apps under this account
- sub_apps = CharApp.objects.filter(account_id=p_id, submitted=True)
+ sub_apps = CharApp.objects.filter(account_id=p_id, submitted=True)
context = {'sub_apps': sub_apps}
return render(request, 'chargen/index.html', context)
@@ -485,9 +485,9 @@ setting custom attributes is as easy as doing it in the meat of your Evennia gam
name = form.cleaned_data['name']
background = form.cleaned_data['background']
applied_date = datetime.now()
- submitted = True
+ submitted = True
if 'save' in request.POST:
- submitted = False
+ submitted = False
app = CharApp(char_name=name, background=background,
date_applied=applied_date, account_id=user.id,
submitted=submitted)
diff --git a/docs/0.9.5/_modules/django/conf.html b/docs/0.9.5/_modules/django/conf.html
index 19aad6d4d9..0e97cc768a 100644
--- a/docs/0.9.5/_modules/django/conf.html
+++ b/docs/0.9.5/_modules/django/conf.html
@@ -51,15 +51,15 @@
import time
import traceback
import warnings
-from pathlib import Path
+from pathlib import Path
import django
-from django.conf import global_settings
-from django.core.exceptions import ImproperlyConfigured
-from django.utils.deprecation import (
+from django.conf import global_settings
+from django.core.exceptions import ImproperlyConfigured
+from django.utils.deprecation import (
RemovedInDjango30Warning, RemovedInDjango31Warning,
)
-from django.utils.functional import LazyObject, empty
+from django.utils.functional import LazyObject, empty
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
@@ -75,10 +75,10 @@
String subclass which references a current settings value. It's treated as
the value in memory but serializes to a settings.NAME attribute reference.
"""
- def __new__(self, value, setting_name):
+ def __new__(self, value, setting_name):
return str.__new__(self, value)
- def __init__(self, value, setting_name):
+ def __init__(self, value, setting_name):
self.setting_name = setting_name
@@ -105,7 +105,7 @@
self._wrapped = Settings(settings_module)
- def __repr__(self):
+ def __repr__(self):
# Hardcode the class name as otherwise it yields 'Settings'.
if self._wrapped is empty:
return '<LazySettings [Unevaluated]>'
@@ -113,7 +113,7 @@
'settings_module': self._wrapped.SETTINGS_MODULE,
}
- def __getattr__(self, name):
+ def __getattr__(self, name):
"""Return the value of a setting and cache it in self.__dict__."""
if self._wrapped is empty:
self._setup(name)
@@ -121,7 +121,7 @@
self.__dict__[name] = val
return val
- def __setattr__(self, name, value):
+ def __setattr__(self, name, value):
"""
Set the value of setting. Clear all cached values if _wrapped changes
(@override_settings does this) or clear single values when set.
@@ -132,7 +132,7 @@
self.__dict__.pop(name, None)
super().__setattr__(name, value)
- def __delattr__(self, name):
+ def __delattr__(self, name):
"""Delete a setting and clear it from cache if needed."""
super().__delattr__(name)
self.__dict__.pop(name, None)
@@ -185,7 +185,7 @@
class Settings:
- def __init__(self, settings_module):
+ def __init__(self, settings_module):
# update this dict from global settings (but only for ALL_CAPS settings)
for setting in dir(global_settings):
if setting.isupper():
@@ -235,7 +235,7 @@
def is_overridden(self, setting):
return setting in self._explicit_settings
- def __repr__(self):
+ def __repr__(self):
return '<%(cls)s "%(settings_module)s">' % {
'cls': self.__class__.__name__,
'settings_module': self.SETTINGS_MODULE,
@@ -248,7 +248,7 @@
# (standalone) case.
SETTINGS_MODULE = None
- def __init__(self, default_settings):
+ def __init__(self, default_settings):
"""
Requests for configuration variables not in this class are satisfied
from the module specified in default_settings (if possible).
@@ -256,12 +256,12 @@
self.__dict__['_deleted'] = set()
self.default_settings = default_settings
- def __getattr__(self, name):
+ def __getattr__(self, name):
if name in self._deleted:
raise AttributeError
return getattr(self.default_settings, name)
- def __setattr__(self, name, value):
+ def __setattr__(self, name, value):
self._deleted.discard(name)
if name == 'DEFAULT_CONTENT_TYPE':
warnings.warn(DEFAULT_CONTENT_TYPE_DEPRECATED_MSG, RemovedInDjango30Warning)
@@ -269,12 +269,12 @@
warnings.warn(FILE_CHARSET_DEPRECATED_MSG, RemovedInDjango31Warning)
super().__setattr__(name, value)
- def __delattr__(self, name):
+ def __delattr__(self, name):
self._deleted.add(name)
if hasattr(self, name):
super().__delattr__(name)
- def __dir__(self):
+ def __dir__(self):
return sorted(
s for s in [*self.__dict__, *dir(self.default_settings)]
if s not in self._deleted
@@ -286,7 +286,7 @@
set_on_default = getattr(self.default_settings, 'is_overridden', lambda s: False)(setting)
return deleted or set_locally or set_on_default
- def __repr__(self):
+ def __repr__(self):
return '<%(cls)s>' % {
'cls': self.__class__.__name__,
}
diff --git a/docs/0.9.5/_modules/django/db/models/fields/related_descriptors.html b/docs/0.9.5/_modules/django/db/models/fields/related_descriptors.html
index b4de9c959e..ee9361f294 100644
--- a/docs/0.9.5/_modules/django/db/models/fields/related_descriptors.html
+++ b/docs/0.9.5/_modules/django/db/models/fields/related_descriptors.html
@@ -103,11 +103,11 @@
``ReverseManyToManyDescriptor``, use ``ManyToManyDescriptor`` instead.
"""
-from django.core.exceptions import FieldError
-from django.db import connections, router, transaction
-from django.db.models import Q, signals
-from django.db.models.query import QuerySet
-from django.utils.functional import cached_property
+from django.core.exceptions import FieldError
+from django.db import connections, router, transaction
+from django.db.models import Q, signals
+from django.db.models.query import QuerySet
+from django.utils.functional import cached_property
class ForwardManyToOneDescriptor:
@@ -123,7 +123,7 @@
``Child.parent`` is a ``ForwardManyToOneDescriptor`` instance.
"""
- def __init__(self, field_with_rel):
+ def __init__(self, field_with_rel):
self.field = field_with_rel
@cached_property
@@ -184,7 +184,7 @@
# Assuming the database enforces foreign keys, this won't fail.
return qs.get(self.field.get_reverse_related_filter(instance))
- def __get__(self, instance, cls=None):
+ def __get__(self, instance, cls=None):
"""
Get the related instance through the forward relation.
@@ -231,7 +231,7 @@
else:
return rel_obj
- def __set__(self, instance, value):
+ def __set__(self, instance, value):
"""
Set the related instance through the forward relation.
@@ -337,7 +337,7 @@
return obj
return super().get_object(instance)
- def __set__(self, instance, value):
+ def __set__(self, instance, value):
super().__set__(instance, value)
# If the primary key is a link to a parent model and a parent instance
# is being set, update the value of the inherited pk(s).
@@ -367,7 +367,7 @@
``Place.restaurant`` is a ``ReverseOneToOneDescriptor`` instance.
"""
- def __init__(self, related):
+ def __init__(self, related):
# Following the example above, `related` is an instance of OneToOneRel
# which represents the reverse restaurant field (place.restaurant).
self.related = related
@@ -411,7 +411,7 @@
self.related.field.set_cached_value(rel_obj, instance)
return queryset, rel_obj_attr, instance_attr, True, self.related.get_cache_name(), False
- def __get__(self, instance, cls=None):
+ def __get__(self, instance, cls=None):
"""
Get the related instance through the reverse relation.
@@ -458,7 +458,7 @@
else:
return rel_obj
- def __set__(self, instance, value):
+ def __set__(self, instance, value):
"""
Set the related instance through the reverse relation.
@@ -538,7 +538,7 @@
class built by ``create_forward_many_to_many_manager()`` defined below.
"""
- def __init__(self, rel):
+ def __init__(self, rel):
self.rel = rel
self.field = rel.field
@@ -551,7 +551,7 @@
self.rel,
)
- def __get__(self, instance, cls=None):
+ def __get__(self, instance, cls=None):
"""
Get the related objects through the reverse relation.
@@ -572,7 +572,7 @@
self.rel.get_accessor_name(),
)
- def __set__(self, instance, value):
+ def __set__(self, instance, value):
raise TypeError(
'Direct assignment to the %s is prohibited. Use %s.set() instead.'
% self._get_set_deprecation_msg_params(),
@@ -588,7 +588,7 @@
"""
class RelatedManager(superclass):
- def __init__(self, instance):
+ def __init__(self, instance):
super().__init__()
self.instance = instance
@@ -597,7 +597,7 @@
self.core_filters = {self.field.name: instance}
- def __call__(self, *, manager):
+ def __call__(self, *, manager):
manager = getattr(self.model, manager)
manager_class = create_reverse_many_to_one_manager(manager.__class__, rel)
return manager_class(self.instance)
@@ -802,7 +802,7 @@
class built by ``create_forward_many_to_many_manager()`` defined below.
"""
- def __init__(self, rel, reverse=False):
+ def __init__(self, rel, reverse=False):
super().__init__(rel)
self.reverse = reverse
@@ -840,7 +840,7 @@
"""
class ManyRelatedManager(superclass):
- def __init__(self, instance=None):
+ def __init__(self, instance=None):
super().__init__()
self.instance = instance
@@ -886,7 +886,7 @@
"a many-to-many relationship can be used." %
instance.__class__.__name__)
- def __call__(self, *, manager):
+ def __call__(self, *, manager):
manager = getattr(self.model, manager)
manager_class = create_forward_many_to_many_manager(manager.__class__, rel, reverse)
return manager_class(instance=self.instance)
@@ -1071,7 +1071,7 @@
through_defaults = through_defaults or {}
# If there aren't any objects, there is nothing to do.
- from django.db.models import Model
+ from django.db.models import Model
if objs:
new_ids = set()
for obj in objs:
diff --git a/docs/0.9.5/_modules/django/db/models/manager.html b/docs/0.9.5/_modules/django/db/models/manager.html
index 619ff691d2..9c96bce2d0 100644
--- a/docs/0.9.5/_modules/django/db/models/manager.html
+++ b/docs/0.9.5/_modules/django/db/models/manager.html
@@ -40,10 +40,10 @@
Source code for django.db.models.manager
import copy
import inspect
-from importlib import import_module
+from importlib import import_module
-from django.db import router
-from django.db.models.query import QuerySet
+from django.db import router
+from django.db.models.query import QuerySet
class BaseManager:
@@ -57,13 +57,13 @@
#: thus be available in e.g. RunPython operations.
use_in_migrations = False
- def __new__(cls, *args, **kwargs):
+ def __new__(cls, *args, **kwargs):
# Capture the arguments to make returning them trivial.
obj = super().__new__(cls)
obj._constructor_args = (args, kwargs)
return obj
- def __init__(self):
+ def __init__(self):
super().__init__()
self._set_creation_counter()
self.model = None
@@ -71,7 +71,7 @@
self._db = None
self._hints = {}
- def __str__(self):
+ def __str__(self):
"""Return "app_label.model_label.manager_name"."""
return '%s.%s' % (self.model._meta.label, self.name)
@@ -192,13 +192,13 @@
# understanding of how this comes into play.
return self.get_queryset()
- def __eq__(self, other):
+ def __eq__(self, other):
return (
isinstance(other, self.__class__) and
self._constructor_args == other._constructor_args
)
- def __hash__(self):
+ def __hash__(self):
return id(self)
@@ -208,10 +208,10 @@
class ManagerDescriptor:
- def __init__(self, manager):
+ def __init__(self, manager):
self.manager = manager
- def __get__(self, instance, cls=None):
+ def __get__(self, instance, cls=None):
if instance is not None:
raise AttributeError("Manager isn't accessible via %s instances" % cls.__name__)
@@ -233,7 +233,7 @@
class EmptyManager(Manager):
- def __init__(self, model):
+ def __init__(self, model):
super().__init__()
self.model = model
diff --git a/docs/0.9.5/_modules/django/db/models/query_utils.html b/docs/0.9.5/_modules/django/db/models/query_utils.html
index 591cd7101a..1366e335d0 100644
--- a/docs/0.9.5/_modules/django/db/models/query_utils.html
+++ b/docs/0.9.5/_modules/django/db/models/query_utils.html
@@ -48,10 +48,10 @@
import copy
import functools
import inspect
-from collections import namedtuple
+from collections import namedtuple
-from django.db.models.constants import LOOKUP_SEP
-from django.utils import tree
+from django.db.models.constants import LOOKUP_SEP
+from django.utils import tree
# PathInfo is used when converting lookups (fk__somecol). The contents
# describe the relation in Model terms (model Options and Fields for both
@@ -77,7 +77,7 @@
"""
contains_aggregate = False
- def __init__(self, sql, params):
+ def __init__(self, sql, params):
self.data = sql, list(params)
def as_sql(self, compiler=None, connection=None):
@@ -95,7 +95,7 @@
default = AND
conditional = True
- def __init__(self, *args, _connector=None, _negated=False, **kwargs):
+ def __init__(self, *args, _connector=None, _negated=False, **kwargs):
super().__init__(children=[*args, *sorted(kwargs.items())], connector=_connector, negated=_negated)
def _combine(self, other, conn):
@@ -115,13 +115,13 @@
obj.add(other, conn)
return obj
- def __or__(self, other):
+ def __or__(self, other):
return self._combine(other, self.OR)
- def __and__(self, other):
+ def __and__(self, other):
return self._combine(other, self.AND)
- def __invert__(self):
+ def __invert__(self):
obj = type(self)()
obj.add(self, self.AND)
obj.negate()
@@ -156,10 +156,10 @@
A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.
"""
- def __init__(self, field_name):
+ def __init__(self, field_name):
self.field_name = field_name
- def __get__(self, instance, cls=None):
+ def __get__(self, instance, cls=None):
"""
Retrieve and caches the value from the datastore on the first lookup.
Return the cached value.
@@ -204,7 +204,7 @@
return cls.merge_dicts(class_lookups)
def get_lookup(self, lookup_name):
- from django.db.models.lookups import Lookup
+ from django.db.models.lookups import Lookup
found = self._get_lookup(lookup_name)
if found is None and hasattr(self, 'output_field'):
return self.output_field.get_lookup(lookup_name)
@@ -213,7 +213,7 @@
return found
def get_transform(self, lookup_name):
- from django.db.models.lookups import Transform
+ from django.db.models.lookups import Transform
found = self._get_lookup(lookup_name)
if found is None and hasattr(self, 'output_field'):
return self.output_field.get_transform(lookup_name)
@@ -338,7 +338,7 @@
class FilteredRelation:
"""Specify custom filtering in the ON clause of SQL joins."""
- def __init__(self, relation_name, *, condition=Q()):
+ def __init__(self, relation_name, *, condition=Q()):
if not relation_name:
raise ValueError('relation_name cannot be empty.')
self.relation_name = relation_name
@@ -348,7 +348,7 @@
self.condition = condition
self.path = []
- def __eq__(self, other):
+ def __eq__(self, other):
return (
isinstance(other, self.__class__) and
self.relation_name == other.relation_name and
diff --git a/docs/0.9.5/_modules/django/utils/functional.html b/docs/0.9.5/_modules/django/utils/functional.html
index a41690bac0..4fc32eba9e 100644
--- a/docs/0.9.5/_modules/django/utils/functional.html
+++ b/docs/0.9.5/_modules/django/utils/functional.html
@@ -41,9 +41,9 @@
import copy
import itertools
import operator
-from functools import total_ordering, wraps
+from functools import total_ordering, wraps
-from django.utils.version import PY36, get_docs_version
+from django.utils.version import PY36, get_docs_version
# You can't trivially replace this with `functools.partial` because this binds
@@ -78,7 +78,7 @@
def _is_mangled(name):
return name.startswith('__') and not name.endswith('__')
- def __init__(self, func, name=None):
+ def __init__(self, func, name=None):
if PY36:
self.real_func = func
else:
@@ -109,7 +109,7 @@
"(%r and %r)." % (self.name, name)
)
- def __get__(self, instance, cls=None):
+ def __get__(self, instance, cls=None):
"""
Call the function and put the return value in instance.__dict__ so that
subsequent attribute access on the instance returns the cached value
@@ -146,7 +146,7 @@
"""
__prepared = False
- def __init__(self, args, kw):
+ def __init__(self, args, kw):
self.__args = args
self.__kw = kw
if not self.__prepared:
@@ -159,7 +159,7 @@
(func, self.__args, self.__kw) + resultclasses
)
- def __repr__(self):
+ def __repr__(self):
return repr(self.__cast())
@classmethod
@@ -209,25 +209,25 @@
else:
return func(*self.__args, **self.__kw)
- def __str__(self):
+ def __str__(self):
# object defines __str__(), so __prepare_class__() won't overload
# a __str__() method from the proxied class.
return str(self.__cast())
- def __eq__(self, other):
+ def __eq__(self, other):
if isinstance(other, Promise):
other = other.__cast()
return self.__cast() == other
- def __lt__(self, other):
+ def __lt__(self, other):
if isinstance(other, Promise):
other = other.__cast()
return self.__cast() < other
- def __hash__(self):
+ def __hash__(self):
return hash(self.__cast())
- def __mod__(self, rhs):
+ def __mod__(self, rhs):
if self._delegate_text:
return str(self) % rhs
return self.__cast() % rhs
@@ -310,14 +310,14 @@
# Avoid infinite recursion when tracing __init__ (#19456).
_wrapped = None
- def __init__(self):
+ def __init__(self):
# Note: if a subclass overrides __init__(), it will likely need to
# override __copy__() and __deepcopy__() as well.
self._wrapped = empty
__getattr__ = new_method_proxy(getattr)
- def __setattr__(self, name, value):
+ def __setattr__(self, name, value):
if name == "_wrapped":
# Assign to __dict__ to avoid infinite __setattr__ loops.
self.__dict__["_wrapped"] = value
@@ -326,7 +326,7 @@
self._setup()
setattr(self._wrapped, name, value)
- def __delattr__(self, name):
+ def __delattr__(self, name):
if name == "_wrapped":
raise TypeError("can't delete _wrapped.")
if self._wrapped is empty:
@@ -416,7 +416,7 @@
Designed for compound objects of unknown type. For builtins or objects of
known type, use django.utils.functional.lazy.
"""
- def __init__(self, func):
+ def __init__(self, func):
"""
Pass in a callable that returns the object to be wrapped.
@@ -433,7 +433,7 @@
# Return a meaningful representation of the lazy object for debugging
# without evaluating the wrapped object.
- def __repr__(self):
+ def __repr__(self):
if self._wrapped is empty:
repr_attr = self._setupfunc
else:
diff --git a/docs/0.9.5/_modules/evennia.html b/docs/0.9.5/_modules/evennia.html
index bec35677f6..dffb0ec2a8 100644
--- a/docs/0.9.5/_modules/evennia.html
+++ b/docs/0.9.5/_modules/evennia.html
@@ -157,7 +157,7 @@
Helper function for building the version string
"""
import os
- from subprocess import check_output, CalledProcessError, STDOUT
+ from subprocess import check_output, CalledProcessError, STDOUT
version = "Unknown"
root = os.path.dirname(os.path.abspath(__file__))
@@ -210,69 +210,69 @@
global BASE_SCRIPT_TYPECLASS, BASE_GUEST_TYPECLASS
# Parent typeclasses
- from .accounts.accounts import DefaultAccount
- from .accounts.accounts import DefaultGuest
- from .objects.objects import DefaultObject
- from .objects.objects import DefaultCharacter
- from .objects.objects import DefaultRoom
- from .objects.objects import DefaultExit
- from .comms.comms import DefaultChannel
- from .scripts.scripts import DefaultScript
+ from .accounts.accounts import DefaultAccount
+ from .accounts.accounts import DefaultGuest
+ from .objects.objects import DefaultObject
+ from .objects.objects import DefaultCharacter
+ from .objects.objects import DefaultRoom
+ from .objects.objects import DefaultExit
+ from .comms.comms import DefaultChannel
+ from .scripts.scripts import DefaultScript
# Database models
- from .objects.models import ObjectDB
- from .accounts.models import AccountDB
- from .scripts.models import ScriptDB
- from .comms.models import ChannelDB
- from .comms.models import Msg
+ from .objects.models import ObjectDB
+ from .accounts.models import AccountDB
+ from .scripts.models import ScriptDB
+ from .comms.models import ChannelDB
+ from .comms.models import Msg
# commands
- from .commands.command import Command, InterruptCommand
- from .commands.cmdset import CmdSet
+ from .commands.command import Command, InterruptCommand
+ from .commands.cmdset import CmdSet
# search functions
- from .utils.search import search_object
- from .utils.search import search_script
- from .utils.search import search_account
- from .utils.search import search_message
- from .utils.search import search_channel
- from .utils.search import search_help
- from .utils.search import search_tag
+ from .utils.search import search_object
+ from .utils.search import search_script
+ from .utils.search import search_account
+ from .utils.search import search_message
+ from .utils.search import search_channel
+ from .utils.search import search_help
+ from .utils.search import search_tag
# create functions
- from .utils.create import create_object
- from .utils.create import create_script
- from .utils.create import create_account
- from .utils.create import create_channel
- from .utils.create import create_message
- from .utils.create import create_help_entry
+ from .utils.create import create_object
+ from .utils.create import create_script
+ from .utils.create import create_account
+ from .utils.create import create_channel
+ from .utils.create import create_message
+ from .utils.create import create_help_entry
# utilities
- from django.conf import settings
- from .locks import lockfuncs
- from .utils import logger
- from .utils import gametime
- from .utils import ansi
- from .prototypes.spawner import spawn
- from . import contrib
- from .utils.evmenu import EvMenu
- from .utils.evtable import EvTable
- from .utils.evmore import EvMore
- from .utils.evform import EvForm
- from .utils.eveditor import EvEditor
- from .utils.ansi import ANSIString
- from .server import signals
+ from django.conf import settings
+ from .locks import lockfuncs
+ from .utils import logger
+ from .utils import gametime
+ from .utils import ansi
+ from .prototypes.spawner import spawn
+ from . import contrib
+ from .utils.evmenu import EvMenu
+ from .utils.evtable import EvTable
+ from .utils.evmore import EvMore
+ from .utils.evform import EvForm
+ from .utils.eveditor import EvEditor
+ from .utils.ansi import ANSIString
+ from .server import signals
# handlers
- from .scripts.tickerhandler import TICKER_HANDLER
- from .scripts.taskhandler import TASK_HANDLER
- from .server.sessionhandler import SESSION_HANDLER
- from .comms.channelhandler import CHANNEL_HANDLER
- from .scripts.monitorhandler import MONITOR_HANDLER
+ from .scripts.tickerhandler import TICKER_HANDLER
+ from .scripts.taskhandler import TASK_HANDLER
+ from .server.sessionhandler import SESSION_HANDLER
+ from .comms.channelhandler import CHANNEL_HANDLER
+ from .scripts.monitorhandler import MONITOR_HANDLER
# containers
- from .utils.containers import GLOBAL_SCRIPTS
- from .utils.containers import OPTION_CLASSES
+ from .utils.containers import GLOBAL_SCRIPTS
+ from .utils.containers import OPTION_CLASSES
# API containers
@@ -308,14 +308,14 @@
"""
- from .help.models import HelpEntry
- from .accounts.models import AccountDB
- from .scripts.models import ScriptDB
- from .comms.models import Msg, ChannelDB
- from .objects.models import ObjectDB
- from .server.models import ServerConfig
- from .typeclasses.attributes import Attribute
- from .typeclasses.tags import Tag
+ from .help.models import HelpEntry
+ from .accounts.models import AccountDB
+ from .scripts.models import ScriptDB
+ from .comms.models import Msg, ChannelDB
+ from .objects.models import ObjectDB
+ from .server.models import ServerConfig
+ from .typeclasses.attributes import Attribute
+ from .typeclasses.tags import Tag
# create container's properties
helpentries = HelpEntry.objects
@@ -344,23 +344,23 @@
"""
- from .commands.default.cmdset_character import CharacterCmdSet
- from .commands.default.cmdset_account import AccountCmdSet
- from .commands.default.cmdset_unloggedin import UnloggedinCmdSet
- from .commands.default.cmdset_session import SessionCmdSet
- from .commands.default.muxcommand import MuxCommand, MuxAccountCommand
+ from .commands.default.cmdset_character import CharacterCmdSet
+ from .commands.default.cmdset_account import AccountCmdSet
+ from .commands.default.cmdset_unloggedin import UnloggedinCmdSet
+ from .commands.default.cmdset_session import SessionCmdSet
+ from .commands.default.muxcommand import MuxCommand, MuxAccountCommand
- def __init__(self):
+ def __init__(self):
"populate the object with commands"
def add_cmds(module):
"helper method for populating this object with cmds"
- from evennia.utils import utils
+ from evennia.utils import utils
cmdlist = utils.variable_from_module(module, module.__all__)
self.__dict__.update(dict([(c.__name__, c) for c in cmdlist]))
- from .commands.default import (
+ from .commands.default import (
admin,
batchprocess,
building,
@@ -406,7 +406,7 @@
"""
- from .commands import cmdhandler
+ from .commands import cmdhandler
CMD_NOINPUT = cmdhandler.CMD_NOINPUT
CMD_NOMATCH = cmdhandler.CMD_NOMATCH
@@ -420,7 +420,7 @@
del _EvContainer
# typeclases
- from .utils.utils import class_from_module
+ from .utils.utils import class_from_module
BASE_ACCOUNT_TYPECLASS = class_from_module(settings.BASE_ACCOUNT_TYPECLASS)
BASE_OBJECT_TYPECLASS = class_from_module(settings.BASE_OBJECT_TYPECLASS)
@@ -435,7 +435,7 @@
# delayed starts - important so as to not back-access evennia before it has
# finished initializing
GLOBAL_SCRIPTS.start()
- from .prototypes import prototypes
+ from .prototypes import prototypes
prototypes.load_module_prototypes()
del prototypes
@@ -473,7 +473,7 @@
if debugger in ("auto", "pudb"):
try:
- from pudb import debugger
+ from pudb import debugger
dbg = debugger.Debugger(stdout=sys.__stdout__, term_size=term_size)
except ImportError:
@@ -500,7 +500,7 @@
__doc__ = DOCSTRING.format(
"\n- "
+ "\n- ".join(
- f"evennia.{key}"
+ f"evennia.{key}"
for key in sorted(globals())
if not key.startswith("_") and key not in ("DOCSTRING",)
)
diff --git a/docs/0.9.5/_modules/evennia/accounts/accounts.html b/docs/0.9.5/_modules/evennia/accounts/accounts.html
index 279ea53d74..c281c0a936 100644
--- a/docs/0.9.5/_modules/evennia/accounts/accounts.html
+++ b/docs/0.9.5/_modules/evennia/accounts/accounts.html
@@ -53,33 +53,33 @@
"""
import re
import time
-from django.conf import settings
-from django.contrib.auth import authenticate, password_validation
-from django.core.exceptions import ImproperlyConfigured, ValidationError
-from django.utils import timezone
-from django.utils.module_loading import import_string
-from evennia.typeclasses.models import TypeclassBase
-from evennia.accounts.manager import AccountManager
-from evennia.accounts.models import AccountDB
-from evennia.objects.models import ObjectDB
-from evennia.comms.models import ChannelDB
-from evennia.commands import cmdhandler
-from evennia.server.models import ServerConfig
-from evennia.server.throttle import Throttle
-from evennia.utils import class_from_module, create, logger
-from evennia.utils.utils import lazy_property, to_str, make_iter, is_iter, variable_from_module
-from evennia.server.signals import (
+from django.conf import settings
+from django.contrib.auth import authenticate, password_validation
+from django.core.exceptions import ImproperlyConfigured, ValidationError
+from django.utils import timezone
+from django.utils.module_loading import import_string
+from evennia.typeclasses.models import TypeclassBase
+from evennia.accounts.manager import AccountManager
+from evennia.accounts.models import AccountDB
+from evennia.objects.models import ObjectDB
+from evennia.comms.models import ChannelDB
+from evennia.commands import cmdhandler
+from evennia.server.models import ServerConfig
+from evennia.server.throttle import Throttle
+from evennia.utils import class_from_module, create, logger
+from evennia.utils.utils import lazy_property, to_str, make_iter, is_iter, variable_from_module
+from evennia.server.signals import (
SIGNAL_ACCOUNT_POST_CREATE,
SIGNAL_OBJECT_POST_PUPPET,
SIGNAL_OBJECT_POST_UNPUPPET,
)
-from evennia.typeclasses.attributes import NickHandler, ModelAttributeBackend
-from evennia.scripts.scripthandler import ScriptHandler
-from evennia.commands.cmdsethandler import CmdSetHandler
-from evennia.utils.optionhandler import OptionHandler
+from evennia.typeclasses.attributes import NickHandler, ModelAttributeBackend
+from evennia.scripts.scripthandler import ScriptHandler
+from evennia.commands.cmdsethandler import CmdSetHandler
+from evennia.utils.optionhandler import OptionHandler
-from django.utils.translation import gettext as _
-from random import getrandbits
+from django.utils.translation import gettext as _
+from random import getrandbits
__all__ = ("DefaultAccount", "DefaultGuest")
@@ -106,7 +106,7 @@
"""
- def __init__(self, account):
+ def __init__(self, account):
"""
Initializes the handler.
@@ -131,7 +131,7 @@
"""
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
if sessid:
return make_iter(_SESSIONS.session_from_account(self.account, sessid))
else:
@@ -289,7 +289,7 @@
"""
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
_SESSIONS.disconnect(session, reason)
# puppeting operations
@@ -329,13 +329,13 @@
# we may take over another of our sessions
# output messages to the affected sessions
if _MULTISESSION_MODE in (1, 3):
- txt1 = f"Sharing |c{obj.name}|n with another of your sessions."
- txt2 = f"|c{obj.name}|n|G is now shared from another of your sessions.|n"
+ txt1 = f"Sharing |c{obj.name}|n with another of your sessions."
+ txt2 = f"|c{obj.name}|n|G is now shared from another of your sessions.|n"
self.msg(txt1, session=session)
self.msg(txt2, session=obj.sessions.all())
else:
- txt1 = f"Taking over |c{obj.name}|n from another of your sessions."
- txt2 = f"|c{obj.name}|n|R is now acted from another of your sessions.|n"
+ txt1 = f"Taking over |c{obj.name}|n from another of your sessions."
+ txt2 = f"|c{obj.name}|n|R is now acted from another of your sessions.|n"
self.msg(_(txt1), session=session)
self.msg(_(txt2), session=obj.sessions.all())
self.unpuppet_object(obj.sessions.get())
@@ -414,7 +414,7 @@
puppet (Object): The matching puppeted object, if any.
"""
- return session.puppet
+ return session.puppet if session else None
[docs] def get_all_puppets(self):
"""
@@ -494,7 +494,7 @@
klass = import_string(validator["NAME"])
except ImportError:
msg = (
-
f"The module in NAME could not be imported: {validator['NAME']}. "
+
f"The module in NAME could not be imported: {validator['NAME']}. "
"Check your AUTH_USERNAME_VALIDATORS setting."
)
raise ImproperlyConfigured(msg)
@@ -554,7 +554,7 @@
"\nIf you feel this ban is in error, please email an admin.|x"
)
)
-
logger.log_sec(f"Authentication Denied (Banned): {username} (IP: {ip}).")
+
logger.log_sec(f"Authentication Denied (Banned): {username} (IP: {ip}).")
LOGIN_THROTTLE.update(ip, "Too many sightings of banned artifact.")
return None, errors
@@ -565,7 +565,7 @@
errors.append(_("Username and/or password is incorrect."))
# Log auth failures while throttle is inactive
-
logger.log_sec(f"Authentication Failure: {username} (IP: {ip}).")
+
logger.log_sec(f"Authentication Failure: {username} (IP: {ip}).")
# Update throttle
if ip:
@@ -581,7 +581,7 @@
return None, errors
# Account successfully authenticated
-
logger.log_sec(f"Authentication Success: {account} (IP: {ip}).")
+
logger.log_sec(f"Authentication Success: {account} (IP: {ip}).")
return account, errors
[docs] @classmethod
@@ -689,7 +689,7 @@
"""
super(DefaultAccount, self).set_password(password)
-
logger.log_sec(f"Password successfully changed for {self}.")
+
logger.log_sec(f"Password successfully changed for {self}.")
self.at_password_change()
[docs] def create_character(self, *args, **kwargs):
@@ -819,7 +819,7 @@
account = create.create_account(
username, email, password, permissions=permissions, typeclass=typeclass
)
-
logger.log_sec(f"Account Created: {account} (IP: {ip}).")
+
logger.log_sec(f"Account Created: {account} (IP: {ip}).")
except Exception as e:
errors.append(
@@ -842,7 +842,7 @@
# join the new account to the public channel
pchannel = ChannelDB.objects.get_channel(settings.DEFAULT_CHANNELS[0]["key"])
if not pchannel or not pchannel.connect(account):
-
string = f"New account '{account.key}' could not connect to public channel!"
+
string = f"New account '{account.key}' could not connect to public channel!"
errors.append(string)
logger.log_err(string)
@@ -1184,7 +1184,7 @@
updates = []
if not cdict.get("key"):
if not self.db_key:
-
self.db_key = f"#{self.dbid}"
+
self.db_key = f"#{self.dbid}"
updates.append("db_key")
elif self.key != cdict.get("key"):
updates.append("db_key")
@@ -1309,9 +1309,9 @@
now = timezone.now()
now = "%02i-%02i-%02i(%02i:%02i)" % (now.year, now.month, now.day, now.hour, now.minute)
if _MUDINFO_CHANNEL:
-
_MUDINFO_CHANNEL.tempmsg(f"[{_MUDINFO_CHANNEL.key}, {now}]: {message}")
+
_MUDINFO_CHANNEL.tempmsg(f"[{_MUDINFO_CHANNEL.key}, {now}]: {message}")
else:
-
logger.log_info(f"[{now}]: {message}")
+
logger.log_info(f"[{now}]: {message}")
[docs] def at_post_login(self, session=None, **kwargs):
"""
@@ -1389,7 +1389,7 @@
"""
-
reason = f" ({reason if reason else ''})"
+
reason = f" ({reason if reason else ''})"
self._send_to_connect_channel(
_("|R{key} disconnected{reason}|n").format(key=self.key, reason=reason)
)
@@ -1509,13 +1509,13 @@
is_su = self.is_superuser
# text shown when looking in the ooc area
-
result = [f"Account |g{self.key}|n (you are Out-of-Character)"]
+
result = [f"Account |g{self.key}|n (you are Out-of-Character)"]
nsess = len(sessions)
result.append(
nsess == 1
and "\n\n|wConnected session:|n"
-
or f"\n\n|wConnected sessions ({nsess}):|n"
+
or f"\n\n|wConnected sessions ({nsess}):|n"
)
for isess, sess in enumerate(sessions):
csessid = sess.sessid
@@ -1556,7 +1556,7 @@
result.append("\n |w@ic <character>|n - enter the game (|w@ooc|n to get back here)")
if is_su:
result.append(
-
f"\n\nAvailable character{string_s_ending} ({len(characters)}/unlimited):"
+
f"\n\nAvailable character{string_s_ending} ({len(characters)}/unlimited):"
)
else:
result.append(
@@ -1575,15 +1575,15 @@
sid = sess in sessions and sessions.index(sess) + 1
if sess and sid:
result.append(
-
f"\n - |G{char.key}|n [{', '.join(char.permissions.all())}] (played by you in session {sid})"
+
f"\n - |G{char.key}|n [{', '.join(char.permissions.all())}] (played by you in session {sid})"
)
else:
result.append(
-
f"\n - |R{char.key}|n [{', '.join(char.permissions.all())}] (played by someone else)"
+
f"\n - |R{char.key}|n [{', '.join(char.permissions.all())}] (played by someone else)"
)
else:
# character is "free to puppet"
-
result.append(f"\n - {char.key} [{', '.join(char.permissions.all())}]")
+
result.append(f"\n - {char.key} [{', '.join(char.permissions.all())}]")
look_string = ("-" * 68) + "\n" + "".join(result) + "\n" + ("-" * 68)
return look_string
diff --git a/docs/0.9.5/_modules/evennia/accounts/admin.html b/docs/0.9.5/_modules/evennia/accounts/admin.html
index e4fd6ee35d..1c140c4611 100644
--- a/docs/0.9.5/_modules/evennia/accounts/admin.html
+++ b/docs/0.9.5/_modules/evennia/accounts/admin.html
@@ -43,25 +43,25 @@
# This sets up how models are displayed
# in the web admin interface.
#
-from django import forms
-from django.conf import settings
-from django.contrib import admin, messages
-from django.contrib.admin.options import IS_POPUP_VAR
-from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
-from django.contrib.auth.forms import UserChangeForm, UserCreationForm
-from django.contrib.admin.utils import unquote
-from django.template.response import TemplateResponse
-from django.http import Http404, HttpResponseRedirect
-from django.core.exceptions import PermissionDenied
-from django.views.decorators.debug import sensitive_post_parameters
-from django.utils.decorators import method_decorator
-from django.utils.html import escape
-from django.urls import path, reverse
-from django.contrib.auth import update_session_auth_hash
+from django import forms
+from django.conf import settings
+from django.contrib import admin, messages
+from django.contrib.admin.options import IS_POPUP_VAR
+from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
+from django.contrib.auth.forms import UserChangeForm, UserCreationForm
+from django.contrib.admin.utils import unquote
+from django.template.response import TemplateResponse
+from django.http import Http404, HttpResponseRedirect
+from django.core.exceptions import PermissionDenied
+from django.views.decorators.debug import sensitive_post_parameters
+from django.utils.decorators import method_decorator
+from django.utils.html import escape
+from django.urls import path, reverse
+from django.contrib.auth import update_session_auth_hash
-from evennia.accounts.models import AccountDB
-from evennia.typeclasses.admin import AttributeInline, TagInline
-from evennia.utils import create
+from evennia.accounts.models import AccountDB
+from evennia.typeclasses.admin import AttributeInline, TagInline
+from evennia.utils import create
sensitive_post_parameters_m = method_decorator(sensitive_post_parameters())
@@ -397,8 +397,8 @@
obj.at_account_creation()
[docs] def response_add(self, request, obj, post_url_continue=None):
-
from django.http import HttpResponseRedirect
-
from django.urls import reverse
+
from django.http import HttpResponseRedirect
+
from django.urls import reverse
return HttpResponseRedirect(reverse("admin:accounts_accountdb_change", args=[obj.id]))
diff --git a/docs/0.9.5/_modules/evennia/accounts/bots.html b/docs/0.9.5/_modules/evennia/accounts/bots.html
index f32eb4e605..d2aec4f67c 100644
--- a/docs/0.9.5/_modules/evennia/accounts/bots.html
+++ b/docs/0.9.5/_modules/evennia/accounts/bots.html
@@ -46,12 +46,12 @@
"""
import time
-from django.conf import settings
-from evennia.accounts.accounts import DefaultAccount
-from evennia.scripts.scripts import DefaultScript
-from evennia.utils import search
-from evennia.utils import utils
-from django.utils.translation import gettext as _
+from django.conf import settings
+from evennia.accounts.accounts import DefaultAccount
+from evennia.scripts.scripts import DefaultScript
+from evennia.utils import search
+from evennia.utils import utils
+from django.utils.translation import gettext as _
_IDLE_TIMEOUT = settings.IDLE_TIMEOUT
@@ -104,7 +104,7 @@
"""
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
for session in _SESSIONS.sessions_from_account(self.account):
session.update_session_counters(idle=True)
@@ -229,7 +229,7 @@
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
# if keywords are given, store (the BotStarter script
# will not give any keywords, so this should normally only
@@ -242,7 +242,7 @@
# connect to Evennia channel
channel = search.channel_search(ev_channel)
if not channel:
- raise RuntimeError(f"Evennia Channel '{ev_channel}' not found.")
+ raise RuntimeError(f"Evennia Channel '{ev_channel}' not found.")
channel = channel[0]
channel.connect(self)
self.db.ev_channel = channel
@@ -367,7 +367,7 @@
if kwargs["type"] == "nicklist":
# the return of a nicklist request
if hasattr(self, "_nicklist_callers") and self._nicklist_callers:
- chstr = f"{self.db.irc_channel} ({self.db.irc_network}:{self.db.irc_port})"
+ chstr = f"{self.db.irc_channel} ({self.db.irc_network}:{self.db.irc_port})"
nicklist = ", ".join(sorted(kwargs["nicklist"], key=lambda n: n.lower()))
for obj in self._nicklist_callers:
obj.msg(
@@ -379,7 +379,7 @@
elif kwargs["type"] == "ping":
# the return of a ping
if hasattr(self, "_ping_callers") and self._ping_callers:
- chstr = f"{self.db.irc_channel} ({self.db.irc_network}:{self.db.irc_port})"
+ chstr = f"{self.db.irc_channel} ({self.db.irc_network}:{self.db.irc_port})"
for obj in self._ping_callers:
obj.msg(
_("IRC ping return from {chstr} took {time}s.").format(
@@ -397,7 +397,7 @@
# return server WHO list (abbreviated for IRC)
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
whos = []
t0 = time.time()
for sess in _SESSIONS.get_sessions():
@@ -412,10 +412,10 @@
utils.time_format(delta_cmd, 1),
)
)
- text = f"Who list (online/idle): {', '.join(sorted(whos, key=lambda w: w.lower()))}"
+ text = f"Who list (online/idle): {', '.join(sorted(whos, key=lambda w: w.lower()))}"
elif txt.lower().startswith("about"):
# some bot info
- text = f"This is an Evennia IRC bot connecting from '{settings.SERVERNAME}'."
+ text = f"This is an Evennia IRC bot connecting from '{settings.SERVERNAME}'."
else:
text = "I understand 'who' and 'about'."
super().msg(privmsg=((text,), {"user": user}))
@@ -423,10 +423,10 @@
# something to send to the main channel
if kwargs["type"] == "action":
# An action (irc pose)
- text = f"{kwargs['user']}@{kwargs['channel']} {txt}"
+ text = f"{kwargs['user']}@{kwargs['channel']} {txt}"
else:
# msg - A normal channel message
- text = f"{kwargs['user']}@{kwargs['channel']}: {txt}"
+ text = f"{kwargs['user']}@{kwargs['channel']}: {txt}"
if not self.ndb.ev_channel and self.db.ev_channel:
# cache channel lookup
@@ -467,13 +467,13 @@
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
if ev_channel:
# connect to Evennia channel
channel = search.channel_search(ev_channel)
if not channel:
- raise RuntimeError(f"Evennia Channel '{ev_channel}' not found.")
+ raise RuntimeError(f"Evennia Channel '{ev_channel}' not found.")
channel = channel[0]
self.db.ev_channel = channel
if rss_url:
@@ -528,14 +528,14 @@
global _SESSIONS
if not _SESSIONS:
- from evennia.server.sessionhandler import SESSIONS as _SESSIONS
+ from evennia.server.sessionhandler import SESSIONS as _SESSIONS
# connect to Evennia channel
if ev_channel:
# connect to Evennia channel
channel = search.channel_search(ev_channel)
if not channel:
- raise RuntimeError(f"Evennia Channel '{ev_channel}' not found.")
+ raise RuntimeError(f"Evennia Channel '{ev_channel}' not found.")
channel = channel[0]
channel.connect(self)
self.db.ev_channel = channel
@@ -611,7 +611,7 @@
if event == "channels/broadcast":
# A private message to the bot - a command.
- text = f"{sender}@{game}: {txt}"
+ text = f"{sender}@{game}: {txt}"
if not self.ndb.ev_channel and self.db.ev_channel:
# simple cache of channel lookup
diff --git a/docs/0.9.5/_modules/evennia/accounts/manager.html b/docs/0.9.5/_modules/evennia/accounts/manager.html
index e1133e5016..e22154ce73 100644
--- a/docs/0.9.5/_modules/evennia/accounts/manager.html
+++ b/docs/0.9.5/_modules/evennia/accounts/manager.html
@@ -44,9 +44,9 @@
"""
import datetime
-from django.utils import timezone
-from django.contrib.auth.models import UserManager
-from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
+from django.utils import timezone
+from django.contrib.auth.models import UserManager
+from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
__all__ = ("AccountManager",)
@@ -206,7 +206,7 @@
if typeclass:
# we accept both strings and actual typeclasses
if callable(typeclass):
- typeclass = f"{typeclass.__module__}.{typeclass.__name__}"
+ typeclass = f"{typeclass.__module__}.{typeclass.__name__}"
else:
typeclass = str(typeclass)
query["db_typeclass_path"] = typeclass
diff --git a/docs/0.9.5/_modules/evennia/accounts/models.html b/docs/0.9.5/_modules/evennia/accounts/models.html
index 1ca7222b9f..7c76c14f79 100644
--- a/docs/0.9.5/_modules/evennia/accounts/models.html
+++ b/docs/0.9.5/_modules/evennia/accounts/models.html
@@ -56,15 +56,15 @@
account info and OOC account configuration variables etc.
"""
-from django.conf import settings
-from django.db import models
-from django.contrib.auth.models import AbstractUser
-from django.utils.encoding import smart_str
+from django.conf import settings
+from django.db import models
+from django.contrib.auth.models import AbstractUser
+from django.utils.encoding import smart_str
-from evennia.accounts.manager import AccountDBManager
-from evennia.typeclasses.models import TypedObject
-from evennia.utils.utils import make_iter
-from evennia.server.signals import SIGNAL_ACCOUNT_POST_RENAME
+from evennia.accounts.manager import AccountDBManager
+from evennia.typeclasses.models import TypedObject
+from evennia.utils.utils import make_iter
+from evennia.server.signals import SIGNAL_ACCOUNT_POST_RENAME
__all__ = ("AccountDB",)
@@ -185,11 +185,11 @@
# property/field access
#
- def __str__(self):
- return smart_str(f"{self.name}(account {self.dbid})")
+ def __str__(self):
+ return smart_str(f"{self.name}(account {self.dbid})")
- def __repr__(self):
- return f"{self.name}(account#{self.dbid})"
+ def __repr__(self):
+ return f"{self.name}(account#{self.dbid})"
# @property
def __username_get(self):
diff --git a/docs/0.9.5/_modules/evennia/commands/cmdhandler.html b/docs/0.9.5/_modules/evennia/commands/cmdhandler.html
index 22bf08171e..81743e249b 100644
--- a/docs/0.9.5/_modules/evennia/commands/cmdhandler.html
+++ b/docs/0.9.5/_modules/evennia/commands/cmdhandler.html
@@ -74,22 +74,22 @@
13. Return deferred that will fire with the return from `cmdobj.func()` (unused by default).
"""
-from collections import defaultdict
-from weakref import WeakValueDictionary
-from traceback import format_exc
-from itertools import chain
-from copy import copy
+from collections import defaultdict
+from weakref import WeakValueDictionary
+from traceback import format_exc
+from itertools import chain
+from copy import copy
import types
-from twisted.internet import reactor
-from twisted.internet.task import deferLater
-from twisted.internet.defer import inlineCallbacks, returnValue
-from django.conf import settings
-from evennia.commands.command import InterruptCommand
-from evennia.comms.channelhandler import CHANNELHANDLER
-from evennia.utils import logger, utils
-from evennia.utils.utils import string_suggestions
+from twisted.internet import reactor
+from twisted.internet.task import deferLater
+from twisted.internet.defer import inlineCallbacks, returnValue
+from django.conf import settings
+from evennia.commands.command import InterruptCommand
+from evennia.comms.channelhandler import CHANNELHANDLER
+from evennia.utils import logger, utils
+from evennia.utils.utils import string_suggestions
-from django.utils.translation import gettext as _
+from django.utils.translation import gettext as _
_IN_GAME_ERRORS = settings.IN_GAME_ERRORS
@@ -260,7 +260,7 @@
"""
global _GET_INPUT
if not _GET_INPUT:
- from evennia.utils.evmenu import get_input as _GET_INPUT
+ from evennia.utils.evmenu import get_input as _GET_INPUT
try:
if response is None:
@@ -297,7 +297,7 @@
class ExecSystemCommand(Exception):
"Run a system command"
- def __init__(self, syscmd, sysarg):
+ def __init__(self, syscmd, sysarg):
self.args = (syscmd, sysarg) # needed by exception error handling
self.syscmd = syscmd
self.sysarg = sysarg
@@ -306,7 +306,7 @@
class ErrorReported(Exception):
"Re-raised when a subsructure already reported the error"
- def __init__(self, raw_string):
+ def __init__(self, raw_string):
self.args = (raw_string,)
self.raw_string = raw_string
diff --git a/docs/0.9.5/_modules/evennia/commands/cmdparser.html b/docs/0.9.5/_modules/evennia/commands/cmdparser.html
index 7564c6a6ce..9dea37b23f 100644
--- a/docs/0.9.5/_modules/evennia/commands/cmdparser.html
+++ b/docs/0.9.5/_modules/evennia/commands/cmdparser.html
@@ -49,8 +49,8 @@
import re
-from django.conf import settings
-from evennia.utils.logger import log_trace
+from django.conf import settings
+from evennia.utils.logger import log_trace
_MULTIMATCH_REGEX = re.compile(settings.SEARCH_MULTIMATCH_REGEX, re.I + re.U)
_CMD_IGNORE_PREFIXES = settings.CMD_IGNORE_PREFIXES
diff --git a/docs/0.9.5/_modules/evennia/commands/cmdset.html b/docs/0.9.5/_modules/evennia/commands/cmdset.html
index 881effa1db..c15a9369c4 100644
--- a/docs/0.9.5/_modules/evennia/commands/cmdset.html
+++ b/docs/0.9.5/_modules/evennia/commands/cmdset.html
@@ -67,9 +67,9 @@
to affect the low-priority cmdset. Ex: A1,A3 + B1,B2,B4,B5 = B2,B4,B5
"""
-from weakref import WeakKeyDictionary
-from django.utils.translation import gettext as _
-from evennia.utils.utils import inherits_from, is_iter
+from weakref import WeakKeyDictionary
+from django.utils.translation import gettext as _
+from evennia.utils.utils import inherits_from, is_iter
__all__ = ("CmdSet",)
@@ -81,7 +81,7 @@
"""
- def __init__(cls, *args, **kwargs):
+ def __init__(cls, *args, **kwargs):
"""
Fixes some things in the cmdclass
@@ -235,7 +235,7 @@
"errmessage",
)
-[docs] def __init__(self, cmdsetobj=None, key=None):
+
[docs] def __init__(self, cmdsetobj=None, key=None):
"""
Creates a new CmdSet instance.
@@ -390,7 +390,7 @@
cmdset.key_mergetypes = self.key_mergetypes.copy()
return cmdset
-
def __str__(self):
+
def __str__(self):
"""
Show all commands in cmdset when printing it.
@@ -405,10 +405,10 @@
if getattr(self, opt) is not None
])
options = (", " + options) if options else ""
-
return f"<CmdSet {self.key}, {self.mergetype}, {perm}, prio {self.priority}{options}>: " + ", ".join(
+
return f"<CmdSet {self.key}, {self.mergetype}, {perm}, prio {self.priority}{options}>: " + ", ".join(
[str(cmd) for cmd in sorted(self.commands, key=lambda o: o.key)])
-
def __iter__(self):
+
def __iter__(self):
"""
Allows for things like 'for cmd in cmdset':
@@ -418,7 +418,7 @@
"""
return iter(self.commands)
-
def __contains__(self, othercmd):
+
def __contains__(self, othercmd):
"""
Returns True if this cmdset contains the given command (as
defined by command name and aliases). This allows for things
@@ -431,7 +431,7 @@
self._contains_cache[othercmd] = ret
return ret
-
def __add__(self, cmdset_a):
+
def __add__(self, cmdset_a):
"""
Merge this cmdset (B) with another cmdset (A) using the + operator,
diff --git a/docs/0.9.5/_modules/evennia/commands/cmdsethandler.html b/docs/0.9.5/_modules/evennia/commands/cmdsethandler.html
index 00e1540c03..0bbf73953f 100644
--- a/docs/0.9.5/_modules/evennia/commands/cmdsethandler.html
+++ b/docs/0.9.5/_modules/evennia/commands/cmdsethandler.html
@@ -105,15 +105,15 @@
the 'Fishing' set. Fishing from a boat? No problem!
"""
import sys
-
from traceback import format_exc
-
from importlib import import_module
-
from inspect import trace
-
from django.conf import settings
-
from evennia.utils import logger, utils
-
from evennia.commands.cmdset import CmdSet
-
from evennia.server.models import ServerConfig
+
from traceback import format_exc
+
from importlib import import_module
+
from inspect import trace
+
from django.conf import settings
+
from evennia.utils import logger, utils
+
from evennia.commands.cmdset import CmdSet
+
from evennia.server.models import ServerConfig
-
from django.utils.translation import gettext as _
+
from django.utils.translation import gettext as _
__all__ = ("import_cmdset", "CmdSetHandler")
@@ -319,7 +319,7 @@
will re-calculate the 'current' cmdset.
"""
-
[docs] def __init__(self, obj, init_true=True):
+
[docs] def __init__(self, obj, init_true=True):
"""
This method is called whenever an object is recreated.
@@ -350,7 +350,7 @@
if init_true:
self.update(init_mode=True) # is then called from the object __init__.
-
def __str__(self):
+
def __str__(self):
"""
Display current commands
"""
@@ -361,7 +361,7 @@
# We have more than one cmdset in stack; list them all
for snum, cmdset in enumerate(self.cmdset_stack):
mergelist.append(str(snum + 1))
-
strings.append(f" {snum + 1}: {cmdset}")
+
strings.append(f" {snum + 1}: {cmdset}")
# Display the currently active cmdset, limited by self.obj's permissions
mergetype = self.mergetype_stack[-1]
@@ -373,7 +373,7 @@
if mergelist:
# current is a result of mergers
mergelist="+".join(mergelist)
-
strings.append(f" <Merged {mergelist}>: {self.current}")
+
strings.append(f" <Merged {mergelist}>: {self.current}")
else:
# current is a single cmdset
strings.append(" " + str(self.current))
diff --git a/docs/0.9.5/_modules/evennia/commands/command.html b/docs/0.9.5/_modules/evennia/commands/command.html
index 03dd047568..8808bd578c 100644
--- a/docs/0.9.5/_modules/evennia/commands/command.html
+++ b/docs/0.9.5/_modules/evennia/commands/command.html
@@ -49,12 +49,12 @@
import math
import inspect
-
from django.conf import settings
+
from django.conf import settings
-
from evennia.locks.lockhandler import LockHandler
-
from evennia.utils.utils import is_iter, fill, lazy_property, make_iter
-
from evennia.utils.evtable import EvTable
-
from evennia.utils.ansi import ANSIString
+
from evennia.locks.lockhandler import LockHandler
+
from evennia.utils.utils import is_iter, fill, lazy_property, make_iter
+
from evennia.utils.evtable import EvTable
+
from evennia.utils.ansi import ANSIString
def _init_command(cls, **kwargs):
@@ -140,7 +140,7 @@
The metaclass cleans up all properties on the class
"""
-
@@ -225,7 +225,7 @@
# session - which session is responsible for triggering this command. Only set
# if triggered by an account.
-
[docs] def __init__(self, **kwargs):
+
[docs] def __init__(self, **kwargs):
"""
The lockhandler works the same as for objects.
optional kwargs will be set as properties on the Command at runtime,
@@ -239,13 +239,13 @@
def lockhandler(self):
return LockHandler(self)
-
def __str__(self):
+
def __str__(self):
"""
Print the command key
"""
return self.key
-
def __eq__(self, cmd):
+
def __eq__(self, cmd):
"""
Compare two command instances to each other by matching their
key and aliases.
@@ -265,7 +265,7 @@
# probably got a string
return cmd in self._matchset
-
def __hash__(self):
+
def __hash__(self):
"""
Python 3 requires that any class which implements __eq__ must also
implement __hash__ and that the corresponding hashes for equivalent
@@ -278,7 +278,7 @@
"""
return hash("\n".join(self._matchset))
-
def __ne__(self, cmd):
+
def __ne__(self, cmd):
"""
The logical negation of __eq__. Since this is one of the most
called methods in Evennia (along with __eq__) we do some
@@ -290,7 +290,7 @@
except AttributeError:
return cmd not in self._matchset
-
def __contains__(self, query):
+
def __contains__(self, query):
"""
This implements searches like 'if query in cmd'. It's a fuzzy
matching used by the help system, returning True if query can
@@ -472,9 +472,9 @@
variables = "\n".join(
" |w{}|n ({}): {}".format(key, type(val), val) for key, val in self.__dict__.items()
)
-
string = f"""
-
Command {self} has no defined `func()` - showing on-command variables:
-
{variables}
+
string = f"""
+
Command {self} has no defined `func()` - showing on-command variables:
+
{variables}
"""
# a simple test command to show the available properties
string += "-" * 50
@@ -581,21 +581,21 @@
colornames = ["|%s%s|n" % (column_color, col) for col in args]
h_line_char = kwargs.pop("header_line_char", "~")
-
header_line_char = ANSIString(f"|{border_color}{h_line_char}|n")
+
header_line_char = ANSIString(f"|{border_color}{h_line_char}|n")
c_char = kwargs.pop("corner_char", "+")
-
corner_char = ANSIString(f"|{border_color}{c_char}|n")
+
corner_char = ANSIString(f"|{border_color}{c_char}|n")
b_left_char = kwargs.pop("border_left_char", "||")
-
border_left_char = ANSIString(f"|{border_color}{b_left_char}|n")
+
border_left_char = ANSIString(f"|{border_color}{b_left_char}|n")
b_right_char = kwargs.pop("border_right_char", "||")
-
border_right_char = ANSIString(f"|{border_color}{b_right_char}|n")
+
border_right_char = ANSIString(f"|{border_color}{b_right_char}|n")
b_bottom_char = kwargs.pop("border_bottom_char", "-")
-
border_bottom_char = ANSIString(f"|{border_color}{b_bottom_char}|n")
+
border_bottom_char = ANSIString(f"|{border_color}{b_bottom_char}|n")
b_top_char = kwargs.pop("border_top_char", "-")
-
border_top_char = ANSIString(f"|{border_color}{b_top_char}|n")
+
border_top_char = ANSIString(f"|{border_color}{b_top_char}|n")
table = EvTable(
*colornames,
diff --git a/docs/0.9.5/_modules/evennia/commands/default/account.html b/docs/0.9.5/_modules/evennia/commands/default/account.html
index 737c97cc0f..03a3904fc5 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/account.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/account.html
@@ -60,10 +60,10 @@
"""
import time
-
from codecs import lookup as codecs_lookup
-
from django.conf import settings
-
from evennia.server.sessionhandler import SESSIONS
-
from evennia.utils import utils, create, logger, search
+
from codecs import lookup as codecs_lookup
+
from django.conf import settings
+
from evennia.server.sessionhandler import SESSIONS
+
from evennia.utils import utils, create, logger, search
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
@@ -196,9 +196,9 @@
account.db._playable_characters and len(account.db._playable_characters) >= charmax
):
plural = "" if charmax == 1 else "s"
-
self.msg(f"You may only create a maximum of {charmax} character{plural}.")
+
self.msg(f"You may only create a maximum of {charmax} character{plural}.")
return
-
from evennia.objects.models import ObjectDB
+
from evennia.objects.models import ObjectDB
typeclass = settings.BASE_CHARACTER_TYPECLASS
@@ -273,7 +273,7 @@
)
return
else: # one match
-
from evennia.utils.evmenu import get_input
+
from evennia.utils.evmenu import get_input
def _callback(caller, callback_prompt, result):
if result.lower() == "yes":
@@ -910,7 +910,7 @@
if self.args.startswith("a"):
# show ansi 16-color table
-
from evennia.utils import ansi
+
from evennia.utils import ansi
ap = ansi.ANSI_PARSER
# ansi colors
@@ -1040,7 +1040,7 @@
self.msg("Already quelling Account %s permissions." % permstr)
return
account.attributes.add("_quell", True)
-
puppet = self.session.puppet
+
puppet = self.session.puppet if self.session else None
if puppet:
cpermstr = "(%s)" % ", ".join(puppet.permissions.all())
cpermstr = "Quelling to current puppet's permissions %s." % cpermstr
diff --git a/docs/0.9.5/_modules/evennia/commands/default/admin.html b/docs/0.9.5/_modules/evennia/commands/default/admin.html
index 0715e1a2c1..22e91d046c 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/admin.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/admin.html
@@ -47,10 +47,10 @@
import time
import re
-
from django.conf import settings
-
from evennia.server.sessionhandler import SESSIONS
-
from evennia.server.models import ServerConfig
-
from evennia.utils import evtable, logger, search, class_from_module
+
from django.conf import settings
+
from evennia.server.sessionhandler import SESSIONS
+
from evennia.server.models import ServerConfig
+
from evennia.utils import evtable, logger, search, class_from_module
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
diff --git a/docs/0.9.5/_modules/evennia/commands/default/batchprocess.html b/docs/0.9.5/_modules/evennia/commands/default/batchprocess.html
index 45eac5c915..72a06c0a6e 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/batchprocess.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/batchprocess.html
@@ -60,10 +60,10 @@
"""
import re
-
from django.conf import settings
-
from evennia.utils.batchprocessors import BATCHCMD, BATCHCODE
-
from evennia.commands.cmdset import CmdSet
-
from evennia.utils import logger, utils
+
from django.conf import settings
+
from evennia.utils.batchprocessors import BATCHCMD, BATCHCODE
+
from evennia.commands.cmdset import CmdSet
+
from evennia.utils import logger, utils
_RE_COMMENT = re.compile(r"^#.*?$", re.MULTILINE + re.DOTALL)
diff --git a/docs/0.9.5/_modules/evennia/commands/default/building.html b/docs/0.9.5/_modules/evennia/commands/default/building.html
index 9e08820f77..d9e132ed2b 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/building.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/building.html
@@ -43,13 +43,13 @@
Building and world design commands
"""
import re
-
from django.conf import settings
-
from django.db.models import Q, Min, Max
-
from evennia.objects.models import ObjectDB
-
from evennia.locks.lockhandler import LockException
-
from evennia.commands.cmdhandler import get_and_merge_cmdsets
-
from evennia.utils import create, utils, search, logger
-
from evennia.utils.utils import (
+
from django.conf import settings
+
from django.db.models import Q, Min, Max
+
from evennia.objects.models import ObjectDB
+
from evennia.locks.lockhandler import LockException
+
from evennia.commands.cmdhandler import get_and_merge_cmdsets
+
from evennia.utils import create, utils, search, logger
+
from evennia.utils.utils import (
inherits_from,
class_from_module,
get_all_typeclasses,
@@ -59,11 +59,11 @@
list_to_string,
display_len,
)
-
from evennia.utils.eveditor import EvEditor
-
from evennia.utils.evmore import EvMore
-
from evennia.prototypes import spawner, prototypes as protlib, menus as olc_menus
-
from evennia.utils.ansi import raw as ansi_raw
-
from evennia.utils.inlinefuncs import raw as inlinefunc_raw
+
from evennia.utils.eveditor import EvEditor
+
from evennia.utils.evmore import EvMore
+
from evennia.prototypes import spawner, prototypes as protlib, menus as olc_menus
+
from evennia.utils.ansi import raw as ansi_raw
+
from evennia.utils.inlinefuncs import raw as inlinefunc_raw
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
@@ -98,7 +98,7 @@
)
# used by set
-
from ast import literal_eval as _LITERAL_EVAL
+
from ast import literal_eval as _LITERAL_EVAL
LIST_APPEND_CHAR = "+"
@@ -1861,7 +1861,7 @@
Returns:
A typeclassed object, or None if nothing is found.
"""
-
from evennia.utils.utils import variable_from_module
+
from evennia.utils.utils import variable_from_module
_AT_SEARCH_RESULT = variable_from_module(*settings.SEARCH_AT_RESULT.rsplit(".", 1))
caller = self.caller
@@ -2428,9 +2428,9 @@
value = utils.crop(value)
value = inlinefunc_raw(ansi_raw(value))
if category:
-
return f"{attr}[{category}] = {value}"
+
return f"{attr}[{category}] = {value}"
else:
-
return f"{attr} = {value}"
+
return f"{attr} = {value}"
+
mainstr = "\n".join(f"{hclr}{header}|n: {block}" for (header, block) in output.items())
+
return f"{sep}\n{mainstr}\n{sep}"
[docs] def func(self):
"""Process command"""
@@ -2747,7 +2747,7 @@
for attrname in obj_attrs:
# we are only interested in specific attributes
ret = "\n".join(
-
f"{self.header_color}{header}|n:{value}"
+
f"{self.header_color}{header}|n:{value}"
for header, value in self.format_attributes(
obj, attrname, crop=False
).items()
@@ -2826,7 +2826,7 @@
low, high = sorted(qs.values())
if not (low and high):
raise ValueError(
-
f"{self.__class__.__name__}: Min and max ID not returned by aggregation; falling back to queryset slicing."
+
f"{self.__class__.__name__}: Min and max ID not returned by aggregation; falling back to queryset slicing."
)
except Exception as e:
logger.log_trace(e)
@@ -2855,7 +2855,7 @@
return
except IndexError as e:
logger.log_err(
-
f"{self.__class__.__name__}: Error parsing upper and lower bounds of query."
+
f"{self.__class__.__name__}: Error parsing upper and lower bounds of query."
)
logger.log_trace(e)
@@ -2954,24 +2954,24 @@
# still results after type filtering?
if nresults:
if nresults > 1:
-
header = f"{nresults} Matches"
+
header = f"{nresults} Matches"
else:
header = "One Match"
-
string = f"|w{header}|n(#{low}-#{high}{restrictions}):"
+
string = f"|w{header}|n(#{low}-#{high}{restrictions}):"
res = None
for res in results:
-
string += f"\n |g{res.get_display_name(caller)} - {res.path}|n"
+
string += f"\n |g{res.get_display_name(caller)} - {res.path}|n"
if (
"loc" in self.switches
and nresults == 1
and res
and getattr(res, "location", None)
):
-
string += f" (|wlocation|n: |g{res.location.get_display_name(caller)}|n)"
+
string += f" (|wlocation|n: |g{res.location.get_display_name(caller)}|n)"
else:
-
string = f"|wNo Matches|n(#{low}-#{high}{restrictions}):"
-
string += f"\n |RNo matches found for '{searchstring}'|n"
+
string = f"|wNo Matches|n(#{low}-#{high}{restrictions}):"
+
string += f"\n |RNo matches found for '{searchstring}'|n"
# send result
caller.msg(string.strip())
@@ -3147,7 +3147,7 @@
result.append("No scripts defined on %s." % obj.get_display_name(caller))
elif not self.switches:
# view all scripts
- from evennia.commands.default.system import ScriptEvMore
+ from evennia.commands.default.system import ScriptEvMore
ScriptEvMore(self.caller, scripts.order_by("id"), session=self.session)
return
@@ -3447,7 +3447,7 @@
# handle the search result
err = None
if not prototypes:
- err = f"No prototype named '{prototype_key}' was found."
+ err = f"No prototype named '{prototype_key}' was found."
elif nprots > 1:
err = "Found {} prototypes matching '{}':\n {}".format(
nprots,
@@ -3496,7 +3496,7 @@
if not isinstance(prototype, expect):
if eval_err:
string = (
- f"{inp}\n{eval_err}\n|RCritical Python syntax error in argument. Only primitive "
+ f"{inp}\n{eval_err}\n|RCritical Python syntax error in argument. Only primitive "
"Python structures are allowed. \nMake sure to use correct "
"Python syntax. Remember especially to put quotes around all "
"strings inside lists and dicts.|n For more advanced uses, embed "
@@ -3547,7 +3547,7 @@
if prototypes:
return "\n".join(protlib.prototype_to_str(prot) for prot in prototypes)
elif query:
- self.caller.msg(f"No prototype named '{query}' was found.")
+ self.caller.msg(f"No prototype named '{query}' was found.")
else:
self.caller.msg("No prototypes found.")
@@ -3584,8 +3584,8 @@
n_existing = len(existing_objects)
slow = " (note that this may be slow)" if n_existing > 10 else ""
string = (
- f"There are {n_existing} existing object(s) with an older version "
- f"of prototype '{prototype_key}'. Should it be re-applied to them{slow}? [Y]/N"
+ f"There are {n_existing} existing object(s) with an older version "
+ f"of prototype '{prototype_key}'. Should it be re-applied to them{slow}? [Y]/N"
)
answer = yield (string)
if answer.lower() in ["n", "no"]:
@@ -3600,7 +3600,7 @@
)
except Exception:
logger.log_trace()
- caller.msg(f"{n_updated} objects were updated.")
+ caller.msg(f"{n_updated} objects were updated.")
return
def _parse_key_desc_tags(self, argstring, desc=True):
@@ -3749,20 +3749,20 @@
if old_prototype:
if not diffstr:
- string = f"|yAlready existing Prototype:|n\n{new_prototype_detail}\n"
+ string = f"|yAlready existing Prototype:|n\n{new_prototype_detail}\n"
question = (
"\nThere seems to be no changes. Do you still want to (re)save? [Y]/N"
)
else:
string = (
- f'|yExisting prototype "{prototype_key}" found. Change:|n\n{diffstr}\n'
- f"|yNew changed prototype:|n\n{new_prototype_detail}"
+ f'|yExisting prototype "{prototype_key}" found. Change:|n\n{diffstr}\n'
+ f"|yNew changed prototype:|n\n{new_prototype_detail}"
)
question = (
"\n|yDo you want to apply the change to the existing prototype?|n [Y]/N"
)
else:
- string = f"|yCreating new prototype:|n\n{new_prototype_detail}"
+ string = f"|yCreating new prototype:|n\n{new_prototype_detail}"
question = "\nDo you want to continue saving? [Y]/N"
answer = yield (string + question)
@@ -3791,7 +3791,7 @@
ncount = len(protlib.search_prototype())
caller.msg(
"Usage: spawn <prototype-key> or {{key: value, ...}}"
- f"\n ({ncount} existing prototypes. Use /list to inspect)"
+ f"\n ({ncount} existing prototypes. Use /list to inspect)"
)
return
@@ -3801,7 +3801,7 @@
if not prototype_detail:
return
- string = f"|rDeleting prototype:|n\n{prototype_detail}"
+ string = f"|rDeleting prototype:|n\n{prototype_detail}"
question = "\nDo you want to continue deleting? [Y]/N"
answer = yield (string + question)
if answer.lower() in ["n", "no"]:
@@ -3811,7 +3811,7 @@
try:
success = protlib.delete_prototype(self.args)
except protlib.PermissionError as err:
- retmsg = f"|rError deleting:|R {err}|n"
+ retmsg = f"|rError deleting:|R {err}|n"
else:
retmsg = (
"Deletion successful"
diff --git a/docs/0.9.5/_modules/evennia/commands/default/cmdset_account.html b/docs/0.9.5/_modules/evennia/commands/default/cmdset_account.html
index 26d8bad40b..d930757d48 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/cmdset_account.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/cmdset_account.html
@@ -50,9 +50,9 @@
command method rather than caller.msg().
"""
-from evennia.commands.cmdset import CmdSet
-from evennia.commands.default import help, comms, admin, system
-from evennia.commands.default import building, account, general
+from evennia.commands.cmdset import CmdSet
+from evennia.commands.default import help, comms, admin, system
+from evennia.commands.default import building, account, general
[docs]class AccountCmdSet(CmdSet):
diff --git a/docs/0.9.5/_modules/evennia/commands/default/cmdset_character.html b/docs/0.9.5/_modules/evennia/commands/default/cmdset_character.html
index f4c6e398ad..1bcb95195e 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/cmdset_character.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/cmdset_character.html
@@ -45,10 +45,10 @@
communication-commands are instead put on the account level, in the
Account cmdset. Account commands remain available also to Characters.
"""
-
from evennia.commands.cmdset import CmdSet
-
from evennia.commands.default import general, help, admin, system
-
from evennia.commands.default import building
-
from evennia.commands.default import batchprocess
+
from evennia.commands.cmdset import CmdSet
+
from evennia.commands.default import general, help, admin, system
+
from evennia.commands.default import building
+
from evennia.commands.default import batchprocess
[docs]class CharacterCmdSet(CmdSet):
diff --git a/docs/0.9.5/_modules/evennia/commands/default/cmdset_session.html b/docs/0.9.5/_modules/evennia/commands/default/cmdset_session.html
index 5e19e4caaf..4f142ba409 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/cmdset_session.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/cmdset_session.html
@@ -42,8 +42,8 @@
"""
This module stores session-level commands.
"""
-
from evennia.commands.cmdset import CmdSet
-
from evennia.commands.default import account
+
from evennia.commands.cmdset import CmdSet
+
from evennia.commands.default import account
[docs]class SessionCmdSet(CmdSet):
diff --git a/docs/0.9.5/_modules/evennia/commands/default/cmdset_unloggedin.html b/docs/0.9.5/_modules/evennia/commands/default/cmdset_unloggedin.html
index 8c71c13676..5daac68589 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/cmdset_unloggedin.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/cmdset_unloggedin.html
@@ -44,8 +44,8 @@
The setting STATE_UNLOGGED should be set to the python path
of the state instance in this module.
"""
-
from evennia.commands.cmdset import CmdSet
-
from evennia.commands.default import unloggedin
+
from evennia.commands.cmdset import CmdSet
+
from evennia.commands.default import unloggedin
[docs]class UnloggedinCmdSet(CmdSet):
diff --git a/docs/0.9.5/_modules/evennia/commands/default/comms.html b/docs/0.9.5/_modules/evennia/commands/default/comms.html
index 3ef4db24aa..3f2f46c7fb 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/comms.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/comms.html
@@ -50,14 +50,14 @@
"""
import hashlib
import time
-
from django.conf import settings
-
from evennia.comms.models import ChannelDB, Msg
-
from evennia.accounts.models import AccountDB
-
from evennia.accounts import bots
-
from evennia.comms.channelhandler import CHANNELHANDLER
-
from evennia.locks.lockhandler import LockException
-
from evennia.utils import create, logger, utils, evtable
-
from evennia.utils.utils import make_iter, class_from_module
+
from django.conf import settings
+
from evennia.comms.models import ChannelDB, Msg
+
from evennia.accounts.models import AccountDB
+
from evennia.accounts import bots
+
from evennia.comms.channelhandler import CHANNELHANDLER
+
from evennia.locks.lockhandler import LockException
+
from evennia.utils import create, logger, utils, evtable
+
from evennia.utils.utils import make_iter, class_from_module
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
CHANNEL_DEFAULT_TYPECLASS = class_from_module(settings.BASE_CHANNEL_TYPECLASS)
@@ -870,16 +870,16 @@
clr = "|c" if sending else "|g"
-
sender = f"|n,{clr}".join(obj.key for obj in page.senders)
-
receiver = f"|n,{clr}".join([obj.name for obj in page.receivers])
+
sender = f"|n,{clr}".join(obj.key for obj in page.senders)
+
receiver = f"|n,{clr}".join([obj.name for obj in page.receivers])
if sending:
template = to_template
-
sender = f"{sender} " if multi_send else ""
-
receiver = f" {receiver}" if multi_recv else f" {receiver}"
+
sender = f"{sender} " if multi_send else ""
+
receiver = f" {receiver}" if multi_recv else f" {receiver}"
else:
template = from_template
-
receiver = f"{receiver} " if multi_recv else ""
-
sender = f" {sender} " if multi_send else f" {sender}"
+
receiver = f"{receiver} " if multi_recv else ""
+
sender = f" {sender} " if multi_send else f" {sender}"
listing.append(
template.format(
@@ -1395,7 +1395,7 @@
bot = create.create_account(botname, None, None, typeclass=bots.GrapevineBot)
bot.start(ev_channel=channel, grapevine_channel=grapevine_channel)
-
self.msg(f"Grapevine connection created {channel} <-> {grapevine_channel}.")
+
self.msg(f"Grapevine connection created {channel} <-> {grapevine_channel}.")
diff --git a/docs/0.9.5/_modules/evennia/commands/default/general.html b/docs/0.9.5/_modules/evennia/commands/default/general.html
index 96a3e62fa3..709fadace9 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/general.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/general.html
@@ -43,9 +43,9 @@
General Character commands usually available to all characters
"""
import re
-from django.conf import settings
-from evennia.utils import utils, evtable
-from evennia.typeclasses.attributes import NickTemplateInvalid
+from django.conf import settings
+from evennia.utils import utils, evtable
+from evennia.typeclasses.attributes import NickTemplateInvalid
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
@@ -419,12 +419,12 @@
if not items:
string = "You are not carrying anything."
else:
- from evennia.utils.ansi import raw as raw_ansi
+ from evennia.utils.ansi import raw as raw_ansi
table = self.styled_table(border="header")
for item in items:
- table.add_row(f"|C{item.name}|n",
+ table.add_row(f"|C{item.name}|n",
"{}|n".format(utils.crop(raw_ansi(item.db.desc), width=50) or ""))
- string = f"|wYou are carrying:\n{table}"
+ string = f"|wYou are carrying:\n{table}"
self.caller.msg(string)
diff --git a/docs/0.9.5/_modules/evennia/commands/default/help.html b/docs/0.9.5/_modules/evennia/commands/default/help.html
index 196bbfe69b..c446fbde14 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/help.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/help.html
@@ -47,15 +47,15 @@
creation of other help topics such as RP help or game-world aides.
"""
-from django.conf import settings
-from collections import defaultdict
-from evennia.utils.utils import fill, dedent
-from evennia.commands.command import Command
-from evennia.help.models import HelpEntry
-from evennia.utils import create, evmore
-from evennia.utils.ansi import ANSIString
-from evennia.utils.eveditor import EvEditor
-from evennia.utils.utils import (
+from django.conf import settings
+from collections import defaultdict
+from evennia.utils.utils import fill, dedent
+from evennia.commands.command import Command
+from evennia.help.models import HelpEntry
+from evennia.utils import create, evmore
+from evennia.utils.ansi import ANSIString
+from evennia.utils.eveditor import EvEditor
+from evennia.utils.utils import (
string_suggestions,
class_from_module,
inherits_from,
@@ -76,7 +76,7 @@
class HelpCategory:
- def __init__(self, key):
+ def __init__(self, key):
self.key = key
@property
@@ -89,13 +89,13 @@
"text": "",
}
- def __str__(self):
- return f"Category: {self.key}"
+ def __str__(self):
+ return f"Category: {self.key}"
- def __eq__(self, other):
+ def __eq__(self, other):
return str(self).lower() == str(other).lower()
- def __hash__(self):
+ def __hash__(self):
return id(self)
@@ -107,8 +107,8 @@
if not _LUNR:
# we have to delay-load lunr because it messes with logging if it's imported
# before twisted's logging has been set up
- from lunr import lunr as _LUNR
- from lunr.exceptions import QueryParseError as _LUNR_EXCEPTION
+ from lunr import lunr as _LUNR
+ from lunr.exceptions import QueryParseError as _LUNR_EXCEPTION
indx = [cnd.search_index_entry for cnd in candidate_entries]
mapping = {indx[ix]["key"]: cand for ix, cand in enumerate(candidate_entries)}
@@ -209,18 +209,18 @@
Returns the formatted string, ready to be sent.
"""
- start = f"{_SEP}\n"
- title = f"|CHelp for |w{title}|n" if title else ""
+ start = f"{_SEP}\n"
+ title = f"|CHelp for |w{title}|n" if title else ""
aliases = (
- " |C(aliases: {}|C)|n".format("|C,|n ".join(f"|w{ali}|n" for ali in aliases))
+ " |C(aliases: {}|C)|n".format("|C,|n ".join(f"|w{ali}|n" for ali in aliases))
if aliases else "")
help_text = (
- f"\n{dedent(help_text.rstrip())}"if help_text else "")
+ f"\n{dedent(help_text.rstrip())}"if help_text else "")
suggested = (
"\n\n|CSuggested:|n {}".format(
- fill("|C,|n ".join(f"|w{sug}|n" for sug in suggested)))
+ fill("|C,|n ".join(f"|w{sug}|n" for sug in suggested)))
if suggested else "")
- end = f"\n{_SEP}"
+ end = f"\n{_SEP}"
return "".join((start, title, aliases, help_text, suggested, end))
@@ -238,7 +238,7 @@
verbatim_elements = []
for category in sorted(set(list(hdict_cmds.keys()) + list(hdict_db.keys()))):
- category_str = f"-- {category.title()} "
+ category_str = f"-- {category.title()} "
grid.append(
ANSIString(
category_clr + category_str + "-" * (width - len(category_str)) + topic_clr
@@ -350,7 +350,7 @@
# Try to access a particular help entry or category
entries = [cmd for cmd in all_cmds if cmd] + list(HelpEntry.objects.all()) + all_categories
- for match_query in [f"{query}~1", f"{query}*"]:
+ for match_query in [f"{query}~1", f"{query}*"]:
# We first do an exact word-match followed by a start-by query
matches, suggestions = help_search_with_index(
match_query, entries, suggestion_maxnum=self.suggestion_maxnum
@@ -396,7 +396,7 @@
# no exact matches found. Just give suggestions.
self.msg(
self.format_help_entry(
- "", f"No help entry found for '{query}'", None, suggested=suggestions
+ "", f"No help entry found for '{query}'", None, suggested=suggestions
),
options={"type": "help"},
)
diff --git a/docs/0.9.5/_modules/evennia/commands/default/muxcommand.html b/docs/0.9.5/_modules/evennia/commands/default/muxcommand.html
index fad7d6d132..4fd360f40d 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/muxcommand.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/muxcommand.html
@@ -44,8 +44,8 @@
is also an Account/OOC version that makes sure caller is an Account object.
"""
-from evennia.utils import utils
-from evennia.commands.command import Command
+from evennia.utils import utils
+from evennia.commands.command import Command
# limit symbol import for API
__all__ = ("MuxCommand", "MuxAccountCommand")
@@ -250,9 +250,9 @@
variables = "\n".join(
" |w{}|n ({}): {}".format(key, type(val), val) for key, val in self.__dict__.items()
)
- string = f"""
-Command {self} has no defined `func()` - showing on-command variables: No child func() defined for {self} - available variables:
-{variables}
+ string = f"""
+Command {self} has no defined `func()` - showing on-command variables: No child func() defined for {self} - available variables:
+{variables}
"""
self.caller.msg(string)
# a simple test command to show the available properties
diff --git a/docs/0.9.5/_modules/evennia/commands/default/syscommands.html b/docs/0.9.5/_modules/evennia/commands/default/syscommands.html
index c06bdadf4c..5f79b778fe 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/syscommands.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/syscommands.html
@@ -59,19 +59,19 @@
the line is just added to the editor buffer).
"""
-from evennia.comms.models import ChannelDB
-from evennia.utils import create
-from evennia.utils.utils import at_search_result
+from evennia.comms.models import ChannelDB
+from evennia.utils import create
+from evennia.utils.utils import at_search_result
# The command keys the engine is calling
# (the actual names all start with __)
-from evennia.commands.cmdhandler import CMD_NOINPUT
-from evennia.commands.cmdhandler import CMD_NOMATCH
-from evennia.commands.cmdhandler import CMD_MULTIMATCH
-from evennia.commands.cmdhandler import CMD_CHANNEL
-from evennia.utils import utils
+from evennia.commands.cmdhandler import CMD_NOINPUT
+from evennia.commands.cmdhandler import CMD_NOMATCH
+from evennia.commands.cmdhandler import CMD_MULTIMATCH
+from evennia.commands.cmdhandler import CMD_CHANNEL
+from evennia.utils import utils
-from django.conf import settings
+from django.conf import settings
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
diff --git a/docs/0.9.5/_modules/evennia/commands/default/system.html b/docs/0.9.5/_modules/evennia/commands/default/system.html
index c1ad4199a8..d1fa067b92 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/system.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/system.html
@@ -56,17 +56,17 @@
import twisted
import time
-from django.conf import settings
-from django.core.paginator import Paginator
-from evennia.server.sessionhandler import SESSIONS
-from evennia.scripts.models import ScriptDB
-from evennia.objects.models import ObjectDB
-from evennia.accounts.models import AccountDB
-from evennia.utils import logger, utils, gametime, create, search
-from evennia.utils.eveditor import EvEditor
-from evennia.utils.evtable import EvTable
-from evennia.utils.evmore import EvMore
-from evennia.utils.utils import crop, class_from_module
+from django.conf import settings
+from django.core.paginator import Paginator
+from evennia.server.sessionhandler import SESSIONS
+from evennia.scripts.models import ScriptDB
+from evennia.objects.models import ObjectDB
+from evennia.accounts.models import AccountDB
+from evennia.utils import logger, utils, gametime, create, search
+from evennia.utils.eveditor import EvEditor
+from evennia.utils.evtable import EvTable
+from evennia.utils.evmore import EvMore
+from evennia.utils.utils import crop, class_from_module
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
@@ -237,7 +237,7 @@
old_stderr = sys.stderr
class FakeStd:
- def __init__(self, caller):
+ def __init__(self, caller):
self.caller = caller
def write(self, string):
@@ -305,7 +305,7 @@
"""Evennia wrapper around a Python interactive console."""
- def __init__(self, caller):
+ def __init__(self, caller):
super().__init__(evennia_local_vars(caller))
self.caller = caller
@@ -319,7 +319,7 @@
old_stderr = sys.stderr
class FakeStd:
- def __init__(self, caller):
+ def __init__(self, caller):
self.caller = caller
def write(self, string):
@@ -435,7 +435,7 @@
prompt = "..." if console.push(line) else main_prompt
else:
if line:
- self.caller.msg(f">>> {line}")
+ self.caller.msg(f">>> {line}")
prompt = line if console.push(line) else main_prompt
except SystemExit:
break
@@ -502,7 +502,7 @@
table.add_row(
script.id,
- f"{script.obj.key}({script.obj.dbref})"
+ f"{script.obj.key}({script.obj.dbref})"
if (hasattr(script, "obj") and script.obj)
else "<Global>",
script.key,
@@ -899,11 +899,11 @@
service_collection.removeService(service)
caller.msg("|gStopped and removed service '%s'.|n" % self.args)
else:
- caller.msg(f"Stopping service '{self.args}'...")
+ caller.msg(f"Stopping service '{self.args}'...")
try:
service.stopService()
except Exception as err:
- caller.msg(f"|rErrors were reported when stopping this service{err}.\n"
+ caller.msg(f"|rErrors were reported when stopping this service{err}.\n"
"If there are remaining problems, try reloading "
"or rebooting the server.")
caller.msg("|g... Stopped service '%s'.|n" % self.args)
@@ -914,11 +914,11 @@
if service.running:
caller.msg("That service is already running.")
return
- caller.msg(f"Starting service '{self.args}' ...")
+ caller.msg(f"Starting service '{self.args}' ...")
try:
service.startService()
except Exception as err:
- caller.msg(f"|rErrors were reported when starting this service{err}.\n"
+ caller.msg(f"|rErrors were reported when starting this service{err}.\n"
"If there are remaining problems, try reloading the server, changing the "
"settings if it's a non-standard service.|n")
caller.msg("|gService started.|n")
@@ -1058,7 +1058,7 @@
global _IDMAPPER
if not _IDMAPPER:
- from evennia.utils.idmapper import models as _IDMAPPER
+ from evennia.utils.idmapper import models as _IDMAPPER
if "flushmem" in self.switches:
# flush the cache
@@ -1201,7 +1201,7 @@
locks = "cmd:perm(tickers) or perm(Builder)"
def func(self):
- from evennia import TICKER_HANDLER
+ from evennia import TICKER_HANDLER
all_subs = TICKER_HANDLER.all_display()
if not all_subs:
diff --git a/docs/0.9.5/_modules/evennia/commands/default/tests.html b/docs/0.9.5/_modules/evennia/commands/default/tests.html
index cea1ecf0de..4a31d6b5a8 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/tests.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/tests.html
@@ -55,15 +55,15 @@
import re
import types
import datetime
-from anything import Anything
+from anything import Anything
-from django.conf import settings
-from unittest.mock import patch, Mock, MagicMock
+from django.conf import settings
+from unittest.mock import patch, Mock, MagicMock
-from evennia import DefaultRoom, DefaultExit, ObjectDB
-from evennia.commands.default.cmdset_character import CharacterCmdSet
-from evennia.utils.test_resources import EvenniaTest
-from evennia.commands.default import (
+from evennia import DefaultRoom, DefaultExit, ObjectDB
+from evennia.commands.default.cmdset_character import CharacterCmdSet
+from evennia.utils.test_resources import EvenniaTest
+from evennia.commands.default import (
help,
general,
system,
@@ -75,16 +75,16 @@
unloggedin,
syscommands,
)
-from evennia.commands.cmdparser import build_matches
-from evennia.commands.default.muxcommand import MuxCommand
-from evennia.commands.command import Command, InterruptCommand
-from evennia.commands import cmdparser
-from evennia.commands.cmdset import CmdSet
-from evennia.utils import ansi, utils, gametime
-from evennia.server.sessionhandler import SESSIONS
-from evennia import search_object
-from evennia import DefaultObject, DefaultCharacter
-from evennia.prototypes import prototypes as protlib
+from evennia.commands.cmdparser import build_matches
+from evennia.commands.default.muxcommand import MuxCommand
+from evennia.commands.command import Command, InterruptCommand
+from evennia.commands import cmdparser
+from evennia.commands.cmdset import CmdSet
+from evennia.utils import ansi, utils, gametime
+from evennia.server.sessionhandler import SESSIONS
+from evennia import search_object
+from evennia import DefaultObject, DefaultCharacter
+from evennia.prototypes import prototypes as protlib
# set up signal here since we are not starting the server
@@ -1080,7 +1080,7 @@
"All object creation hooks were run. All old attributes where deleted before the swap.",
)
- from evennia.prototypes.prototypes import homogenize_prototype
+ from evennia.prototypes.prototypes import homogenize_prototype
test_prototype = [
homogenize_prototype(
@@ -1183,12 +1183,12 @@
maxdiff = maxid - id1 + 1
mdiff = id2 - id1 + 1
- self.call(building.CmdFind(), f"=#{id1}", f"{maxdiff} Matches(#{id1}-#{maxid}")
- self.call(building.CmdFind(), f"={id1}-{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
- self.call(building.CmdFind(), f"={id1} - {id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
- self.call(building.CmdFind(), f"={id1}- #{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
- self.call(building.CmdFind(), f"={id1}-#{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
- self.call(building.CmdFind(), f"=#{id1}-{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
+ self.call(building.CmdFind(), f"=#{id1}", f"{maxdiff} Matches(#{id1}-#{maxid}")
+ self.call(building.CmdFind(), f"={id1}-{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
+ self.call(building.CmdFind(), f"={id1} - {id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
+ self.call(building.CmdFind(), f"={id1}- #{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
+ self.call(building.CmdFind(), f"={id1}-#{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
+ self.call(building.CmdFind(), f"=#{id1}-{id2}", f"{mdiff} Matches(#{id1}-#{id2}):")
[docs] def test_script(self):
self.call(building.CmdScript(), "Obj = ", "No scripts defined on Obj")
diff --git a/docs/0.9.5/_modules/evennia/commands/default/unloggedin.html b/docs/0.9.5/_modules/evennia/commands/default/unloggedin.html
index b1f56c2db3..ab244e1bef 100644
--- a/docs/0.9.5/_modules/evennia/commands/default/unloggedin.html
+++ b/docs/0.9.5/_modules/evennia/commands/default/unloggedin.html
@@ -44,13 +44,13 @@
"""
import re
import datetime
-
from codecs import lookup as codecs_lookup
-
from django.conf import settings
-
from evennia.comms.models import ChannelDB
-
from evennia.server.sessionhandler import SESSIONS
+
from codecs import lookup as codecs_lookup
+
from django.conf import settings
+
from evennia.comms.models import ChannelDB
+
from evennia.server.sessionhandler import SESSIONS
-
from evennia.utils import class_from_module, create, logger, utils, gametime
-
from evennia.commands.cmdhandler import CMD_LOGINSTART
+
from evennia.utils import class_from_module, create, logger, utils, gametime
+
from evennia.commands.cmdhandler import CMD_LOGINSTART
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
diff --git a/docs/0.9.5/_modules/evennia/comms/admin.html b/docs/0.9.5/_modules/evennia/comms/admin.html
index f457e679f0..ad2ae0b866 100644
--- a/docs/0.9.5/_modules/evennia/comms/admin.html
+++ b/docs/0.9.5/_modules/evennia/comms/admin.html
@@ -44,10 +44,10 @@
"""
-
from django.contrib import admin
-
from evennia.comms.models import ChannelDB
-
from evennia.typeclasses.admin import AttributeInline, TagInline
-
from django.conf import settings
+
from django.contrib import admin
+
from evennia.comms.models import ChannelDB
+
from evennia.typeclasses.admin import AttributeInline, TagInline
+
from django.conf import settings
[docs]class ChannelAttributeInline(AttributeInline):
@@ -155,8 +155,8 @@
obj.at_init()
[docs] def response_add(self, request, obj, post_url_continue=None):
-
from django.http import HttpResponseRedirect
-
from django.urls import reverse
+
from django.http import HttpResponseRedirect
+
from django.urls import reverse
return HttpResponseRedirect(reverse("admin:comms_channeldb_change", args=[obj.id]))
diff --git a/docs/0.9.5/_modules/evennia/comms/channelhandler.html b/docs/0.9.5/_modules/evennia/comms/channelhandler.html
index b1e2894951..ae3b49d233 100644
--- a/docs/0.9.5/_modules/evennia/comms/channelhandler.html
+++ b/docs/0.9.5/_modules/evennia/comms/channelhandler.html
@@ -64,11 +64,11 @@
does this for you.
"""
-from django.conf import settings
-from evennia.commands import cmdset, command
-from evennia.utils.logger import tail_log_file
-from evennia.utils.utils import class_from_module
-from django.utils.translation import gettext as _
+from django.conf import settings
+from evennia.commands import cmdset, command
+from evennia.utils.logger import tail_log_file
+from evennia.utils.utils import class_from_module
+from django.utils.translation import gettext as _
# we must late-import these since any overloads are likely to
# themselves be using these classes leading to a circular import.
@@ -136,7 +136,7 @@
"""
global _CHANNELDB
if not _CHANNELDB:
- from evennia.comms.models import ChannelDB as _CHANNELDB
+ from evennia.comms.models import ChannelDB as _CHANNELDB
channelkey, msg = self.args
caller = self.caller
@@ -214,7 +214,7 @@
"""
-[docs] def __init__(self):
+
[docs] def __init__(self):
"""
Initializes the channel handler's internal state.
@@ -223,7 +223,7 @@
self._cached_cmdsets = {}
self._cached_channels = {}
-
def __str__(self):
+
def __str__(self):
"""
Returns the string representation of the handler
@@ -300,7 +300,7 @@
"""
global _CHANNELDB
if not _CHANNELDB:
-
from evennia.comms.models import ChannelDB as _CHANNELDB
+
from evennia.comms.models import ChannelDB as _CHANNELDB
self._cached_channel_cmds = {}
self._cached_cmdsets = {}
self._cached_channels = {}
diff --git a/docs/0.9.5/_modules/evennia/comms/comms.html b/docs/0.9.5/_modules/evennia/comms/comms.html
index 1384e7377e..e8ce97d763 100644
--- a/docs/0.9.5/_modules/evennia/comms/comms.html
+++ b/docs/0.9.5/_modules/evennia/comms/comms.html
@@ -43,15 +43,15 @@
Base typeclass for in-game Channels.
"""
-
from django.contrib.contenttypes.models import ContentType
-
from django.urls import reverse
-
from django.utils.text import slugify
+
from django.contrib.contenttypes.models import ContentType
+
from django.urls import reverse
+
from django.utils.text import slugify
-
from evennia.typeclasses.models import TypeclassBase
-
from evennia.comms.models import TempMsg, ChannelDB
-
from evennia.comms.managers import ChannelManager
-
from evennia.utils import create, logger
-
from evennia.utils.utils import make_iter
+
from evennia.typeclasses.models import TypeclassBase
+
from evennia.comms.models import TempMsg, ChannelDB
+
from evennia.comms.managers import ChannelManager
+
from evennia.utils import create, logger
+
from evennia.utils.utils import make_iter
_CHANNEL_HANDLER = None
@@ -99,7 +99,7 @@
# delayed import of the channelhandler
global _CHANNEL_HANDLER
if not _CHANNEL_HANDLER:
-
from evennia.comms.channelhandler import CHANNEL_HANDLER as _CHANNEL_HANDLER
+
from evennia.comms.channelhandler import CHANNEL_HANDLER as _CHANNEL_HANDLER
# register ourselves with the channelhandler.
_CHANNEL_HANDLER.add(self)
@@ -339,7 +339,7 @@
self.attributes.clear()
self.aliases.clear()
super().delete()
-
from evennia.comms.channelhandler import CHANNELHANDLER
+
from evennia.comms.channelhandler import CHANNELHANDLER
CHANNELHANDLER.update()
diff --git a/docs/0.9.5/_modules/evennia/comms/managers.html b/docs/0.9.5/_modules/evennia/comms/managers.html
index a2c062034f..dbaa20278f 100644
--- a/docs/0.9.5/_modules/evennia/comms/managers.html
+++ b/docs/0.9.5/_modules/evennia/comms/managers.html
@@ -46,10 +46,10 @@
"""
-from django.db.models import Q
-from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
-from evennia.utils import logger
-from evennia.utils.utils import dbref
+from django.db.models import Q
+from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
+from evennia.utils import logger
+from evennia.utils.utils import dbref
_GA = object.__getattribute__
_AccountDB = None
diff --git a/docs/0.9.5/_modules/evennia/comms/models.html b/docs/0.9.5/_modules/evennia/comms/models.html
index 81897b828e..ce6515df8c 100644
--- a/docs/0.9.5/_modules/evennia/comms/models.html
+++ b/docs/0.9.5/_modules/evennia/comms/models.html
@@ -58,15 +58,15 @@
connect to channels by use of a ChannelConnect object (this object is
necessary to easily be able to delete connections on the fly).
"""
-from django.conf import settings
-from django.utils import timezone
-from django.db import models
-from evennia.typeclasses.models import TypedObject
-from evennia.typeclasses.tags import Tag, TagHandler
-from evennia.utils.idmapper.models import SharedMemoryModel
-from evennia.comms import managers
-from evennia.locks.lockhandler import LockHandler
-from evennia.utils.utils import crop, make_iter, lazy_property
+from django.conf import settings
+from django.utils import timezone
+from django.db import models
+from evennia.typeclasses.models import TypedObject
+from evennia.typeclasses.tags import Tag, TagHandler
+from evennia.utils.idmapper.models import SharedMemoryModel
+from evennia.comms import managers
+from evennia.locks.lockhandler import LockHandler
+from evennia.utils.utils import crop, make_iter, lazy_property
__all__ = ("Msg", "TempMsg", "ChannelDB")
@@ -214,7 +214,7 @@
objects = managers.MsgManager()
_is_deleted = False
-[docs] def __init__(self, *args, **kwargs):
+
[docs] def __init__(self, *args, **kwargs):
SharedMemoryModel.__init__(self, *args, **kwargs)
self.extra_senders = []
@@ -439,7 +439,7 @@
# Msg class methods
#
-
def __str__(self):
+
def __str__(self):
"This handles what is shown when e.g. printing the message"
senders = ",".join(getattr(obj, "key", str(obj)) for obj in self.senders)
@@ -480,7 +480,7 @@
"""
-
[docs] def __init__(
+
[docs] def __init__(
self,
senders=None,
receivers=None,
@@ -519,7 +519,7 @@
def locks(self):
return LockHandler(self)
-
def __str__(self):
+
def __str__(self):
"""
This handles what is shown when e.g. printing the message.
"""
@@ -587,7 +587,7 @@
subscribing (Account or Object)
"""
-
def __init__(self, obj):
+
def __init__(self, obj):
"""
Initialize the handler
@@ -646,7 +646,7 @@
"""
global _CHANNELHANDLER
if not _CHANNELHANDLER:
-
from evennia.comms.channelhandler import CHANNEL_HANDLER as _CHANNELHANDLER
+
from evennia.comms.channelhandler import CHANNEL_HANDLER as _CHANNELHANDLER
for subscriber in make_iter(entity):
if subscriber:
clsname = subscriber.__dbclass__.__name__
@@ -669,7 +669,7 @@
"""
global _CHANNELHANDLER
if not _CHANNELHANDLER:
-
from evennia.comms.channelhandler import CHANNEL_HANDLER as _CHANNELHANDLER
+
from evennia.comms.channelhandler import CHANNEL_HANDLER as _CHANNELHANDLER
for subscriber in make_iter(entity):
if subscriber:
clsname = subscriber.__dbclass__.__name__
@@ -706,7 +706,7 @@
subs = []
recache_needed = False
for obj in self.all():
-
from django.core.exceptions import ObjectDoesNotExist
+
from django.core.exceptions import ObjectDoesNotExist
try:
if hasattr(obj, "account") and obj.account:
@@ -773,7 +773,7 @@
verbose_name = "Channel"
verbose_name_plural = "Channels"
-
def __str__(self):
+
def __str__(self):
"Echoes the text representation of the channel."
return "Channel '%s' (%s)" % (self.key, self.db.desc)
diff --git a/docs/0.9.5/_modules/evennia/contrib/barter.html b/docs/0.9.5/_modules/evennia/contrib/barter.html
index d21de7f1bc..1b23ea62eb 100644
--- a/docs/0.9.5/_modules/evennia/contrib/barter.html
+++ b/docs/0.9.5/_modules/evennia/contrib/barter.html
@@ -135,7 +135,7 @@
"""
-
from evennia import Command, DefaultScript, CmdSet
+
from evennia import Command, DefaultScript, CmdSet
TRADE_TIMEOUT = 60 # timeout for B to accept trade
@@ -177,7 +177,7 @@
offers from each side and wether both have accepted or not.
"""
-
[docs] def __init__(self, part_a, part_b):
+
[docs] def __init__(self, part_a, part_b):
"""
Initializes the trade. This is called when part A tries to
initiate a trade with part B. The trade will not start until
diff --git a/docs/0.9.5/_modules/evennia/contrib/building_menu.html b/docs/0.9.5/_modules/evennia/contrib/building_menu.html
index 7d388b61d7..6ccf06be5f 100644
--- a/docs/0.9.5/_modules/evennia/contrib/building_menu.html
+++ b/docs/0.9.5/_modules/evennia/contrib/building_menu.html
@@ -160,16 +160,16 @@
"""
-
from inspect import getargspec
-
from textwrap import dedent
+
from inspect import getargspec
+
from textwrap import dedent
-
from django.conf import settings
-
from evennia import Command, CmdSet
-
from evennia.commands import cmdhandler
-
from evennia.utils.ansi import strip_ansi
-
from evennia.utils.eveditor import EvEditor
-
from evennia.utils.logger import log_err, log_trace
-
from evennia.utils.utils import class_from_module
+
from django.conf import settings
+
from evennia import Command, CmdSet
+
from evennia.commands import cmdhandler
+
from evennia.utils.ansi import strip_ansi
+
from evennia.utils.eveditor import EvEditor
+
from evennia.utils.logger import log_err, log_trace
+
from evennia.utils.utils import class_from_module
# Constants
@@ -374,7 +374,7 @@
key = _CMD_NOINPUT
locks = "cmd:all()"
-