Cleaning some unnecessary whitespace, overall cleanup of various source codes.
This commit is contained in:
parent
d4c97d7df8
commit
c0322c9eae
27 changed files with 1342 additions and 1318 deletions
64
ev.py
64
ev.py
|
|
@ -2,42 +2,42 @@
|
|||
|
||||
Central API for the Evennia MUD/MUX/MU* creation system.
|
||||
|
||||
This basically a set of shortcuts to the main modules in src/. Import this
|
||||
from your code or explore it interactively from ./manage.py shell (or a normal
|
||||
This basically a set of shortcuts to the main modules in src/. Import this
|
||||
from your code or explore it interactively from ./manage.py shell (or a normal
|
||||
python shell if you set DJANGO_SETTINGS_MODULE manually).
|
||||
|
||||
Notes:
|
||||
Notes:
|
||||
|
||||
1) You should import things explicitly from the root of this module - you can not use
|
||||
dot-notation to import deeper. Hence, to access a default command, you can do the
|
||||
1) You should import things explicitly from the root of this module - you can not use
|
||||
dot-notation to import deeper. Hence, to access a default command, you can do the
|
||||
following:
|
||||
|
||||
import ev
|
||||
ev.default_cmds.CmdLook
|
||||
or
|
||||
or
|
||||
from ev import default_cmds
|
||||
default_cmds.CmdLook
|
||||
|
||||
But trying to import CmdLook directly with "from ev.default_cmds import CmdLook" will
|
||||
not work since default_cmds is a property on the "ev" module, not a module of its own.
|
||||
|
||||
But trying to import CmdLook directly with "from ev.default_cmds import CmdLook" will
|
||||
not work since default_cmds is a property on the "ev" module, not a module of its own.
|
||||
2) db_* are shortcuts to initiated versions of Evennia's django database managers (e.g.
|
||||
db_objects is an alias for ObjectDB.objects). These allows for exploring the database in
|
||||
various ways. Please note that the evennia-specific methods in the managers return
|
||||
typeclasses (or lists of typeclasses), whereas the default django ones (filter etc)
|
||||
return database objects. You can convert between the two easily via dbobj.typeclass and
|
||||
typeclass.dbobj, but it's worth to remember this difference.
|
||||
3) You -have- to use the create_* functions (shortcuts to src.utils.create) to create new
|
||||
Typeclassed game entities (Objects, Scripts or Players). Just initializing e.g. the Player class will
|
||||
-not- set up Typeclasses correctly and will lead to errors. Other types of database objects
|
||||
db_objects is an alias for ObjectDB.objects). These allows for exploring the database in
|
||||
various ways. Please note that the evennia-specific methods in the managers return
|
||||
typeclasses (or lists of typeclasses), whereas the default django ones (filter etc)
|
||||
return database objects. You can convert between the two easily via dbobj.typeclass and
|
||||
typeclass.dbobj, but it's worth to remember this difference.
|
||||
3) You -have- to use the create_* functions (shortcuts to src.utils.create) to create new
|
||||
Typeclassed game entities (Objects, Scripts or Players). Just initializing e.g. the Player class will
|
||||
-not- set up Typeclasses correctly and will lead to errors. Other types of database objects
|
||||
can be created normally, but there are conveniant create_* functions for those too, making
|
||||
some more error checking.
|
||||
some more error checking.
|
||||
4) "settings" links to Evennia's game/settings file. "settings_full" shows all of django's available
|
||||
settings. Note that you cannot change settings from here in a meaningful way, you need to update
|
||||
settings. Note that you cannot change settings from here in a meaningful way, you need to update
|
||||
game/settings.py and restart the server.
|
||||
5) The API accesses all relevant and most-neeeded functions/classes from src/, but might not
|
||||
always include all helper-functions referenced from each such entity. To get to those, access
|
||||
the modules in src/ directly. You can always do this anyway, if you do not want to go through
|
||||
this API.
|
||||
5) The API accesses all relevant and most-neeeded functions/classes from src/, but might not
|
||||
always include all helper-functions referenced from each such entity. To get to those, access
|
||||
the modules in src/ directly. You can always do this anyway, if you do not want to go through
|
||||
this API.
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ if __name__ == "__main__":
|
|||
| not be run on its own, but be imported and accessed as described
|
||||
| above.
|
||||
|
|
||||
| To start the Evennia server, see game/manage.py and game/evennia.py.
|
||||
| To start the Evennia server, see game/manage.py and game/evennia.py.
|
||||
| More help can be found at http://www.evennia.com.
|
||||
"""
|
||||
print info
|
||||
|
|
@ -86,11 +86,11 @@ del sys, os
|
|||
|
||||
README = __doc__
|
||||
|
||||
# help entries
|
||||
# help entries
|
||||
from src.help.models import HelpEntry
|
||||
db_helpentries = HelpEntry.objects
|
||||
|
||||
# players
|
||||
# players
|
||||
from src.players.player import Player
|
||||
from src.players.models import PlayerDB, PlayerAttribute, PlayerNick
|
||||
db_players = PlayerDB.objects
|
||||
|
|
@ -106,8 +106,8 @@ from src.commands import default as default_cmds
|
|||
class SystemCmds(object):
|
||||
"""
|
||||
Creating commands with keys set to these constants will make
|
||||
them system commands called as a replacement by the parser when
|
||||
special situations occur. If not defined, the hard-coded
|
||||
them system commands called as a replacement by the parser when
|
||||
special situations occur. If not defined, the hard-coded
|
||||
responses in the server are used.
|
||||
|
||||
CMD_NOINPUT - no input was given on command line
|
||||
|
|
@ -116,7 +116,7 @@ class SystemCmds(object):
|
|||
CMD_CHANNEL - the command name is a channel name
|
||||
CMD_LOGINSTART - this command will be called as the very
|
||||
first command when a player connects to
|
||||
the server.
|
||||
the server.
|
||||
|
||||
"""
|
||||
from src.commands import cmdhandler
|
||||
|
|
@ -125,13 +125,13 @@ class SystemCmds(object):
|
|||
CMD_MULTIMATCH = cmdhandler.CMD_MULTIMATCH
|
||||
CMD_CHANNEL = cmdhandler.CMD_CHANNEL
|
||||
CMD_LOGINSTART = cmdhandler.CMD_LOGINSTART
|
||||
del cmdhandler
|
||||
del cmdhandler
|
||||
syscmdkeys = SystemCmds()
|
||||
|
||||
# locks
|
||||
from src.locks import lockfuncs
|
||||
|
||||
# scripts
|
||||
# scripts
|
||||
from src.scripts.scripts import Script
|
||||
from src.scripts.models import ScriptDB, ScriptAttribute
|
||||
db_scripts = ScriptDB.objects
|
||||
|
|
@ -154,7 +154,7 @@ db_objects = ObjectDB.objects
|
|||
#db_objattrs = ObjAttribute.objects
|
||||
del ObjAttribute, Alias, ObjectNick, ObjectDB
|
||||
|
||||
# server
|
||||
# server
|
||||
from src.server.models import ServerConfig
|
||||
db_serverconfigs = ServerConfig.objects
|
||||
del ServerConfig
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue