toolsutils.py
branchtls-sprint
changeset 1138 22f634977c95
parent 1132 96752791c2b6
child 1802 d628defebc17
equal deleted inserted replaced
1135:00eb43688a57 1138:22f634977c95
   112                 tfpath = join(tdirpath, fname)
   112                 tfpath = join(tdirpath, fname)
   113             if fname.endswith('.tmpl'):
   113             if fname.endswith('.tmpl'):
   114                 tfpath = tfpath[:-5]
   114                 tfpath = tfpath[:-5]
   115                 if not askconfirm or not exists(tfpath) or \
   115                 if not askconfirm or not exists(tfpath) or \
   116                        confirm('%s exists, overwrite?' % tfpath):
   116                        confirm('%s exists, overwrite?' % tfpath):
   117                     fname = fill_templated_file(fpath, tfpath, context)
   117                     fill_templated_file(fpath, tfpath, context)
   118                     print '[generate] %s <-- %s' % (tfpath, fpath)
   118                     print '[generate] %s <-- %s' % (tfpath, fpath)
   119             elif exists(tfpath):
   119             elif exists(tfpath):
   120                 show_diffs(tfpath, fpath, askconfirm)
   120                 show_diffs(tfpath, fpath, askconfirm)
   121             else:
   121             else:
   122                 shutil.copyfile(fpath, tfpath)
   122                 shutil.copyfile(fpath, tfpath)