mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 15:56:30 +01:00
- The command handler has been drastically simplified. We were doing way too much processing in the handler that should have been done in the individual command functions themselves. - The 'cdat' dict we were previously passing around has been replaced with a Command object that has useful methods for performing some of the parsing command functions will probably want to do from time to time. - All commands were updated to use the new Command object, tested, and cleaned up in general. - A lot of formatting was cleaned up. - A lot of previously un-found bugs and limitations were fixed. - The 'page' command has been broken out into its own file, since it's going to have a number of functions that would otherwise clutter commands/general.py. Expect a commit (probably later today) that will clean up the second half of cmdhandler.py.
21 lines
472 B
Python
21 lines
472 B
Python
"""
|
|
Utility functions for the Object class. These functions should not import
|
|
any models or modify the database.
|
|
"""
|
|
def is_dbref(dbstring):
|
|
"""
|
|
Is the input a well-formed dbref number?
|
|
"""
|
|
try:
|
|
number = int(dbstring[1:])
|
|
except ValueError:
|
|
return False
|
|
except TypeError:
|
|
return False
|
|
|
|
if not dbstring.startswith("#"):
|
|
return False
|
|
elif number < 1:
|
|
return False
|
|
else:
|
|
return True
|