Пример #1
0
    def _uid(self, uid):
        _name = util.get_user(uid)

        if _name is not None:
            return "%s (%s)" % (bstring(uid), _name)
        else:
            return bstring(uid)
Пример #2
0
    def _make_dummy_dir(self, name):
        """
        Make dummy directory object
        """

        uid = os.getuid()
        gid = os.getgid()

        obj = tarfile.TarInfo(name)
        obj.type = tarfile.DIRTYPE
        obj.mode = 0755
        obj.uid = uid
        obj.gid = gid
        obj.mtime = int(time.time())
        obj.uname = util.get_user(uid)
        obj.gname = util.get_group(gid)

        return obj