本文整理匯總了Python中trac.ticket.model.Priority.update方法的典型用法代碼示例。如果您正苦於以下問題:Python Priority.update方法的具體用法?Python Priority.update怎麽用?Python Priority.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類trac.ticket.model.Priority
的用法示例。
在下文中一共展示了Priority.update方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from trac.ticket.model import Priority [as 別名]
# 或者: from trac.ticket.model.Priority import update [as 別名]
def main():
if len(sys.argv) < 2:
print("usage: %s /path/to/projenv" % os.path.basename(sys.argv[0]),
file=sys.stderr)
sys.exit(2)
env = open_environment(sys.argv[1])
with env.db_transaction:
for oldprio, newprio in priority_mapping.items():
priority = Priority(env, oldprio)
priority.name = newprio
priority.update()
for severity in list(Severity.select(env)):
severity.delete()
示例2: main
# 需要導入模塊: from trac.ticket.model import Priority [as 別名]
# 或者: from trac.ticket.model.Priority import update [as 別名]
def main():
if len(sys.argv) < 2:
print >> sys.stderr, 'usage: %s /path/to/projenv' \
% os.path.basename(sys.argv[0])
sys.exit(2)
env = open_environment(sys.argv[1])
db = env.get_db_cnx()
for oldprio, newprio in priority_mapping.items():
priority = Priority(env, oldprio, db)
priority.name = newprio
priority.update(db)
for severity in list(Severity.select(env, db)):
severity.delete(db)
db.commit()
示例3: test_priority_update
# 需要導入模塊: from trac.ticket.model import Priority [as 別名]
# 或者: from trac.ticket.model.Priority import update [as 別名]
def test_priority_update(self):
prio = Priority(self.env, 'major')
prio.name = 'foo'
prio.update()
Priority(self.env, 'foo')
self.assertRaises(TracError, Priority, self.env, 'major')