示例#1
0
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])
    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
0
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()
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()
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()
示例#5
0
 def test_abstractenum(self):
     """
     Verify basic AbstractEnum functionality.
     """
     p = Priority(self.env, 'major')
     self.assertEqual(p.name, 'major')
     self.assertEqual(p.value, '3')
     p = Priority(self.env)
     p.name = 'foo'
     p.insert()
     p = Priority(self.env)
     p.name = 'bar'
     p.value = 100
     p.insert()
     p = Priority(self.env, 'foo')
     p.name = 'foo2'
     p.update()
     p = Priority(self.env, 'foo2')
     p.delete()
     p = Priority(self.env, 'bar')
     p.delete()
示例#6
0
文件: model.py 项目: zjj/trac_hack
 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')
示例#7
0
 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')
示例#8
0
 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")