def init(self,index): self.index=index self.sim_mode = gtk.combo_box_entry_new_text() self.sim_mode.set_size_request(-1, 20) lines=[] inp_load_file(lines,find_data_file("pulse"+str(self.index)+".inp")) self.sim_mode.append_text("open_circuit") self.sim_mode.append_text("load") self.sim_mode.child.connect('changed', self.call_back_sim_mode_changed) token=inp_get_token_value("pulse"+str(self.index)+".inp", "#pulse_sim_mode") liststore = self.sim_mode.get_model() for i in xrange(len(liststore)): if liststore[i][0] == token: self.sim_mode.set_active(i) lable=gtk.Label("Load type:") #lable.set_width_chars(15) lable.show() hbox = gtk.HBox(False, 2) hbox.pack_start(lable, False, False, 0) hbox.pack_start(self.sim_mode, False, False, 0) self.add(hbox); self.show_all()
def ver_load_info(): lines=[] global core global gui global mat global ver_error core="" gui="" mat="" ver_error="" if inp_load_file(lines,find_data_file("ver.inp"))==True: core=lines[1] gui=lines[3] mat=lines[5] return True else: ver_error="I can not find the file sim.opvdm/ver.inp.\n\nI have tried looking in "+find_data_file("ver.inp")+"\n\nThe share path is"+get_share_path()+"\n\nThe bin path is"+get_bin_path()+"\n\nThe current working dir is "+os.getcwd()+"\n\nTry reinstalling a new version of opvdm and/or report the bug to me at [email protected]." return False