def button3Clicked(self): log = self.cb.isChecked() if self.CDLfileName and self.METAfileName: self.lbl.setText("...Wait until MessageBox Appears...") Path, _ = os.path.split(os.path.abspath(sys.argv[0])) # Path - is directory of the script itself newCdlName = os.path.join(Path, '_'+os.path.split(str(self.CDLfileName))[1]) make_cdl(str(self.CDLfileName), metafname=str(self.METAfileName), log=log , outpath=Path) print '-'*50+'\nClick Ok button' QtGui.QMessageBox.about(self, "CDL file created successfully", QtCore.QString(newCdlName)) QtCore.QCoreApplication.instance().quit()
if opt in ("-h", "--help", "-?"): print err_msg sys.exit() elif opt in ("-i", "--ifile"): inputfile = arg run += 1 elif opt in ("-m", "--mfile"): metafile = arg run += 1 elif opt in ("-l"): log = True else: print "Invalid argument: {0} {1}".format(opt, arg) print err_msg sys.exit() if run == 2: return inputfile, metafile, log else: print "Not enough arguments" print err_msg sys.exit() log = False Path_script, _ = os.path.split(os.path.abspath(sys.argv[0])) cdlFname, meta, log = read_arguments(sys.argv[1:]) Path_cdl, cdlFname = os.path.split(os.path.abspath(cdlFname)) Path_meta, meta = os.path.split(os.path.abspath(meta)) make_cdl(os.path.join(Path_cdl, cdlFname), metafname=os.path.join(Path_meta, meta), log=log, outpath=Path_script) print "File created successfully >>> ", os.path.join(Path_script, "_" + cdlFname)