예제 #1
0
    def afterinit(self):
        try:
            logging.info("mo.start gets called")
            try:
                logging.info("checking registry for past data")
                self.last_location = reg.get_reg("profiles_dir")
                print(self.last_location)
                self.last_master = int(reg.get_reg("last_master"))
                self.mods_dir = reg.get_reg("mods_dir")
                if len(self.last_location) < 3:
                    print("warum error?")
                    logging.info("last location empty?")
                    raise IOError
                logging.info("calling mo.start")
                logging.info(self.last_location)
                print("last location: " + str(self.last_location))
                mo.start(str(self.last_location))
                print("check 7")
            except:
                print("no reg data")
                logging.info("no registry data found / registry data has errors?")
                mo.start(filedialog.askdirectory(title="Open profiles directory"))
                self.last_master = 0
                self.mods_dir = ""

            self.importdir = ""
            self.profiledirsbak = mo.profiledirsbak
            self.activeprofiles = []
            self.activeprofiles2 = []
            for i in range(0, len(mo.moprofiles)):
                self.activeprofiles.append("disabled")
                self.activeprofiles2.append("disabled")
            print("check 4")
            mo.activeprofiles=self.activeprofiles
            mo.activeprofiles2=self.activeprofiles2
            logging.info("creating widgets")
            print("check widgets")
            self.createWidgets()
            print("check 5")
            logging.info("creating image")
            self.createImage()
            print("check 6")
        except:
            try:
                print("afterinit2")
                self.afterinit2()
            except:
                print("wtf")
                logging.warning("mo.start returned an error or there was a problem with the first afterinit") 
                self.exit()
예제 #2
0
 def afterinit2(self):
     logging.info("mo.start gets called")
     mo.start(filedialog.askdirectory(title="Open profiles directory"))
     self.importdir = ""
     self.last_master = 0
     self.profiledirsbak = mo.profiledirsbak
     self.activeprofiles = []
     self.activeprofiles2 = []
     for i in range(0, len(mo.moprofiles)):
         self.activeprofiles.append("disabled")
         self.activeprofiles2.append("disabled")
     mo.activeprofiles=self.activeprofiles
     mo.activeprofiles2=self.activeprofiles2
     self.refresh()
     self.createWidgets()
     self.createImage()