comparison rhodecode/config/rcextensions/make_rcextensions.py @ 2405:5019f7798733 beta

removed global tmpl call from make_rcextensions script
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 06 Jun 2012 21:32:53 +0200
parents f1467dfcf093
children
comparison
equal deleted inserted replaced
2404:a3efdd61a21f 2405:5019f7798733
52 52
53 def command(self): 53 def command(self):
54 logging.config.fileConfig(self.path_to_ini_file) 54 logging.config.fileConfig(self.path_to_ini_file)
55 from pylons import config 55 from pylons import config
56 56
57 def _make_file(ext_file): 57 def _make_file(ext_file, tmpl):
58 bdir = os.path.split(ext_file)[0] 58 bdir = os.path.split(ext_file)[0]
59 if not os.path.isdir(bdir): 59 if not os.path.isdir(bdir):
60 os.makedirs(bdir) 60 os.makedirs(bdir)
61 with open(ext_file, 'wb') as f: 61 with open(ext_file, 'wb') as f:
62 f.write(tmpl) 62 f.write(tmpl)
69 ext_file = jn(here, 'rcextensions', '__init__.py') 69 ext_file = jn(here, 'rcextensions', '__init__.py')
70 if os.path.exists(ext_file): 70 if os.path.exists(ext_file):
71 msg = ('Extension file already exists, do you want ' 71 msg = ('Extension file already exists, do you want '
72 'to overwrite it ? [y/n]') 72 'to overwrite it ? [y/n]')
73 if ask_ok(msg): 73 if ask_ok(msg):
74 _make_file(ext_file) 74 _make_file(ext_file, tmpl)
75 else: 75 else:
76 log.info('nothing done...') 76 log.info('nothing done...')
77 else: 77 else:
78 _make_file(ext_file) 78 _make_file(ext_file, tmpl)
79 79
80 def update_parser(self): 80 def update_parser(self):
81 pass 81 pass