Changeset 30 for storage

Show
Ignore:
Timestamp:
07/09/06 11:28:48 (2 years ago)
Author:
ploum
Message:

End of refactorization before XML transition

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • storage/bookmarks_store.py

    r29 r30  
    88        sys.exit(1) 
    99 
     10# this class represent the whole bookmarks list 
    1011class bookmarks_store : 
    1112        # bts_name is a string arg. It will be used to have 
     
    4142                #the stored bookmarks. (sync with storage) 
    4243                self.listing.remove(to_delete) 
     44 
     45# this is a lonely bookmark in the store 
     46class 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