def __load_repo(self):
    """
    Read gitolite config file
    """

    repo_data = {}

    #repo [username]/[reponame]
    # RW+ = [username]

    repo_file_content = open(self._user_repo_config, 'r')

    line = repo_file_content.readline().strip()
    repo = ''

    while line != '':

      if line.startswith('repo'):
        line_split = line.split(None, 1)
        if len(line_split) != 2:
          raise SyntaxError('Invalid repository def.')
        repo = line_split[1].strip()
      elif line.startswith(' '):
        if repo == '':
          raise SyntaxError('Missing repo def.')

        line_split = line.split('=', 1)
        if len(line_split) != 2:
          raise SyntaxError('Invalid rule')

        perm = line_split[0].strip()
        user = line_split[1].strip()

        if repo not in repo_data:
          repo_data[repo] = []

        repo_data[repo].append( ( perm, user) )
      else:
        raise SyntaxError('Invalid line')

      line = repo_file_content.readline()

    repo_file_content.close()
  
    return repo_data
dataset/ETHPy150Open smailq/gitolite-manager/gitolite_manager/gitolite.py/Gitolite.__load_repo/original