root/bug.py

Revision 69, 1.8 kB (checked in by ploum, 20 months ago)

Only display the comment form if you can actually post one.
It fixes #61 for now

Line 
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3import gtk
4import gobject
5
6class bug:
7
8        # a negative number means that the bug doesn't exist
9        def setNbr(self,n):
10                self.nbr=n
11
12        def getNbr(self):
13                return self.nbr
14
15        def setPackage(self,s):
16                self.package=s
17
18        def getPackage(self):
19                return self.package
20
21        def setTitle(self,string):
22                self.title = string
23
24        def getTitle(self):
25                return self.title
26
27        def setDate() :
28                print "hello"
29
30        def getDate() :
31                print "hello"
32
33        def setDescription(self,string) :
34                self.description = string
35       
36        def getDescription(self) :
37                return self.description
38
39        def setStatus(self,string) :
40                self.status = string
41
42        def getStatus(self) :
43                return self.status
44
45        def setImportance (self, string) :
46                self.importance = string
47
48        def getImportance (self) :
49                return self.importance
50
51        def setAssignee (self, string) :
52                self.assignee = string
53
54        def getAssignee (self) :
55                return self.assignee
56
57        def setAllComments (self,array) :
58                self.comments = array
59
60        def getAllComments (self) :
61                return self.comments
62
63        def addComment (self,to_add) :
64                self.comments.append(to_add)
65
66        def comNbr(self) :
67                return len(self.comments)
68               
69        # Editable properties of the bug
70        def isCommentable(self) :
71                return self.commentable
72       
73        def setCommentable(self,boolean) :
74                self.commentable = boolean
75
76       
77        def __init__(self,n):
78                self.nbr=n
79                #initialization of empty values
80                self.title=""
81                self.description=""
82                self.importance=""
83                self.status=""
84                self.package=""
85                self.assignee=""
86                self.comments=[]
87                #editable
88                self.commentable = False
89
90class comment:
91
92        def __init__(self,n,c,a,t,d):
93                self.nbr=n
94                self.content=c
95                self.author=a
96                self.title=t
97                self.date=d     
98       
99        def getNumber(self):
100                return self.nbr
101
102        def getContent(self):
103                return self.content
104
105        def getAuthor(self):
106                return self.author
107
108        def getTitle(self):
109                return self.title
110
111        def getDate(self):
112                return self.date
Note: See TracBrowser for help on using the browser.