mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 23:06:31 +01:00
19 lines
429 B
Python
19 lines
429 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
|
|
|
|
if not dbstring.startswith("#"):
|
|
return False
|
|
elif number < 1:
|
|
return False
|
|
else:
|
|
return True
|