# config_teamtrack.py -- P4DTI configuration for replication to TeamTrack. # Gareth Rees, Ravenbrook Limited, 2000-10-16. # $Id: //info.ravenbrook.com/project/p4dti/branch/2000-11-14/bugzilla/code/replicator/config_teamtrack.py#2 $ # # Copyright 2000 Ravenbrook Limited. This document is provided "as is", # without any express or implied warranty. In no event will the authors # be held liable for any damages arising from the use of this document. # You may make and distribute copies and derivative works of this # document provided that (1) you do not charge a fee for this document or # for its distribution, and (2) you retain as they appear all copyright # and licence notices and document history entries, and (3) you append # descriptions of your modifications to the document history. import dt_teamtrack import logger import replicator import socket # The replicator identifier. rid = ???? # The Perforce server identifier. sid = ???? # File to write logs to. log_file = "p4dti.log" # The logger object that handles the logging. This logger object logs both to # the file and to stdout. logger = logger.multi_logger([logger.file_logger(open(log_file, "a")), logger.file_logger()]) # Pairs of states (TeamTrack state, Perforce state). states = [ ('Assigned', 'assigned'), ('Deferred', 'deferred'), ('New', 'open'), ('Resolved', 'closed'), ('Verified', 'verified') ] teamtrack_config = \ { # A logger object that handles the logging for the TeamTrack interface. 'logger': logger, # Pairs of states (TeamTrack state, Perforce state). 'states': states, } replicator_config = \ { # A logger object that handles the logging for the replicator. 'logger': logger, # E-mail address of integration administrator. 'administrator-address': ????, # Address of SMTP server for sending e-mail. 'smtp-server': ????, # Hostname and port of Perforce server. 'p4-port': ????, # Path to Perforce client executable: must P4/xxx/2000.1/17595 or later. 'p4-client-executable': 'p4', # The list of fields that will be replicated between TeamTrack issues and # Perforce jobs. Each entry is a 3-tuple (TeamTrack field name, Perforce # field name, translator). 'replicated-fields': [ ( 'OWNER', 'Owner', dt_teamtrack.user_translator()), ( 'STATE', 'State', dt_teamtrack.state_translator(states) ), ( 'TITLE', 'Title', replicator.translator() ), ( 'DESCRIPTION', 'Description', dt_teamtrack.text_translator() ), ], # Translator for users. 'user-translator': dt_teamtrack.user_translator(), # Translator for dates. 'date-translator': dt_teamtrack.date_translator(), } dt = dt_teamtrack.dt_teamtrack(rid, sid, teamtrack_config) r = replicator.replicator(rid, dt, replicator_config)