aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-12-15 05:11:15 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2007-12-18 01:12:21 -0800
commit9b57dcb13c3236903a1923e3a0de058944084da2 (patch)
treebcdc547082040c215ef9d251cdb263cf094d7042
parentClean up gitweb.py to pass pylint, including refactoring out duplicate code. (diff)
downloadgitosis-dakkar-9b57dcb13c3236903a1923e3a0de058944084da2.tar.gz
gitosis-dakkar-9b57dcb13c3236903a1923e3a0de058944084da2.tar.bz2
gitosis-dakkar-9b57dcb13c3236903a1923e3a0de058944084da2.zip
Pylint cleanups for group.py.
-rw-r--r--gitosis/group.py20
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()