本文整理匯總了Python中family.Family.str方法的典型用法代碼示例。如果您正苦於以下問題:Python Family.str方法的具體用法?Python Family.str怎麽用?Python Family.str使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類family.Family
的用法示例。
在下文中一共展示了Family.str方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: syn_cell_data_func
# 需要導入模塊: from family import Family [as 別名]
# 或者: from family.Family import str [as 別名]
def syn_cell_data_func(column, renderer, model, iter, data=None):
'''
'''
v = model[iter][0]
author = None
if v.author is None:
author = ''
else:
author = utils.xml_safe(unicode(v.author))
renderer.set_property('markup', '<i>%s</i> %s (<small>%s</small>)'
% (Genus.str(v), author, Family.str(v.family)))
示例2: _syn_data_func
# 需要導入模塊: from family import Family [as 別名]
# 或者: from family.Family import str [as 別名]
def _syn_data_func(column, cell, model, iter, data=None):
v = model[iter][0]
syn = v.synonym
cell.set_property('markup', '<i>%s</i> %s (<small>%s</small>)'
% (Genus.str(syn),
utils.xml_safe(unicode(syn.author)),
Family.str(syn.family)))
# set background color to indicate it's new
if v.id is None:
cell.set_property('foreground', 'blue')
else:
cell.set_property('foreground', None)