(self)
| 330 | self.handler = handler |
| 331 | |
| 332 | def start(self): |
| 333 | opts = ''.join([' PythonOption %s %s\n' % (k, v) |
| 334 | for k, v in self.opts]) |
| 335 | conf_data = self.template % {'port': self.port, |
| 336 | 'loc': self.loc, |
| 337 | 'opts': opts, |
| 338 | 'handler': self.handler, |
| 339 | } |
| 340 | |
| 341 | mpconf = os.path.join(os.path.dirname(__file__), 'cpmodpy.conf') |
| 342 | with open(mpconf, 'wb') as f: |
| 343 | f.write(conf_data) |
| 344 | |
| 345 | response = read_process(self.apache_path, '-k start -f %s' % mpconf) |
| 346 | self.ready = True |
| 347 | return response |
| 348 | |
| 349 | def stop(self): |
| 350 | os.popen('apache -k stop') |
no test coverage detected