Committin a 'working' checkpoint before I break more stuff.
This commit is contained in:
parent
ccf078b5c8
commit
d3808c1ea2
18 changed files with 494 additions and 444 deletions
19
apps/objects/util/object.py
Normal file
19
apps/objects/util/object.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
"""
|
||||
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
|
||||
|
||||
if not dbstring.startswith("#"):
|
||||
return False
|
||||
elif number < 1:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue