# Adapted by bdolicki for openacs.org # Changes to http://dev.zope.org/CVS/traffic_table.py # 001 Email addresses # 002 Added /openacs-4 pattern # 003 No catchall # 004 No repolinks (this isn't really necessary because we don't have # any symlinks in the repository) """Table dictating what goes where for the traffic_cop module. The global var 'table' contains a list of entries identifying where change-notifications for particular sections of the repository are sent. Each 'table' entry is a dictionary containing some mandatory and some optional fields (optional fields have default values described) - 'addrs' - a list of email addresses for checkin notice delivery. - 'path' - to the repository dir, relative to the CVSROOT. If the leading path of the files being checked in (re) match the value of this attribute, then this entry is invoked. NOTE that the comparison mechanism takes into account the repository symlinks (as dictated by the repolinks file). This means that all entries for directories that contain checked-in files by virtue of symlinks, as well as by direct containment, will qualify - the system takes care of unravelling the symlinks for you. """ # 001 #internal = ["project-cvs@my.YOURHOST.com", "project-log@my.YOURHOST.com"] # Some openacs.org aliases would be helpful here internal = ["openacs-cvs-list-admin@willfork.com", "davis@xarg.net"] _TABLE = [] def add_to_table(entries, prepend=0): global _TABLE if type(entries) not in [type([]), type(())]: entries = [entries] if prepend: _TABLE = entries + _TABLE else: _TABLE = _TABLE + entries def add_multipath(paths, addrs): """Add entries with different paths but the same addrs and remote""" for path in paths: add_to_table({'path': path, 'addrs': addrs}) def get_table(): return _TABLE[:] def init_table(): add_to_table([ # CVSROOT entry is crucial: {'path': "CVSROOT", 'addrs': internal, # 004 # 'specials': [("repolinks", "adjustlinks.py")], 'verbose': 1}, # 002 # {'path': "PrjChat", # 'addrs': ["project-chat-cvs@my.zope.com", # "project-chat-log@my.zope.com"]}, {'path': "openacs-4", 'addrs': ["openacs-cvs-list@willfork.com"]}, # 003 # # Catchall for when *no* other entry matches: # {'path': None, # 'addrs': internal}, ]) init_table()