Beispiel #1
0
    def gen_template_moduleCase(self, file_path=None):
        """
        功能:将模板代码内容写入文件
        """
        if not file_path:
            # 初始化默认生成文件的路径
            file_path = self.default_filepath_moduleCase
            validator.check_file_isExist(file_path)

            FileHelper.create_filepath(filepath=file_path)

        with open(file_path, 'a', encoding='utf-8') as f:
            f.write(self._content_module())
Beispiel #2
0
    def gen_template_fieldCase(self, file_path=None):
        """
        功能:将模板代码内容写入文件
        :param _content: 模板内容
        :param file: 默认路径为($PROJECT_ROOT/output/template/scn_api_device.py)
        :return:
        """
        if not file_path:
            # 初始化默认生成文件的路径
            file_path = self.default_filepath_fieldCase
            validator.check_file_isExist(file_path)

            FileHelper.create_filepath(filepath=file_path)

        with open(file_path, 'a', encoding='utf-8') as f:
            f.write(self._content_field())