def setOutFile(self): if '\\' in self.__currentdataset__: datasetName = self.__currentdataset__.split("\\")[-1].split('-')[0] else: datasetName = self.__currentdataset__.split("/")[-1].split('-')[0] fpath = os.path.join(self.__root__, 'a_s' + Configs.version) fpath = os.path.join(fpath, 'a_Column') check_folder(fpath) self.__currentoutfile__ = os.path.join(fpath, datasetName) del_dir_tree(self.__currentoutfile__)
def _agp_main_runner(dataName, aimFolder): std = sys.stdout try: Configs.dataName = dataName Configs.aimFolder = aimFolder _rootp = Configs.root_path _rootp = os.path.join(_rootp, 'Results/' + Configs.version) _rootp = os.path.join(_rootp, Configs.dataName + "-v" + Configs.version) _rootp = os.path.join(_rootp, Configs.aimFolder) del_dir_tree(_rootp) # delete former results check_folder(_rootp) _res = "/Result" out = open(_rootp + _res, 'w+') sys.stdout = out sys.stderr = out AGpEcocStart.main_run() except Exception as e: _err = "/Error" err = open(_rootp + _err, 'w+') err.write(e.message) err.flush() finally: sys.stdout = std