Skip to content

Commit a35e7f5

Browse files
committed
bugzilla: Move the old compat classes to oldclasses.py
To make it more explicit that this is all back compat stuff and we shouldn't carry that pattern forward
1 parent 741bb9f commit a35e7f5

6 files changed

Lines changed: 33 additions & 72 deletions

File tree

bugzilla/__init__.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,18 @@
1919
from xmlrpclib import Fault, ServerProxy
2020

2121
from .apiversion import version, __version__
22-
from .base import BugzillaBase as _BugzillaBase
22+
from .base import BugzillaBase
2323
from .transport import BugzillaError, _RequestsTransport
24-
from .bugzilla3 import Bugzilla3, Bugzilla32, Bugzilla34, Bugzilla36
25-
from .bugzilla4 import Bugzilla4, Bugzilla42, Bugzilla44
26-
from .rhbugzilla import RHBugzilla, RHBugzilla3, RHBugzilla4
24+
from .rhbugzilla import RHBugzilla
25+
from .oldclasses import (Bugzilla3, Bugzilla32, Bugzilla34, Bugzilla36,
26+
Bugzilla4, Bugzilla42, Bugzilla44,
27+
NovellBugzilla, RHBugzilla3, RHBugzilla4)
2728

2829
log = getLogger(__name__)
2930

3031

31-
# Back compat for deleted NovellBugzilla
32-
class NovellBugzilla(Bugzilla44):
33-
pass
34-
35-
3632
def _getBugzillaClassForURL(url, sslverify):
37-
url = Bugzilla3.fix_url(url)
33+
url = BugzillaBase.fix_url(url)
3834
log.debug("Detecting subclass for %s", url)
3935
s = ServerProxy(url, _RequestsTransport(url, sslverify=sslverify))
4036

@@ -56,7 +52,7 @@ def _getBugzillaClassForURL(url, sslverify):
5652
pass
5753

5854

59-
class Bugzilla(_BugzillaBase):
55+
class Bugzilla(BugzillaBase):
6056
'''
6157
Magical Bugzilla class that figures out which Bugzilla implementation
6258
to use and uses that.
@@ -74,6 +70,8 @@ def _init_class_from_url(self, url, sslverify):
7470
return True
7571

7672

73+
del(BugzillaBase)
74+
7775
# This is the list of possible Bugzilla instances an app can use,
7876
# bin/bugzilla used to use it for the --bztype field
7977
classlist = [

bugzilla/bugzilla3.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

bugzilla/bugzilla4.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

bugzilla/oldclasses.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This program is free software; you can redistribute it and/or modify it
2+
# under the terms of the GNU General Public License as published by the
3+
# Free Software Foundation; either version 2 of the License, or (at your
4+
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
5+
# the full text of the license.
6+
7+
from .base import BugzillaBase
8+
from .rhbugzilla import RHBugzilla
9+
10+
11+
# These are old compat classes. Nothing new should be added here,
12+
# and these should not be altered
13+
14+
class Bugzilla3(BugzillaBase): pass
15+
class Bugzilla32(BugzillaBase): pass
16+
class Bugzilla34(BugzillaBase): pass
17+
class Bugzilla36(BugzillaBase): pass
18+
class Bugzilla4(BugzillaBase): pass
19+
class Bugzilla42(BugzillaBase): pass
20+
class Bugzilla44(BugzillaBase): pass
21+
class NovellBugzilla(BugzillaBase): pass
22+
class RHBugzilla3(RHBugzilla): pass
23+
class RHBugzilla4(RHBugzilla): pass

bugzilla/rhbugzilla.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -484,12 +484,3 @@ def make_bool_str(prefix):
484484
query.update(newquery)
485485
self.pre_translation(query)
486486
return query
487-
488-
489-
# Just for API back compat
490-
class RHBugzilla3(RHBugzilla):
491-
pass
492-
493-
494-
class RHBugzilla4(RHBugzilla):
495-
pass

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _run(self):
137137
print("running pep8")
138138
cmd = "pep8 "
139139
cmd += " ".join(files)
140-
os.system(cmd + " --config tests/pep8.cfg")
140+
os.system(cmd + " --config tests/pep8.cfg --exclude oldclasses.py")
141141

142142
def run(self):
143143
os.link("bin/bugzilla", "bin-bugzilla")

0 commit comments

Comments
 (0)