import sys
import p4
import tracker
p4 = p4.p4('bruno_ws', 'c:/program files/perforce/p4.exe', None, None, '1888', 'P4DTI-replicator0')
def job(jobname):
jobs = p4.run('job -o %s' % jobname)
return jobs[0]
def log(msg):
pass
class cfg:
def __init__(self):
self.rid = ""
self.sid = ""
self.logger = log
self.tracker_path = "d:\\Program Files\\PVCS\\Tracker\\nt"
self.tr_fields = {
'Id': ( 'int' ),
'Title': ( 'string' ),
'Owner': ( 'string' ),
'Description': ( 'desc' ),
'State': ( 'string' ),
'Resolution': ( 'string' ),
'Fixed Date': ( 'string' ),
'rid': ( 'string' ),
}
self.tracker_user = 'p4dti-replicator0'
self.tracker_password = 'tracker'
self.tracker_project = 'ActixTest'
self.tracker_server = 'ActixTest'
config = cfg()
trk = tracker.tracker(config, config.tracker_user, config.tracker_password,
config.tracker_project, config.tracker_server)
sys.stdout.write('*** Warning - do you want to delete issues for database %s on server %s?' %(
trk.config.tracker_project, trk.config.tracker_server))
sys.stdout.write(' ')
sys.stdout.flush()
if sys.stdin.readline()[0] in 'yY':
sys.stdout.write('Enter issue id before which to delete issues:')
sys.stdout.write(' ')
sys.stdout.flush()
id = int(sys.stdin.readline())
trk.delete_issues_before(id)