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