diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2007-12-15 05:11:15 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2007-12-18 01:12:21 -0800 |
commit | 9b57dcb13c3236903a1923e3a0de058944084da2 (patch) | |
tree | bcdc547082040c215ef9d251cdb263cf094d7042 /gitosis | |
parent | Clean up gitweb.py to pass pylint, including refactoring out duplicate code. (diff) | |
download | gitosis-dakkar-9b57dcb13c3236903a1923e3a0de058944084da2.tar.gz gitosis-dakkar-9b57dcb13c3236903a1923e3a0de058944084da2.tar.bz2 gitosis-dakkar-9b57dcb13c3236903a1923e3a0de058944084da2.zip |
Pylint cleanups for group.py.
Diffstat (limited to 'gitosis')
-rw-r--r-- | gitosis/group.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gitosis/group.py b/gitosis/group.py index 975bbc5..ffee613 100644 --- a/gitosis/group.py +++ b/gitosis/group.py @@ -1,14 +1,27 @@ +""" +Gitosis functions to find what groups a given user belongs to. +""" import logging from ConfigParser import NoSectionError, NoOptionError + +_GROUP_PREFIX = 'group ' def _getMembership(config, user, seen): + """ + Internal implementation of getMembership. + Generate groups ``user`` is member of, according to ``config``. + Groups already seen are tracked by ``seen``. + + :type config: RawConfigParser + :type user: str + :type seen: Set + """ log = logging.getLogger('gitosis.group.getMembership') for section in config.sections(): - GROUP_PREFIX = 'group ' - if not section.startswith(GROUP_PREFIX): + if not section.startswith(_GROUP_PREFIX): continue - group = section[len(GROUP_PREFIX):] + group = section[len(_GROUP_PREFIX):] if group in seen: continue @@ -39,7 +52,6 @@ def getMembership(config, user): :type config: RawConfigParser :type user: str - :param _seen: internal use only """ seen = set() |