Exemple #1
0
    def removeOtherPreprocessor(self):
        tmp = self.currentFile + "tmp.txt"

        self.backupCurrentFile()  # backup file

        # delete other preprocessor statements than #ifdefs
        cpplib._filterAnnotatedIfdefs(self.currentFile, tmp)

        # move temp file to output file
        shutil.copyfile(tmp, self.currentFile)
    def __init__(self):
        oparser = OptionParser()
        oparser.add_option("-i", "--inputfile", dest="ifile", help="input file (mandatory)")
        oparser.add_option("-o", "--outputfile", dest="ofile", help="output file (mandatory)")
        (self.opts, self.args) = oparser.parse_args()

        if not self.opts.ifile or not self.opts.ofile:
            oparser.print_help()
            sys.exit(-1)

        _filterAnnotatedIfdefs(self.opts.ifile, self.opts.ofile)
Exemple #3
0
    def __init__(self):
        oparser = OptionParser()
        oparser.add_option('-i',
                           '--inputfile',
                           dest='ifile',
                           help='input file (mandatory)')
        oparser.add_option('-o',
                           '--outputfile',
                           dest='ofile',
                           help='output file (mandatory)')
        (self.opts, self.args) = oparser.parse_args()

        if not self.opts.ifile or not self.opts.ofile:
            oparser.print_help()
            sys.exit(-1)

        _filterAnnotatedIfdefs(self.opts.ifile, self.opts.ofile)