Beispiel #1
0
def copy_simulation(base_dir,cur_dir):
	global copy_materials
	gpvdm_clone(cur_dir,src_archive=os.path.join(base_dir, "sim.gpvdm"),dest="file")
	
	#print(">>>>>>>>>>>>>>>>>>>>>>>materials>>>>>>>>",copy_materials)
	if copy_materials==True:
		clone_materials(cur_dir)
Beispiel #2
0
    def load_sim(self, filename):
        new_path = os.path.dirname(filename)
        if filename.startswith(get_share_path()) == True:
            error_dlg(
                self,
                _("You should not try to open simulations in the root gpvdm directory."
                  ))
            return

        if ver_check_compatibility(filename) == True:
            self.change_dir_and_refresh_interface(new_path)
        else:
            update = yes_no_dlg(
                self,
                _("The simulation you want to import looks like it was made on an old version of gpvdm, do you want to try to open it anyway?"
                  ))

            if update == True:
                update_simulaton_to_new_ver(filename)
                self.change_dir_and_refresh_interface(new_path)

            if os.path.isdir(os.path.join(new_path, "materials")) == False:
                copy = yes_no_dlg(
                    self,
                    _("It looks like there is no materials database in the simulation directory should I import one?"
                      ))
                if copy == True:
                    clone_materials(new_path)
Beispiel #3
0
def copy_simulation(base_dir,cur_dir):
	global copy_materials

	f_list=glob.iglob(os.path.join(base_dir, "*.inp"))
	for inpfile in f_list:
		shutil.copy(inpfile, cur_dir)

	shutil.copy(os.path.join(base_dir, "sim.gpvdm"), cur_dir)

	print(">>>>>>>>>>>>>>>>>>>>>>>materials>>>>>>>>",copy_materials)
	if copy_materials==True:
		clone_materials(cur_dir)