Changeset 199


Ignore:
Timestamp:
03/26/08 17:20:09 (16 years ago)
Author:
bas
Message:

email2trac.py.in:

  • Comitted a patch that uses the trac configuration routines, closes ticket #36 Submitted by: andrei2102 add gmail dot com Approved by: Bas van der Vlies
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r194 r199  
    101101
    102102from datetime import tzinfo, timedelta, datetime
    103 
     103from trac import config as trac_config
    104104
    105105# Some global variables
     
    10141014                        os.mkdir(path, mode)
    10151015
    1016 
    10171016def ReadConfig(file, name):
    10181017        """
     
    10241023                sys.exit(1)
    10251024
    1026         config = ConfigParser.ConfigParser()
    1027         try:
    1028                 config.read(file)
    1029         except ConfigParser.MissingSectionHeaderError,detail:
    1030                 print detail
    1031                 sys.exit(1)
    1032 
     1025        config = trac_config.Configuration(file)
    10331026
    10341027        # Use given project name else use defaults
    10351028        #
    10361029        if name:
    1037                 if not config.has_section(name):
     1030                sections = config.sections()
     1031                if not name in sections:
    10381032                        print "Not a valid project name: %s" %name
    1039                         print "Valid names: %s" %config.sections()
     1033                        print "Valid names: %s" %sections
    10401034                        sys.exit(1)
    10411035
    10421036                project =  dict()
    1043                 for option in  config.options(name):
    1044                         project[option] = config.get(name, option)
     1037                for option, value in  config.options(name):
     1038                        project[option] = value
    10451039
    10461040        else:
     
    11141108                        # see http://projects.edgewall.com/trac/changeset/2799
    11151109                        from trac.ticket.notification import TicketNotifyEmail
     1110                        from trac import config as trac_config
    11161111                elif version == '0.11':
    11171112                        from trac import attachment
     
    11191114                        from trac.ticket import Ticket
    11201115                        from trac.web.href import Href
     1116                        from trac import config as trac_config
    11211117                        from trac import util
    11221118                        #
Note: See TracChangeset for help on using the changeset viewer.