Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 1129:ee4f60abad93
Move generating short username to display in hg/hgweb annotate to ui module.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sun, 28 Aug 2005 17:29:28 +0200 |
parents | 8f0ac653f85e |
children | d32b91ebad5d |
comparison
equal
deleted
inserted
replaced
1128:8bf19f96b97a | 1129:ee4f60abad93 |
---|---|
76 os.environ.get("EMAIL") or | 76 os.environ.get("EMAIL") or |
77 (os.environ.get("LOGNAME", | 77 (os.environ.get("LOGNAME", |
78 os.environ.get("USERNAME", "unknown")) | 78 os.environ.get("USERNAME", "unknown")) |
79 + '@' + socket.getfqdn())) | 79 + '@' + socket.getfqdn())) |
80 | 80 |
81 def shortuser(self, user): | |
82 """Return a short representation of a user name or email address.""" | |
83 f = user.find('@') | |
84 if f >= 0: | |
85 user = user[:f] | |
86 f = user.find('<') | |
87 if f >= 0: | |
88 user = user[f+1:] | |
89 return user | |
90 | |
81 def expandpath(self, loc): | 91 def expandpath(self, loc): |
82 paths = {} | 92 paths = {} |
83 for name, path in self.configitems("paths"): | 93 for name, path in self.configitems("paths"): |
84 paths[name] = path | 94 paths[name] = path |
85 | 95 |