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


Python Section.get_text方法代码示例

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


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

示例1: get_text

# 需要导入模块: from core.inputfile import Section [as 别名]
# 或者: from core.inputfile.Section import get_text [as 别名]
 def get_text(self):
     """format contents of this item for writing to file"""
     # Use default get_text, but need to skip LID if it is NONE
     lines = []
     for line in Section.get_text(self).splitlines():
         if line.split() != ["LID", "NONE"]:
             lines.append(line)
     return '\n'.join(lines)
开发者ID:crpAnderson,项目名称:SWMM-EPANET_User_Interface,代码行数:10,代码来源:report.py

示例2: get_text

# 需要导入模块: from core.inputfile import Section [as 别名]
# 或者: from core.inputfile.Section import get_text [as 别名]
 def get_text(self):
     if self.global_efficiency == "75" \
        and self.global_price == "0.0" \
        and self.global_pattern == '' \
        and self.demand_charge == "0.0" \
        and len(self.pumps) == 0:
         return ''  # This section has nothing different from defaults, return blank
     else:
         txt = []
         txt.append(Section.get_text(self))  # Get text for the global variables using metadata
         for pump_energy in self.pumps:      # Add text for each pump energy
             txt.append(pump_energy.get_text())
         return '\n'.join(txt)
开发者ID:crpAnderson,项目名称:SWMM-EPANET_User_Interface,代码行数:15,代码来源:energy.py

示例3: get_text

# 需要导入模块: from core.inputfile import Section [as 别名]
# 或者: from core.inputfile.Section import get_text [as 别名]
 def get_text(self):
     """Contents of this item formatted for writing to file"""
     # First, add the values in this section stored directly in this class
     text_list = [Section.get_text(self)]
     if self.dates is not None:  # Add the values stored in Dates class
         text_list.append(General.section_comments[0])
         text_list.append(self.dates.get_text().replace(self.SECTION_NAME + '\n', ''))
     if self.time_steps is not None:  # Add the values stored in TimeSteps class
         text_list.append(General.section_comments[1])
         text_list.append(self.time_steps.get_text().replace(self.SECTION_NAME + '\n', ''))
     if self.dynamic_wave is not None:  # Add the values stored in DynamicWave class
         text_list.append(General.section_comments[2])
         text_list.append(self.dynamic_wave.get_text().replace(self.SECTION_NAME + '\n', ''))
     return '\n'.join(text_list)
开发者ID:alvdena,项目名称:SWMM-EPANET_User_Interface,代码行数:16,代码来源:general.py


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