def __init__(self, tb_name, fct_name, mode, submode="") : Fctor_infos.__init__(self, tb_name, fct_name, mode, submode="") self.__old_def_txt = self.__read_old_def_txt()
else : shutil.move(self.fcti.get_fct_path(),re.sub('.hpp','.bak',self.fcti.get_fct_path())) write(self.fcti.get_fct_path(),new,True) print "done" def revert_to_old_fctor(self) : if self.fcti.is_already_revised() : if self.fcti.no_restore() : print "no restore allowed for %s" % self.fcti.get_fct_path() return bak = re.sub('.hpp','.bak',self.fcti.get_fct_path()) if exist(bak) : print "reverting %s" % self.fcti.get_fct_path() shutil.move(bak,self.fcti.get_fct_path()) else : print "no bak file for reverting %s" % self.fcti.get_fct_path() else : print "file %s is not already revised" % self.fcti.get_fct_path() if __name__ == "__main__" : print __doc__ from nt2_tb_functors_infos import Fctor_infos fi = Fctor_infos("arithmetic","abs","simd/sse","ssse3") mf = Mk_fctor(fi) print"old=================" show(fi.get_old_fctor_txt()) print"new=================" show(mf.compose_new_fctor_txt()) # mf.save_new_fctor()
def __init__(self, tb_name, fct_name) : Fctor_infos.__init__(self,tb_name, fct_name)