Logo Search packages:      
Sourcecode: hgview version File versions  Download package

def hgviewlib::config::HgConfig::getUsers (   self  ) 

users: path of the file holding users configurations

Definition at line 73 of file config.py.

00073                       :
        users: path of the file holding users configurations
        users = {}
        aliases = {}
        usersfile = self.ui.config(self.section, 'users',
                                   os.path.join('~', ".hgusers"))
        cfgfile = None
        if usersfile:
                cfgfile = open(os.path.expanduser(usersfile))
            except IOError:
                cfgfile = None

        if cfgfile:
            currid = None
            for line in cfgfile:
                line = line.strip()
                if not line or line.startswith('#'):
                cmd, val = line.split('=', 1)
                if cmd == 'id':
                    currid = val
                    if currid in users:
                        print "W: user %s is defined several times" % currid
                    users[currid] = {'aliases': set()}
                elif cmd == "alias":
                    if val in aliases:
                        print ("W: alias %s is used in several "
                               "user definitions" % val)
                    aliases[val] = currid
                    users[currid][cmd] = val
        return users, aliases

    def getFileModifiedColor(self, default='blue'):

Generated by  Doxygen 1.6.0   Back to index