当前位置: 首页>>代码示例>>Python>>正文


Python CMakeFileEditor.remove_double_newlines方法代码示例

本文整理汇总了Python中cmakefile_editor.CMakeFileEditor.remove_double_newlines方法的典型用法代码示例。如果您正苦于以下问题:Python CMakeFileEditor.remove_double_newlines方法的具体用法?Python CMakeFileEditor.remove_double_newlines怎么用?Python CMakeFileEditor.remove_double_newlines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmakefile_editor.CMakeFileEditor的用法示例。


在下文中一共展示了CMakeFileEditor.remove_double_newlines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _add_qa36

# 需要导入模块: from cmakefile_editor import CMakeFileEditor [as 别名]
# 或者: from cmakefile_editor.CMakeFileEditor import remove_double_newlines [as 别名]
 def _add_qa36():
     " Add C++ QA files for pre-3.7 API (not autotools) "
     fname_qa_cc = 'qa_%s.cc' % self._info['fullblockname']
     self._write_tpl('qa_cpp36', 'lib', fname_qa_cc)
     if not self.options.skip_cmakefiles:
         open(self._file['cmlib'], 'a').write(
                 str(
                     Cheetah.Template.Template(
                         Templates['qa_cmakeentry36'],
                         searchList={'basename': os.path.splitext(fname_qa_cc)[0],
                                     'filename': fname_qa_cc,
                                     'modname': self._info['modname']
                                    }
                     )
                  )
         )
         ed = CMakeFileEditor(self._file['cmlib'])
         ed.remove_double_newlines()
         ed.write()
开发者ID:FalconJeff,项目名称:gnuradio,代码行数:21,代码来源:modtool_add.py

示例2: _run_lib

# 需要导入模块: from cmakefile_editor import CMakeFileEditor [as 别名]
# 或者: from cmakefile_editor.CMakeFileEditor import remove_double_newlines [as 别名]
    def _run_lib(self):
        """ Do everything that needs doing in the subdir 'lib' and 'include'.
        - add .cc and .h files
        - include them into CMakeLists.txt
        - check if C++ QA code is req'd
        - if yes, create qa_*.{cc,h} and add them to CMakeLists.txt
        """
        print "Traversing lib..."
        fname_h = self._info['fullblockname'] + '.h'
        fname_cc = self._info['fullblockname'] + '.cc'
        if self._info['blocktype'] in ('source', 'sink', 'sync', 'decimator',
                                       'interpolator', 'general', 'hiercpp'):
            self._write_tpl('block_h', 'include', fname_h)
            self._write_tpl('block_cpp', 'lib', fname_cc)
        elif self._info['blocktype'] == 'impl':
            self._write_tpl('impl_h', 'include', fname_h)
            self._write_tpl('impl_cpp', 'lib', fname_cc)
        if not self.options.skip_cmakefiles:
            ed = CMakeFileEditor('lib/CMakeLists.txt')
            ed.append_value('add_library', fname_cc)
            ed.write()
            ed = CMakeFileEditor('include/CMakeLists.txt', '\n    ')
            ed.append_value('install', fname_h, 'DESTINATION[^()]+')
            ed.write()

        if not self._add_cc_qa:
            return
        fname_qa_cc = 'qa_%s' % fname_cc
        self._write_tpl('qa_cpp', 'lib', fname_qa_cc)
        if not self.options.skip_cmakefiles:
            open('lib/CMakeLists.txt', 'a').write(Template.substitute(Templates['qa_cmakeentry'],
                                          {'basename': os.path.splitext(fname_qa_cc)[0],
                                           'filename': fname_qa_cc,
                                           'modname': self._info['modname']}))
            ed = CMakeFileEditor('lib/CMakeLists.txt')
            ed.remove_double_newlines()
            ed.write()
开发者ID:gr-mueller,项目名称:gr-modtool,代码行数:39,代码来源:modtool_add.py


注:本文中的cmakefile_editor.CMakeFileEditor.remove_double_newlines方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。