本文整理匯總了Python中pootle_store.models.Unit.addlocation方法的典型用法代碼示例。如果您正苦於以下問題:Python Unit.addlocation方法的具體用法?Python Unit.addlocation怎麽用?Python Unit.addlocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pootle_store.models.Unit
的用法示例。
在下文中一共展示了Unit.addlocation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_termunit
# 需要導入模塊: from pootle_store.models import Unit [as 別名]
# 或者: from pootle_store.models.Unit import addlocation [as 別名]
def create_termunit(term, unit, targets, locations, sourcenotes, transnotes,
filecounts):
termunit = Unit()
termunit.source = term
termunit.setid(term)
if unit is not None:
termunit.merge(unit)
termunit.pending_suggestions = []
for target in targets.keys():
if target != termunit.target:
termunit.pending_suggestions.append(target)
for location in locations:
termunit.addlocation(location)
for sourcenote in sourcenotes:
termunit.addnote(sourcenote, "developer")
for filename, count in filecounts.iteritems():
termunit.addnote('(poterminology) %s (%d)\n' % (filename, count),
'translator')
return termunit