File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env python
2- # $Id: load_tracker.py,v 1.3 2004-04-22 22:17:34 richard Exp $
2+ # $Id: load_tracker.py,v 1.4 2004-04-24 04:46:43 richard Exp $
33
44'''
55Usage: %s <tracker home> <N>
5151Quis ultricies urna odio sed orci.''' .splitlines ()
5252
5353try :
54- M = N / 100
55- print
56- for i in range (M ):
57- print '\r user' , i * 100. / M ,
58- sys .stdout .flush ()
59- db .user .create (username = names [i % 17 ]+ str (i / 17 ))
54+ try :
55+ db .user .lookup ('alpha0' )
56+ except :
57+ # add some users
58+ M = N / 100
59+ for i in range (M ):
60+ print '\r user' , i , ' ' ,
61+ sys .stdout .flush ()
62+ db .user .create (username = names [i % 17 ]+ str (i / 17 ))
6063
64+ # assignable user list
6165 users = db .user .list ()
6266 users .remove (db .user .lookup ('anonymous' ))
6367 print
6468
6569 # now create the issues
6670 for i in range (N ):
67- print '\r issue' , i * 100. / N ,
71+ print '\r issue' , i , ' ' ,
6872 sys .stdout .flush ()
6973 db .issue .create (
7074 title = random .choice (titles ),
7175 priority = random .choice (priorities ),
7276 status = random .choice (statuses ),
7377 assignedto = random .choice (users ))
74- if i % 10 :
78+ if not i % 1000 :
7579 db .commit ()
7680 print
7781
You can’t perform that action at this time.
0 commit comments