equal
deleted
inserted
replaced
6 This software may be used and distributed according to the terms of |
6 This software may be used and distributed according to the terms of |
7 the GNU General Public License version 2, incorporated herein by |
7 the GNU General Public License version 2, incorporated herein by |
8 reference. |
8 reference. |
9 """ |
9 """ |
10 |
10 |
11 from util import Abort |
11 import util |
12 from i18n import _ |
12 from i18n import _ |
13 import errno, msvcrt, os, osutil, re, sys |
13 import errno, msvcrt, os, osutil, re, sys |
14 nulldev = 'NUL:' |
14 nulldev = 'NUL:' |
15 |
15 |
16 umask = 002 |
16 umask = 002 |
226 cache = dircache.setdefault(dir, dmap) |
226 cache = dircache.setdefault(dir, dmap) |
227 yield cache.get(base, None) |
227 yield cache.get(base, None) |
228 |
228 |
229 def getuser(): |
229 def getuser(): |
230 '''return name of current user''' |
230 '''return name of current user''' |
231 raise Abort(_('user name not available - set USERNAME ' |
231 raise util.Abort(_('user name not available - set USERNAME ' |
232 'environment variable')) |
232 'environment variable')) |
233 |
233 |
234 def username(uid=None): |
234 def username(uid=None): |
235 """Return the name of the user with the given uid. |
235 """Return the name of the user with the given uid. |
236 |
236 |
237 If uid is None, return the name of the current user.""" |
237 If uid is None, return the name of the current user.""" |