comparison roundup/init.py @ 4818:edb171528a7d

init.loadTemplateInfo: replace rfc822 with email.parser (Python 3 compatible)
author anatoly techtonik <techtonik@gmail.com>
date Sat, 24 Aug 2013 22:40:30 +0300
parents 785bd25371d3
children c86bc9646652
comparison
equal deleted inserted replaced
4817:785bd25371d3 4818:edb171528a7d
17 # 17 #
18 """Init (create) a roundup instance. 18 """Init (create) a roundup instance.
19 """ 19 """
20 __docformat__ = 'restructuredtext' 20 __docformat__ = 'restructuredtext'
21 21
22 import os, errno, rfc822 22 import os, errno, email.parser
23
23 24
24 from roundup import install_util, password 25 from roundup import install_util, password
25 from roundup.configuration import CoreConfig 26 from roundup.configuration import CoreConfig
26 from roundup.i18n import _ 27 from roundup.i18n import _
27 28
136 ) % os.path.abspath(path) 137 ) % os.path.abspath(path)
137 return None 138 return None
138 139
139 # load up the template's information 140 # load up the template's information
140 with open(tif) as f: 141 with open(tif) as f:
141 m = rfc822.Message(f) 142 m = email.parser.Parser().parse(f, True)
142 ti = {} 143 ti = {}
143 ti['name'] = m['name'] 144 ti['name'] = m['name']
144 ti['description'] = m['description'] 145 ti['description'] = m['description']
145 ti['intended-for'] = m['intended-for'] 146 ti['intended-for'] = m['intended-for']
146 ti['path'] = path 147 ti['path'] = path

Roundup Issue Tracker: http://roundup-tracker.org/