~denimnumber1/quickly-ide/trunk

« back to all changes in this revision

Viewing changes to quickly_ide/QuicklyIdeWindow.py

  • Committer: Denis Kovalskiy
  • Date: 2012-07-22 14:42:14 UTC
  • Revision ID: denimnumber1@gmail.com-20120722144214-t858pkqozl61jvlw
Fix reading settings

Show diffs side-by-side

added added

removed removed

Lines of Context:
751
751
            pickle.dump(self.projects_list, projectsfile)
752
752
              
753
753
    def restore_state(self):
 
754
        self.load_projects_list()
754
755
        if not os.path.exists(CONFIG_PATH): return
755
 
        
 
756
 
756
757
        config = ConfigParser.RawConfigParser()
757
758
        try:
758
759
            config.read(str(CONFIG_PATH + "window.cache"))
764
765
        except:
765
766
            return    
766
767
        self.resize(width, height)
767
 
        
768
 
        self.load_projects_list()
769
768
            
770
769
    def load_projects_list(self):
771
770
        path = str(CONFIG_PATH + "projects.db")
772
771
        
773
772
        if os.path.exists(path):
774
 
            f = open(path, "rb")
775
 
            self.projects_list = pickle.load(f)
776
 
            f.close()
777
 
            return
 
773
            try:
 
774
                f = open(path, "rb")
 
775
                self.projects_list = pickle.load(f)
 
776
                f.close()
 
777
                return
 
778
            except:
 
779
                self.projects_list = []    
778
780
        else:        
779
781
            self.projects_list = []        
780
782