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


Python Equipment.notes方法代码示例

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


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

示例1: test_notes_set_to_non_string

# 需要导入模块: from pytrainer.core.equipment import Equipment [as 别名]
# 或者: from pytrainer.core.equipment.Equipment import notes [as 别名]
 def test_notes_set_to_non_string(self):
     equipment = Equipment()
     try:
         equipment.notes = 42
     except (TypeError):
         pass
     else:
         self.fail("Should not be able to set notes to non-string value.")
开发者ID:viiru-,项目名称:pytrainer,代码行数:10,代码来源:equipment_test.py

示例2: _confirm_add_equipment_clicked

# 需要导入模块: from pytrainer.core.equipment import Equipment [as 别名]
# 或者: from pytrainer.core.equipment.Equipment import notes [as 别名]
 def _confirm_add_equipment_clicked(self, widget):
     #FIXME input validation for numeric fields
     description = self._builder.get_object("entryEquipmentAddDescription").get_text()
     life_expectancy = self._builder.get_object("entryEquipmentAddLifeExpectancy").get_text()
     prior_usage = self._builder.get_object("entryEquipmentAddPriorUsage").get_text()
     active = self._builder.get_object("checkbuttonEquipmentAddActive").get_active()
     notes_buffer = self._builder.get_object("textviewEquipmentAddNotes").get_buffer()
     notes = notes_buffer.get_text(notes_buffer.get_start_iter(), notes_buffer.get_end_iter())
     new_equipment = Equipment()
     new_equipment.description = unicode(description)
     new_equipment.active = active
     new_equipment.life_expectancy = life_expectancy
     new_equipment.prior_usage = prior_usage
     new_equipment.notes = unicode(notes)
     self._equipment_store.add_equipment(new_equipment)
     self.show_page_equipment_list()
开发者ID:MrBricodage,项目名称:pytrainer,代码行数:18,代码来源:equipment.py

示例3: _confirm_add_equipment_clicked

# 需要导入模块: from pytrainer.core.equipment import Equipment [as 别名]
# 或者: from pytrainer.core.equipment.Equipment import notes [as 别名]
 def _confirm_add_equipment_clicked(self, widget):
     #FIXME input validation for numeric fields
     description = gtk_str(self._builder.get_object("entryEquipmentAddDescription").get_text())
     life_expectancy = gtk_str(self._builder.get_object("entryEquipmentAddLifeExpectancy").get_text())
     prior_usage = gtk_str(self._builder.get_object("entryEquipmentAddPriorUsage").get_text())
     active = self._builder.get_object("checkbuttonEquipmentAddActive").get_active()
     notes_buffer = self._builder.get_object("textviewEquipmentAddNotes").get_buffer()
     notes = gtk_str(notes_buffer.get_text(notes_buffer.get_start_iter(),
                                           notes_buffer.get_end_iter(), True))
     new_equipment = Equipment()
     new_equipment.description = description
     new_equipment.active = bool(active)
     new_equipment.life_expectancy = int(life_expectancy)
     new_equipment.prior_usage = int(prior_usage)
     new_equipment.notes = notes
     self._equipment_store.add_equipment(new_equipment)
     self.show_page_equipment_list()
开发者ID:pytrainer,项目名称:pytrainer,代码行数:19,代码来源:equipment.py

示例4: test_notes_set_to_unicode_string

# 需要导入模块: from pytrainer.core.equipment import Equipment [as 别名]
# 或者: from pytrainer.core.equipment.Equipment import notes [as 别名]
 def test_notes_set_to_unicode_string(self):
     equipment = Equipment()
     equipment.notes = u"Zapatos de €100."
     self.assertEquals(u"Zapatos de €100.", equipment.notes)
开发者ID:viiru-,项目名称:pytrainer,代码行数:6,代码来源:equipment_test.py


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