(cls)
| 42 | |
| 43 | @classmethod |
| 44 | def load(cls): |
| 45 | # type: () -> Optional[Pidfile] |
| 46 | try: |
| 47 | with open(cls._PATH) as fp: |
| 48 | data = json.load(fp) |
| 49 | return cls(url=data["url"], pid=data["pid"], create_time=data["create_time"]) |
| 50 | except (OSError, IOError, ValueError, KeyError) as e: |
| 51 | logger.warning( |
| 52 | "Failed to load devpi-server pid file from {path}: {err}".format( |
| 53 | path=cls._PATH, err=e |
| 54 | ) |
| 55 | ) |
| 56 | return None |
| 57 | |
| 58 | @staticmethod |
| 59 | def _read_base_url( |
no outgoing calls