Skip to content

Commit 74cb2a3

Browse files
committed
bugzilla: Remove overriding of unused 'version' field
It's supposed to be the API class version, but I don't understand the point and it's been almost entirely ignored.
1 parent eefffb5 commit 74cb2a3

5 files changed

Lines changed: 9 additions & 13 deletions

File tree

bugzilla/base.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,14 @@ class BugzillaBase(object):
253253
to ~/.bugzillacookies. If set to None, the library won't save the
254254
cookies persistently.
255255
'''
256+
257+
# bugzilla version that the class is targetting. filled in by
258+
# subclasses
256259
bz_ver_major = 0
257260
bz_ver_minor = 0
258261

259-
# This is the class API version
262+
# Intended to be the API version of the class, but historically is
263+
# unused and basically worthless since we don't plan on breaking API.
260264
version = "0.1"
261265

262266
@staticmethod
@@ -374,8 +378,8 @@ def _init_private_data(self):
374378
self._components_details = {}
375379

376380
def _get_user_agent(self):
377-
ret = ('Python-urllib bugzilla.py/%s %s/%s' %
378-
(__version__, str(self.__class__.__name__), self.version))
381+
ret = ('Python-urllib bugzilla.py/%s %s' %
382+
(__version__, str(self.__class__.__name__)))
379383
return ret
380384
user_agent = property(_get_user_agent)
381385

bugzilla/bugzilla3.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,19 @@
1313

1414

1515
class Bugzilla3(BugzillaBase):
16-
version = '0.1'
1716
bz_ver_major = 3
1817
bz_ver_minor = 0
1918

2019

2120
class Bugzilla32(Bugzilla3):
22-
version = '0.1'
2321
bz_ver_minor = 2
2422

2523

2624
class Bugzilla34(Bugzilla32):
27-
version = '0.2'
2825
bz_ver_minor = 4
2926

3027

3128
class Bugzilla36(Bugzilla34):
32-
version = '0.1'
3329
bz_ver_minor = 6
3430

3531
def _getbugfields(self):

bugzilla/bugzilla4.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212

1313

1414
class Bugzilla4(Bugzilla36):
15-
'''Concrete implementation of the Bugzilla protocol. This one uses the
16-
methods provided by standard Bugzilla 4.0.x releases.'''
17-
version = '0.1'
1815
bz_ver_major = 4
1916
bz_ver_minor = 0
2017

bugzilla/rhbugzilla.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class RHBugzilla(_parent):
2929
This class was written using bugzilla.redhat.com's API docs:
3030
https://bugzilla.redhat.com/docs/en/html/api/
3131
'''
32-
version = '0.1'
3332

3433
def __init__(self, *args, **kwargs):
3534
"""

tests/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def testUserAgent(self):
6565
b3 = bugzilla.Bugzilla3(url=None, cookiefile=None)
6666
rhbz = bugzilla.RHBugzilla(url=None, cookiefile=None)
6767

68-
self.assertTrue(b3.user_agent.endswith("Bugzilla3/0.1"))
69-
self.assertTrue(rhbz.user_agent.endswith("RHBugzilla/0.1"))
68+
self.assertTrue(b3.user_agent.endswith("Bugzilla3"))
69+
self.assertTrue(rhbz.user_agent.endswith("RHBugzilla"))
7070

7171
def testCookies(self):
7272
if (sys.version_info[0] < 2 or

0 commit comments

Comments
 (0)