| | 44 | |
| | 45 | # this is a lonely bookmark in the store |
| | 46 | class bookmark : |
| | 47 | # constructor take the path to the bug in the store. |
| | 48 | def __init__(self,path) : |
| | 49 | bug = '' |
| | 50 | search = '' |
| | 51 | product = '' |
| | 52 | title = '' |
| | 53 | zetuple = path.get_selection().get_selected() |
| | 54 | method = zetuple[0].get_value(zetuple[1],1) |
| | 55 | if method == 1: |
| | 56 | # besoin de programmation défensive ici FIXME |
| | 57 | bug = int(zetuple[0].get_value(zetuple[1],2)) |
| | 58 | elif method == 2: |
| | 59 | search = zetuple[0].get_value(zetuple[1],2) |
| | 60 | elif method == 3: |
| | 61 | string = zetuple[0].get_value(zetuple[1],2) |
| | 62 | #here we have to change to have XML |
| | 63 | array = string.split(None,1) |
| | 64 | product = array[0] |
| | 65 | if len(array) < 2 : |
| | 66 | search = None |
| | 67 | else : |
| | 68 | search = array[1] |
| | 69 | self.bug = bug |
| | 70 | self.method = method |
| | 71 | self.search = search |
| | 72 | self.product = product |
| | 73 | self.title = zetuple[0].get_value(zetuple[1],0) |
| | 74 | |
| | 75 | def get_method(self) : |
| | 76 | return self.method |
| | 77 | |
| | 78 | def get_bug(self) : |
| | 79 | return self.bug |
| | 80 | |
| | 81 | def get_search(self) : |
| | 82 | return self.search |
| | 83 | |
| | 84 | def get_product(self) : |
| | 85 | return self.product |
| | 86 | |
| | 87 | def get_title(self) : |
| | 88 | return self.title |