本文整理汇总了Python中trac.ticket.model.Priority.name方法的典型用法代码示例。如果您正苦于以下问题:Python Priority.name方法的具体用法?Python Priority.name怎么用?Python Priority.name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.ticket.model.Priority
的用法示例。
在下文中一共展示了Priority.name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from trac.ticket.model import Priority [as 别名]
# 或者: from trac.ticket.model.Priority import name [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 name [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 name [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')
示例4: test_priority_insert_with_value
# 需要导入模块: from trac.ticket.model import Priority [as 别名]
# 或者: from trac.ticket.model.Priority import name [as 别名]
def test_priority_insert_with_value(self):
prio = Priority(self.env)
prio.name = 'bar'
prio.value = 100
prio.insert()
self.assertEqual(True, prio.exists)
示例5: test_priority_insert
# 需要导入模块: from trac.ticket.model import Priority [as 别名]
# 或者: from trac.ticket.model.Priority import name [as 别名]
def test_priority_insert(self):
prio = Priority(self.env)
prio.name = 'foo'
prio.insert()
self.assertEqual(True, prio.exists)