Format code imports

This commit is contained in:
Griatch 2022-11-10 22:21:12 +01:00
parent 92834aacd0
commit a461a97576
361 changed files with 1019 additions and 754 deletions

View file

@ -66,13 +66,14 @@ An example of the contents of a module:
"""
from dataclasses import dataclass
from django.conf import settings
from django.urls import reverse
from django.utils.text import slugify
from evennia.utils.utils import variable_from_module, make_iter, all_from_module
from evennia.utils import logger
from evennia.utils.utils import lazy_property
from evennia.locks.lockhandler import LockHandler
from evennia.utils import logger
from evennia.utils.utils import all_from_module, lazy_property, make_iter, variable_from_module
_DEFAULT_HELP_CATEGORY = settings.DEFAULT_HELP_CATEGORY

View file

@ -2,10 +2,11 @@
Custom manager for HelpEntry objects.
"""
from django.db import IntegrityError
from evennia.utils import logger, utils
from evennia.typeclasses.managers import TypedObjectManager
from evennia.utils.utils import make_iter
from evennia.server import signals
from evennia.typeclasses.managers import TypedObjectManager
from evennia.utils import logger, utils
from evennia.utils.utils import make_iter
__all__ = ("HelpEntryManager",)

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.db import migrations, models
class Migration(migrations.Migration):

View file

@ -14,10 +14,10 @@ from django.db import models
from django.urls import reverse
from django.utils.text import slugify
from evennia.utils.idmapper.models import SharedMemoryModel
from evennia.help.manager import HelpEntryManager
from evennia.typeclasses.models import Tag, TagHandler, AliasHandler
from evennia.locks.lockhandler import LockHandler
from evennia.typeclasses.models import AliasHandler, Tag, TagHandler
from evennia.utils.idmapper.models import SharedMemoryModel
from evennia.utils.utils import lazy_property
__all__ = ("HelpEntry",)

View file

@ -5,9 +5,11 @@ command test-suite).
"""
from unittest import mock
from evennia.help import filehelp
from evennia.help import utils as help_utils
from evennia.utils.test_resources import TestCase
from evennia.utils.utils import dedent
from evennia.help import filehelp, utils as help_utils
class TestParseSubtopics(TestCase):

View file

@ -5,9 +5,10 @@ sub-categories.
This is used primarily by the default `help` command.
"""
from django.conf import settings
import re
from django.conf import settings
# these are words that Lunr normally ignores but which we want to find
# since we use them (e.g. as command names).
# Lunr's default ignore-word list is found here:
@ -58,14 +59,13 @@ def help_search_with_index(query, candidate_entries, suggestion_maxnum=5, fields
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 get_default_builder as _LUNR_GET_BUILDER
from lunr import lunr as _LUNR
from lunr import stop_word_filter
from lunr.exceptions import QueryParseError as _LUNR_EXCEPTION
from lunr.stemmer import stemmer
# from lunr.trimmer import trimmer
# pre-create a lunr index-builder pipeline where we've removed some of
# the stop-words from the default in lunr.