2323import os , errno , email .parser
2424
2525
26- from roundup import install_util , password
26+ from roundup import install_util
2727from roundup .configuration import CoreConfig
2828from roundup .i18n import _
2929
30+
3031def copytree (src , dst , symlinks = 0 ):
3132 """Recursively copy a directory tree using copyDigestedFile().
3233
@@ -45,7 +46,7 @@ def copytree(src, dst, symlinks=0):
4546 try :
4647 os .mkdir (dst )
4748 except OSError as error :
48- if error .errno != errno .EEXIST : raise
49+ if error .errno != errno .EEXIST : raise # noqa
4950 for name in names :
5051 srcname = os .path .join (src , name )
5152 dstname = os .path .join (dst , name )
@@ -57,6 +58,7 @@ def copytree(src, dst, symlinks=0):
5758 else :
5859 install_util .copyDigestedFile (srcname , dstname )
5960
61+
6062def install (instance_home , template , settings = {}):
6163 '''Install an instance using the named template and backend.
6264
@@ -122,6 +124,7 @@ def listTemplates(dir):
122124 ret [ti ['name' ]] = ti
123125 return ret
124126
127+
125128def loadTemplateInfo (path ):
126129 ''' Attempt to load a Roundup template from the indicated directory.
127130
@@ -134,8 +137,8 @@ def loadTemplateInfo(path):
134137
135138 if os .path .exists (os .path .join (path , 'config.py' )):
136139 print (_ ("WARNING: directory '%s'\n "
137- "\t contains old-style template - ignored"
138- ) % os .path .abspath (path ))
140+ "\t contains old-style template - ignored" )
141+ % os .path .abspath (path ))
139142 return None
140143
141144 # load up the template's information
@@ -151,6 +154,7 @@ def loadTemplateInfo(path):
151154 f .close ()
152155 return ti
153156
157+
154158def writeHeader (name , value ):
155159 ''' Write an rfc822-compatible header line, making it wrap reasonably
156160 '''
@@ -164,6 +168,7 @@ def writeHeader(name, value):
164168 n += len (out [- 1 ])
165169 return '' .join (out ) + '\n '
166170
171+
167172def saveTemplateInfo (dir , info ):
168173 ''' Save the template info (dict of values) to the TEMPLATE-INFO.txt
169174 file in the indicated directory.
0 commit comments