| | 230 | def __init__(self, id=None, **kwargs): |
|---|
| | 231 | Session.__init__(self, id, **kwargs) |
|---|
| | 232 | |
|---|
| | 233 | # Warn if any lock files exist at startup. |
|---|
| | 234 | lockfiles = [fname for fname in os.listdir(self.storage_path) |
|---|
| | 235 | if (fname.startswith(self.SESSION_PREFIX) |
|---|
| | 236 | and fname.endswith(self.LOCK_SUFFIX))] |
|---|
| | 237 | if lockfiles: |
|---|
| | 238 | plural = ('', 's')[len(lockfiles) > 1] |
|---|
| | 239 | warn("%s session lockfile%s found at startup. If you are " |
|---|
| | 240 | "only running one process, then you may need to " |
|---|
| | 241 | "manually delete the lockfiles found at %r." |
|---|
| | 242 | % (len(lockfiles), plural, |
|---|
| | 243 | os.path.abspath(self.storage_path))) |
|---|
| | 244 | |
|---|