From 9b57dcb13c3236903a1923e3a0de058944084da2 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 15 Dec 2007 05:11:15 -0800 Subject: Pylint cleanups for group.py. --- gitosis/group.py | 20 ++++++++++++++++---- 1 file 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() -- cgit v1.2.3