(self)
| 289 | return _dict |
| 290 | |
| 291 | def save_database(self): |
| 292 | _port = self.config.listen |
| 293 | self.delete_database() |
| 294 | |
| 295 | pdata = { |
| 296 | 'name': self.config.listen, |
| 297 | 'path': self.config.conf_path, |
| 298 | 'ps': self.config.ps, |
| 299 | 'status': 1, |
| 300 | 'type_id': 0, |
| 301 | 'project_type': 'proxy.stream', |
| 302 | 'project_config': json.dumps(tools.to_dict(self.config)), |
| 303 | 'addtime': self.config.addtime |
| 304 | } |
| 305 | public.M('sites').insert(pdata) |
| 306 | |
| 307 | def delete_database(self): |
| 308 | if public.M('sites').where('name=?', (self.config.listen,)).count(): |
nothing calls this directly
no test coverage detected