aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-12-15 06:05:23 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2007-12-18 01:12:21 -0800
commit2b93e3b5dfa6bfd32e32acdcb852a99352a64640 (patch)
treea82cd4c58a7fbf61ac90b583f17da352bd48b447
parentRemove unused import. (diff)
downloadgitosis-dakkar-2b93e3b5dfa6bfd32e32acdcb852a99352a64640.tar.gz
gitosis-dakkar-2b93e3b5dfa6bfd32e32acdcb852a99352a64640.tar.bz2
gitosis-dakkar-2b93e3b5dfa6bfd32e32acdcb852a99352a64640.zip
Pylint cleanup.
-rw-r--r--gitosis/serve.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/gitosis/serve.py b/gitosis/serve.py
index 0f9cb5c..805268d 100644
--- a/gitosis/serve.py
+++ b/gitosis/serve.py
@@ -15,7 +15,9 @@ from gitosis import gitdaemon
from gitosis import app
from gitosis import util
-ALLOW_RE = re.compile("^'(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$")
+ALLOW_RE = re.compile(
+ "^'(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$"
+ )
COMMANDS_READONLY = [
'git-upload-pack',
@@ -49,11 +51,8 @@ class WriteAccessDenied(AccessDenied):
class ReadAccessDenied(AccessDenied):
"""Repository read access denied"""
-def serve(
- cfg,
- user,
- command,
- ):
+def serve(cfg, user, command):
+ """Check the git command for sanity, and then run the git command."""
if '\n' in command:
raise CommandMayNotContainNewlineError()
@@ -108,10 +107,10 @@ def serve(
# authorized to do that: create the repository on the fly
# create leading directories
- p = topdir
+ path = topdir
for segment in repopath.split(os.sep)[:-1]:
- p = os.path.join(p, segment)
- util.mkdir(p, 0750)
+ path = os.path.join(path, segment)
+ util.mkdir(path, 0750)
repository.init(path=fullpath)
gitweb.set_descriptions(
@@ -134,7 +133,13 @@ def serve(
return newcmd
class Main(app.App):
+ """gitosis-serve program."""
+ # W0613 - They also might ignore arguments here, where the descendant
+ # methods won't.
+ # pylint: disable-msg=W0613
+
def create_parser(self):
+ """Declare the input for this program."""
parser = super(Main, self).create_parser()
parser.set_usage('%prog [OPTS] USER')
parser.set_description(
@@ -142,6 +147,7 @@ class Main(app.App):
return parser
def handle_args(self, parser, cfg, options, args):
+ """Parse the input for this program."""
try:
(user,) = args
except ValueError:
@@ -167,8 +173,8 @@ class Main(app.App):
user=user,
command=cmd,
)
- except ServingError, e:
- log.error('%s', e)
+ except ServingError, ex:
+ log.error('%s', ex)
sys.exit(1)
log.debug('Serving %s', newcmd)