~bakrss.developers/bakrss/main

« back to all changes in this revision

Viewing changes to feedgtk.py

  • Committer: Luca Livraghi
  • Date: 2009-03-26 20:58:26 UTC
  • Revision ID: luca.91@hotmail.it-20090326205826-dm6oco17z336sdoe
feeds loaded when refresh is clicked

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        self.colonna_nome=gtk.TreeViewColumn('Site')
33
33
        self.colonna_date=gtk.TreeViewColumn('Date')
34
34
        self.colonna_link=gtk.TreeViewColumn('Link')
35
 
        line=1
36
 
        feeds=self.parser(self.sito)
37
 
        for key in feeds.keys():
38
 
            self.liststore.append([line,feeds[key][0],feeds[key][1],key])
39
 
            line+=1
40
 
        
41
35
        self.treeview.append_column(self.colonna_cont)
42
36
        self.treeview.append_column(self.colonna_nome)
43
37
        self.treeview.append_column(self.colonna_date)
74
68
        #Treeview added in a scrolledwindow
75
69
        self.scrolledwindow.add_with_viewport(self.treeview)
76
70
        self.window.show_all()
77
 
    """
78
 
    def parsa(self,site):
79
 
            diz={}
80
 
            d=feedparser.parse(site)
81
 
            for i in range(0,len(d['items'])):
82
 
                    tmp=[]
83
 
                    titolo=d['items'][i].title
84
 
                    link=d['items'][i].links[0]['href']
85
 
                    data=d['items'][i].updated
86
 
                    data=data[:-5]
87
 
                    tmp.append(data)
88
 
                    tmp.append(link)
89
 
                    diz[titolo]=tmp
90
 
            return diz
91
 
        """
 
71
        
92
72
    def parser(self,site):
93
73
            diz = {}
94
74
            for sit in site.keys():
109
89
        Add_dialog()
110
90
        
111
91
    def on_refresh_btn_clicked(self, widget):
112
 
        #TODO: insert here code if refresh button is clicked
113
 
        pass
 
92
        line=1
 
93
        feeds=self.parser(self.sito)
 
94
        for key in feeds.keys():
 
95
            self.liststore.append([line,feeds[key][0],feeds[key][1],key])
 
96
            line+=1
114
97
        
115
98
    def main(self):
116
99
        gtk.main()