##// END OF EJS Templates
move shortuser into util module.
Vadim Gelfer -
r1903:e4abeafd default
parent child Browse files
Show More
@@ -104,13 +104,7 b' class ui(object):'
104 104
105 105 def shortuser(self, user):
106 106 """Return a short representation of a user name or email address."""
107 if not self.verbose:
108 f = user.find('@')
109 if f >= 0:
110 user = user[:f]
111 f = user.find('<')
112 if f >= 0:
113 user = user[f+1:]
107 if not self.verbose: user = util.shortuser(user)
114 108 return user
115 109
116 110 def expandpath(self, loc, root=""):
@@ -690,3 +690,13 b" def datestr(date=None, format='%c'):"
690 690 (time.strftime(format, time.gmtime(float(t) - tz)),
691 691 -tz / 3600,
692 692 ((-tz % 3600) / 60)))
693
694 def shortuser(user):
695 """Return a short representation of a user name or email address."""
696 f = user.find('@')
697 if f >= 0:
698 user = user[:f]
699 f = user.find('<')
700 if f >= 0:
701 user = user[f+1:]
702 return user
General Comments 0
You need to be logged in to leave comments. Login now