mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 23:47:16 +02:00
Indentation change 3-4 spaces.
Possible files that need to be cleanedup; commands/info.py:cmd_list commands/general.py:cmd_who commands/comsys.py:cmd_who cmdtable.py ansi.py
This commit is contained in:
parent
740d715c72
commit
3fe644ef17
31 changed files with 1856 additions and 1856 deletions
|
|
@ -3,27 +3,27 @@ from apps.helpsys.models import HelpEntry
|
|||
Help system functions.
|
||||
"""
|
||||
def find_topicmatch(pobject, topicstr):
|
||||
"""
|
||||
Searches for matching topics based on player's input.
|
||||
"""
|
||||
is_staff = pobject.is_staff()
|
||||
if topicstr.isdigit():
|
||||
if is_staff:
|
||||
return HelpEntry.objects.filter(id=topicstr)
|
||||
else:
|
||||
return HelpEntry.objects.filter(id=topicstr).exclude(staff_only=1)
|
||||
else:
|
||||
if is_staff:
|
||||
return HelpEntry.objects.filter(topicname__istartswith=topicstr)
|
||||
else:
|
||||
return HelpEntry.objects.filter(topicname__istartswith=topicstr).exclude(staff_only=1)
|
||||
|
||||
"""
|
||||
Searches for matching topics based on player's input.
|
||||
"""
|
||||
is_staff = pobject.is_staff()
|
||||
if topicstr.isdigit():
|
||||
if is_staff:
|
||||
return HelpEntry.objects.filter(id=topicstr)
|
||||
else:
|
||||
return HelpEntry.objects.filter(id=topicstr).exclude(staff_only=1)
|
||||
else:
|
||||
if is_staff:
|
||||
return HelpEntry.objects.filter(topicname__istartswith=topicstr)
|
||||
else:
|
||||
return HelpEntry.objects.filter(topicname__istartswith=topicstr).exclude(staff_only=1)
|
||||
|
||||
def find_topicsuggestions(pobject, topicstr):
|
||||
"""
|
||||
Do a fuzzier "contains" match.
|
||||
"""
|
||||
is_staff = pobject.is_staff()
|
||||
if is_staff:
|
||||
return HelpEntry.objects.filter(topicname__icontains=topicstr)
|
||||
else:
|
||||
return HelpEntry.objects.filter(topicname__icontains=topicstr).exclude(staff_only=1)
|
||||
"""
|
||||
Do a fuzzier "contains" match.
|
||||
"""
|
||||
is_staff = pobject.is_staff()
|
||||
if is_staff:
|
||||
return HelpEntry.objects.filter(topicname__icontains=topicstr)
|
||||
else:
|
||||
return HelpEntry.objects.filter(topicname__icontains=topicstr).exclude(staff_only=1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue