Remove special formatting function
This commit is contained in:
parent
c075287222
commit
fdfb7cb7f1
1 changed files with 0 additions and 21 deletions
|
|
@ -61,27 +61,6 @@ class Session():
|
||||||
|
|
||||||
return "".join(c for c in self.name if not c in ",.!?;&<'\"" and not c.isspace()).lower()
|
return "".join(c for c in self.name if not c in ",.!?;&<'\"" and not c.isspace()).lower()
|
||||||
|
|
||||||
def listable(self, width):
|
|
||||||
"""
|
|
||||||
listable(width): -> prefixes, name
|
|
||||||
|
|
||||||
Prefixes and name which together are <width> characters long or shorter.
|
|
||||||
"""
|
|
||||||
|
|
||||||
prefixes = ""
|
|
||||||
if self.session_type() == "account":
|
|
||||||
prefixes += "*"
|
|
||||||
if self.is_manager():
|
|
||||||
prefixes += "m"
|
|
||||||
if self.is_staff():
|
|
||||||
prefixes += "s"
|
|
||||||
|
|
||||||
name = self.name()
|
|
||||||
if len(prefixes + name) > width:
|
|
||||||
name = name[:width - len(prefixes) - 1] + "…"
|
|
||||||
|
|
||||||
return prefixes, name
|
|
||||||
|
|
||||||
def is_staff(self):
|
def is_staff(self):
|
||||||
"""
|
"""
|
||||||
is_staff() -> bool
|
is_staff() -> bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue