Exemplo n.º 1
0
 def changed_item_years(self,widget):
     #activated when combobox value holding years is changed
   
     #creates a file(if not present) and opens it and reads its contents
     self.fname=app.data_location+str(widget.get_active_text())+'_'+self.combobox.get_active_text()
     f=open(self.fname,'a')
     f.close()
     f=open(self.fname,'r')
     x=f.readlines()
     f.close()
     #print 1
     update_list.main(self.fname)
     
     try:
       self.treeView.set_model(self.create_model())
       #model=self.treeView.get_model()
     except AttributeError:
       pass
     self.graphs(1)
     self.graphs(2)
     stats.update(self.fname)
     stats.treeView.set_model(stats.create_model(self))
     try:
       viewer.update(self,'')
       viewer.treeView.set_model(viewer.create_model(self))
     except AttributeError:
       pass
Exemplo n.º 2
0
 def edit(self,widget):
     self.treeView.set_model(self.create_model())
     model=self.treeView.get_model()
     edit.edit(self.fname)
     #print 1
     
     update_list.main(self.fname)
       
     self.treeView.set_model(self.create_model())
     model=self.treeView.get_model()
     '''print 1
     for i in model:
         for j in i:
           print j,
         print
     print 2
     '''
     self.graphs(1)
     self.graphs(2)
     stats.update(self.fname)
     stats.treeView.set_model(stats.create_model(self))
     try:
       viewer.update(self,'')
       viewer.treeView.set_model(viewer.create_model(self))
     except AttributeError:
       pass
Exemplo n.º 3
0
    def changed_item(self,widget):
        #activated when combobox value holding months is changed
        #self.yy='2012'
        a= widget.get_active_text()
        
        try:
          #print type(self.combobox2.get_active_text())
          self.fname=app.data_location+self.combobox2.get_active_text()+'_'+a
          #print self.fname
          
          f=open(self.fname,'a')
          f.close()
          f=open(self.fname,'r')
          x=f.readlines()
          f.close()
        #print 1
          update_list.main(self.fname)
        except AttributeError:
          f=open(app.data_location+str(self.yy)+'_'+str(self.months[self.mm]),'a')
          f.close()
          update_list.main(app.data_location+str(self.yy)+'_'+self.combobox.get_active_text())
          pass
        
        try:
          self.treeView.set_model(self.create_model())
          #model=self.treeView.get_model()
        except AttributeError:
          pass
        
        #del self.line
        self.graphs(1)
        self.graphs(2)
        
        try:
          stats.update(self.fname)
          stats.treeView.set_model(stats.create_model(self))
        
        
          viewer.update(self,self.fname)
          viewer.treeView.set_model(viewer.create_model(self))
        except AttributeError:
          pass

        
        
        
      
          viewer.treeView.set_model(viewer.create_model(self))
        except AttributeError:
          pass