本文整理汇总了Python中Constants.getPeopleWord方法的典型用法代码示例。如果您正苦于以下问题:Python Constants.getPeopleWord方法的具体用法?Python Constants.getPeopleWord怎么用?Python Constants.getPeopleWord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constants
的用法示例。
在下文中一共展示了Constants.getPeopleWord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Constants [as 别名]
# 或者: from Constants import getPeopleWord [as 别名]
def __init__(self, recipe):
GObject.__init__(self)
#recipe name
self.name = newString(recipe.getName(),Constants.recipe_description.name_font)
#description
desc_text = recipe.getDescription()
self.description = newString(desc_text,Constants.recipe_description.description_font)
#details
det_text = recipe.getPeople() + " " + Constants.getPeopleWord(recipe.getPeople())
det_text += ", " + recipe.getTime()
self.details = newString(det_text,Constants.recipe_description.description_font)
#underline
self.underline = GRect()
self.underline.color = Constants.recipe_description.underline_color
self.underline.h = Constants.recipe_description.underline_height
#position everything
padding = Constants.recipe_description.padding
padding2 = Constants.recipe_description.name_desc_padding
padding3 = Constants.recipe_description.line_padding
padding4 = Constants.recipe_description.underline_padding
self.underline.y = padding
self.name.x = padding
self.name.y = padding + padding4 + Constants.recipe_description.underline_padding
self.description.x = self.name.x + self.name.w + padding2
self.details.x = self.description.x
self.details.y = self.name.y
self.description.y = padding3 + self.details.y + self.details.h
#calculate size
self.h = 2*padding + padding4 + max(self.name.h , self.description.h+ self.details.h + padding3)
self.h += Constants.recipe_description.underline_height
self.w = 2*padding + self.name.w + padding2 + max(self.description.w, self.details.w)
self.underline.w = self.w