(self, config)
| 291 | } |
| 292 | |
| 293 | def __call__(self, config): |
| 294 | if config is None: |
| 295 | return False |
| 296 | |
| 297 | engine = config.db |
| 298 | |
| 299 | if "+" in self.db: |
| 300 | dialect, driver = self.db.split("+") |
| 301 | else: |
| 302 | dialect, driver = self.db, None |
| 303 | |
| 304 | if dialect and engine.name != dialect: |
| 305 | return False |
| 306 | if driver is not None and engine.driver != driver: |
| 307 | return False |
| 308 | |
| 309 | if self.op is not None: |
| 310 | assert driver is None, "DBAPI version specs not supported yet" |
| 311 | |
| 312 | version = _server_version(engine) |
| 313 | oper = ( |
| 314 | hasattr(self.op, "__call__") and self.op or self._ops[self.op] |
| 315 | ) |
| 316 | return oper(version, self.spec) |
| 317 | else: |
| 318 | return True |
| 319 | |
| 320 | def _as_string(self, config, negate=False): |
| 321 | if self.description is not None: |
nothing calls this directly
no test coverage detected