Mercurial > hg
comparison mercurial/util.py @ 1903:e4abeafd6eb1
move shortuser into util module.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 27 Feb 2006 11:32:10 -0800 |
parents | ae61937c61c5 |
children | b7cc0f323a4c |
comparison
equal
deleted
inserted
replaced
1902:1cc5f25653a3 | 1903:e4abeafd6eb1 |
---|---|
688 t, tz = date or makedate() | 688 t, tz = date or makedate() |
689 return ("%s %+03d%02d" % | 689 return ("%s %+03d%02d" % |
690 (time.strftime(format, time.gmtime(float(t) - tz)), | 690 (time.strftime(format, time.gmtime(float(t) - tz)), |
691 -tz / 3600, | 691 -tz / 3600, |
692 ((-tz % 3600) / 60))) | 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 |