Mercurial > libervia-web
comparison libervia/server/pages.py @ 1271:b0b9218c5982
pages: fixed `dir_path` checking in `onFileChange`
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 19 May 2020 18:33:18 +0200 |
parents | 6dfcdbeb0d33 |
children | 334d044f2713 |
comparison
equal
deleted
inserted
replaced
1270:6dfcdbeb0d33 | 1271:b0b9218c5982 |
---|---|
448 | 448 |
449 log.debug("{flags} event(s) received for {file_path}".format( | 449 log.debug("{flags} event(s) received for {file_path}".format( |
450 flags=", ".join(flags), file_path=file_path)) | 450 flags=", ".join(flags), file_path=file_path)) |
451 | 451 |
452 dir_path = os.path.dirname(path) | 452 dir_path = os.path.dirname(path) |
453 if not dir_path.startswith(site_path): | 453 if not dir_path.startswith(str(site_path)): |
454 raise exceptions.InternalError("watched file should start with site path") | 454 raise exceptions.InternalError("watched file should start with site path") |
455 | 455 |
456 path_elts = [p for p in dir_path[len(site_path):].split('/') if p] | 456 path_elts = [p for p in dir_path[len(site_path):].split('/') if p] |
457 if not path_elts: | 457 if not path_elts: |
458 return | 458 return |