~parinporecha/gtg/config_parser_bug

« back to all changes in this revision

Viewing changes to GTG/plugins/bugzilla/bug.py

  • Committer: Izidor Matušov
  • Date: 2013-02-25 07:35:07 UTC
  • Revision ID: izidor.matusov@gmail.com-20130225073507-vgts69uthx7z2run
PEP8ification by Nimit

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# You should have received a copy of the GNU General Public License along with
15
15
# this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
 
#this handles old versions of pybugz as well as new ones
 
17
# this handles old versions of pybugz as well as new ones
18
18
try:
19
19
    from bugz import bugzilla
20
20
except:
21
21
    import bugz as bugzilla
22
22
 
23
 
#changed the default action to skip auth
 
23
# changed the default action to skip auth
 
24
 
24
25
 
25
26
class Bug:
26
27
 
27
28
    def __init__(self, base, nb):
28
 
        #this also handles old versions of pybugz
 
29
        # this also handles old versions of pybugz
29
30
        try:
30
 
            bugs = bugzilla.BugzillaProxy(base, skip_auth=True).Bug.get({ 'ids': [nb,], })
 
31
            bugs = bugzilla.BugzillaProxy(
 
32
                base, skip_auth=True).Bug.get({'ids': [nb, ], })
31
33
        except:
32
 
            bugs = bugzilla.BugzillaProxy(base).Bug.get({ 'ids': [nb,], })
 
34
            bugs = bugzilla.BugzillaProxy(base).Bug.get({'ids': [nb, ], })
33
35
        self.bug = bugs['bugs'][0]
34
36
 
35
37
    def get_title(self):
46
48
 
47
49
if __name__ == '__main__':
48
50
    for bug in [Bug('https://bugzilla.gnome.org', '598354'),
49
 
            Bug('https://bugs.freedesktop.org', '24120')]:
 
51
                Bug('https://bugs.freedesktop.org', '24120')]:
50
52
        print "title:", bug.get_title()
51
53
        print "product:", bug.get_product()
52
54
        print "component:", bug.get_component()