Move utilities to seperate file
This commit is contained in:
parent
2529c2d238
commit
966034bdde
2 changed files with 21 additions and 3 deletions
|
|
@ -1,8 +1,5 @@
|
|||
import time
|
||||
|
||||
def mention(name):
|
||||
return "".join(c for c in name if not c in ".!?;&<'\"" and not c.isspace())
|
||||
|
||||
class SessionView():
|
||||
"""
|
||||
This class keeps track of session details.
|
||||
|
|
|
|||
21
yaboli/utils.py
Normal file
21
yaboli/utils.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
def mention(name):
|
||||
"""
|
||||
mention(name) -> name
|
||||
|
||||
Removes all whitespace and some special characters from the name,
|
||||
such that the resulting name, if prepended with a "@", will mention the user.
|
||||
"""
|
||||
|
||||
return "".join(c for c in name if not c in ".!?;&<'\"" and not c.isspace())
|
||||
|
||||
def reduce_name(name):
|
||||
"""
|
||||
reduce_name(name) -> name
|
||||
|
||||
Reduces a name to a form which can be compared with other such forms.
|
||||
If two such forms are equal, they are both mentioned by the same @mentions,
|
||||
and should be considered identical when used to identify users.
|
||||
"""
|
||||
|
||||
#TODO: implement
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue