def person(author): '''get name of author, or else username.''' if not '@' in author: return author f = author.find('<') if f == -1: return util.shortuser(author) return author[:f].rstrip()
"date": lambda x: util.datestr(x), "domain": domain, "email": util.email, "escape": lambda x: cgi.escape(x, True), "fill68": lambda x: fill(x, width=68), "fill76": lambda x: fill(x, width=76), "firstline": firstline, "tabindent": lambda x: indent(x, '\t'), "hgdate": lambda x: "%d %d" % x, "isodate": lambda x: util.datestr(x, '%Y-%m-%d %H:%M %1%2'), "isodatesec": lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2'), "json": json, "jsonescape": jsonescape, "localdate": lambda x: (x[0], util.makedate()[1]), "nonempty": nonempty, "obfuscate": obfuscate, "permissions": permissions, "person": person, "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"), "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"), "hex": node.hex, "short": lambda x: x[:12], "shortdate": util.shortdate, "stringify": stringify, "strip": lambda x: x.strip(), "urlescape": lambda x: urllib.quote(x), "user": lambda x: util.shortuser(x), "stringescape": lambda x: x.encode('string_escape'), "xmlescape": xmlescape, }
"age": age, "date": lambda x: util.datestr(x), "domain": domain, "email": util.email, "escape": lambda x: cgi.escape(x, True), "fill68": lambda x: fill(x, width=68), "fill76": lambda x: fill(x, width=76), "firstline": firstline, "tabindent": lambda x: indent(x, '\t'), "hgdate": lambda x: "%d %d" % x, "isodate": lambda x: util.datestr(x, '%Y-%m-%d %H:%M %1%2'), "isodatesec": lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2'), "json": json, "jsonescape": jsonescape, "localdate": lambda x: (x[0], util.makedate()[1]), "nonempty": nonempty, "obfuscate": obfuscate, "permissions": permissions, "person": person, "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"), "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"), "short": lambda x: x[:12], "shortdate": util.shortdate, "stringify": stringify, "strip": lambda x: x.strip(), "urlescape": lambda x: urllib.quote(x), "user": lambda x: util.shortuser(x), "stringescape": lambda x: x.encode('string_escape'), "xmlescape": xmlescape, }
def userfilter(text): """:user: Any text. Returns a short representation of a user name or email address.""" return util.shortuser(text)
def shortuser(self, user): """Return a short representation of a user name or email address.""" if not self.verbose: user = util.shortuser(user) return user
def userfilter(text): """:user: Any text. Returns the user portion of an email address.""" return util.shortuser(text)