equal
deleted
inserted
replaced
234 # (eg repository initialization at least) |
234 # (eg repository initialization at least) |
235 enabled_sources = None |
235 enabled_sources = None |
236 |
236 |
237 def bootstrap_cubes(self): |
237 def bootstrap_cubes(self): |
238 from logilab.common.textutils import splitstrip |
238 from logilab.common.textutils import splitstrip |
239 for line in open(join(self.apphome, 'bootstrap_cubes')): |
239 with open(join(self.apphome, 'bootstrap_cubes')) as f: |
240 line = line.strip() |
240 for line in f: |
241 if not line or line.startswith('#'): |
241 line = line.strip() |
242 continue |
242 if not line or line.startswith('#'): |
243 self.init_cubes(self.expand_cubes(splitstrip(line))) |
243 continue |
244 break |
244 self.init_cubes(self.expand_cubes(splitstrip(line))) |
245 else: |
245 break |
246 # no cubes |
246 else: |
247 self.init_cubes(()) |
247 # no cubes |
|
248 self.init_cubes(()) |
248 |
249 |
249 def write_bootstrap_cubes_file(self, cubes): |
250 def write_bootstrap_cubes_file(self, cubes): |
250 stream = open(join(self.apphome, 'bootstrap_cubes'), 'w') |
251 stream = open(join(self.apphome, 'bootstrap_cubes'), 'w') |
251 stream.write('# this is a generated file only used for bootstraping\n') |
252 stream.write('# this is a generated file only used for bootstraping\n') |
252 stream.write('# you should not have to edit this\n') |
253 stream.write('# you should not have to edit this\n') |