Skip to content

Commit ccdb29d

Browse files
committed
setup.py: Build out 'pylint' command and fix warnings
Also invokes pep8 so this is a huge style cleanup as well. Mostly trivial changes.
1 parent 53e1b18 commit ccdb29d

14 files changed

Lines changed: 850 additions & 644 deletions

bin/bugzilla

Lines changed: 140 additions & 114 deletions
Large diffs are not rendered by default.

bugzilla/__init__.py

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# python-bugzilla - a Python interface to bugzilla using xmlrpclib.
22
#
3-
# Copyright (C) 2007,2008 Red Hat Inc.
3+
# Copyright (C) 2007, 2008 Red Hat Inc.
44
# Author: Will Woods <[email protected]>
55
#
66
# This program is free software; you can redistribute it and/or modify it
@@ -9,18 +9,22 @@
99
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
1010
# the full text of the license.
1111

12-
from bugzilla3 import Bugzilla3, Bugzilla32, Bugzilla34, Bugzilla36
13-
from bugzilla4 import Bugzilla4
14-
from rhbugzilla import RHBugzilla, RHBugzilla3, RHBugzilla4
15-
from nvlbugzilla import NovellBugzilla
16-
from base import version
17-
import xmlrpclib
1812
import logging
13+
import xmlrpclib
14+
15+
from bugzilla.base import version
16+
from bugzilla.bugzilla3 import Bugzilla3, Bugzilla32, Bugzilla34, Bugzilla36
17+
from bugzilla.bugzilla4 import Bugzilla4
18+
from bugzilla.nvlbugzilla import NovellBugzilla
19+
from bugzilla.rhbugzilla import RHBugzilla, RHBugzilla3, RHBugzilla4
20+
1921
log = logging.getLogger("bugzilla")
2022

2123
# advertised class list
22-
classlist = ['Bugzilla3', 'Bugzilla32', 'Bugzilla34', 'Bugzilla36', 'Bugzilla4',
23-
'RHBugzilla3', 'RHBugzilla4', 'NovellBugzilla']
24+
classlist = ['Bugzilla3', 'Bugzilla32', 'Bugzilla34',
25+
'Bugzilla36', 'Bugzilla4', 'RHBugzilla3', 'RHBugzilla4',
26+
'NovellBugzilla']
27+
2428

2529
def getBugzillaClassForURL(url):
2630
log.debug("Choosing subclass for %s" % url)
@@ -66,19 +70,24 @@ def getBugzillaClassForURL(url):
6670

6771
return c
6872

73+
6974
class Bugzilla(object):
7075
'''Magical Bugzilla class that figures out which Bugzilla implementation
7176
to use and uses that. Requires 'url' parameter so we can check available
7277
XMLRPC methods to determine the Bugzilla version.'''
73-
def __init__(self,**kwargs):
74-
log.info("Bugzilla v%s initializing" % base.version)
75-
if 'url' in kwargs:
76-
c = getBugzillaClassForURL(kwargs['url'])
77-
if c:
78-
self.__class__ = c
79-
c.__init__(self,**kwargs)
80-
log.info("Chose subclass %s v%s" % (c.__name__,c.version))
81-
else:
82-
raise ValueError, "Couldn't determine Bugzilla version for %s" % kwargs['url']
78+
def __init__(self, **kwargs):
79+
log.info("Bugzilla v%s initializing" % version)
80+
if 'url' not in kwargs:
81+
raise TypeError("You must pass a valid bugzilla xmlrpc.cgi URL")
82+
83+
# pylint: disable=W0233
84+
# Use of __init__ of non parent class
85+
86+
c = getBugzillaClassForURL(kwargs['url'])
87+
if c:
88+
self.__class__ = c
89+
c.__init__(self, **kwargs)
90+
log.info("Chose subclass %s v%s" % (c.__name__, c.version))
8391
else:
84-
raise TypeError, "You must pass a valid bugzilla xmlrpc.cgi URL"
92+
raise ValueError("Couldn't determine Bugzilla version for %s" %
93+
kwargs['url'])

0 commit comments

Comments
 (0)