diff options
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/caves.py | 12 | ||||
-rw-r--r-- | parsers/drawings.py | 9 | ||||
-rw-r--r-- | parsers/logbooks.py | 9 | ||||
-rw-r--r-- | parsers/survex.py | 17 |
4 files changed, 27 insertions, 20 deletions
diff --git a/parsers/caves.py b/parsers/caves.py index b2a6e54..8e967b1 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -19,12 +19,16 @@ So is the first thing that creates tables. """ todo = """ - - Cannot use Edit This Page for pendingcaves.txt_edit as Edit This Page is expecting an html file. +- Cannot use Edit This Page for pendingcaves.txt_edit as Edit This Page is expecting an html file. So we will need a separate file-editing capability just for this configuration file ?! -- crashes on MariaDB in databasereset.py on server when deleting Caves and complains Area needs a non null parent, But this is not true. - The only solution we have found is to let it crash, then stop and restart MariaDB (requires a logon able to sudo) - and then restart the databasereset.py again. (status as of July 2022) +- Semi-automagically import all the 1627- pending caves and create HTML files for them to be + edited individually. (These are caves we only know about because we have German survex files.) + +- crashes on MariaDB in databasereset.py on server when deleting Caves and complains Area needs a + non null parent, But this is not true. The only solution we have found is to let it crash, then + stop and restart MariaDB (requires a logon able to sudo) and then restart the databasereset.py + again. (status as of July 2022) """ entrances_xslug = {} caves_xslug = {} diff --git a/parsers/drawings.py b/parsers/drawings.py index 0273210..a814ce2 100644 --- a/parsers/drawings.py +++ b/parsers/drawings.py @@ -12,14 +12,15 @@ from troggle.core.models.wallets import Wallet for tunnel and therion files """ -todo = """- Rename functions more consistently between tunnel and therion variants +todo = """ +- Rename functions more consistently between tunnel and therion variants -- Recode to use pathlib instead of whacky resetting of loop variable inside loop -to scan sub-folders. +- Refactor to use pathlib instead of whacky resetting of loop variable inside loop + to scan sub-folders. - Recode rx_valid_ext to use pathlib suffix() function -- Recode load_drawings_files() to use a list of suffices not huge if-else monstrosity +- Recode load_drawings_files() to use a list of suffices - not the huge if-else monstrosity """ rx_valid_ext = re.compile(r"(?i)\.(?:png|jpg|pdf|jpeg|gif|txt)$") diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 1ae7fb9..6afd620 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -26,24 +26,21 @@ todo = """ - this is a slow and uncertain function too: cave = getCaveByReference(caveRef) -- pre-compile all the heavily used regular expressions ! - - profile the code to find bad repetitive things, of which there are many. - attach or link a DataIssue to an individual expo (logbook) so that it can be found and deleted - replace explicit 1970 date with a constant EPOCH -- rewrite to use generators rather than storing everything intermediate in lists - to reduce memory impact. +- rewrite to use generators rather than storing everything intermediate in lists - to + reduce memory impact [low priority] - We should ensure logbook.html is utf-8 and stop this crap: file_in = open(logbookfile,'rb') txt = file_in.read().decode("latin1") - - use Fixtures https://docs.djangoproject.com/en/4.1/ref/django-admin/#django-admin-loaddata to cache -data for old logbooks? Not worth it.. - + data for old logbooks? Not worth it.. """ MAX_LOGBOOK_ENTRY_TITLE_LENGTH = 200 BLOG_PARSER_SETTINGS = { # no default, must be explicit diff --git a/parsers/survex.py b/parsers/survex.py index 8bde946..91ce00a 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -24,17 +24,22 @@ It also scans the Loser repo for all the svx files, which it loads individually todo = """ - Lots to do to cut down on unnecessary .save() calls to avoid hitting the db so much. SHould -speed it up noticably. + speed it up noticably. + +- Obscure bug in the *team inheritance and rootblock initialization needs tracking down + +- Learn to use Django .select_related() and .prefetch_related() to speed things up + https://zerotobyte.com/how-to-use-django-select-related-and-prefetch-related/ - LoadSurvexFile() Creates a new current survexfile and valid .survexdirectory The survexblock passed-in is not necessarily the parent. FIX THIS. - When Olly implements LEG in the 'dump3d --legs' utility, then we can use that to get the length of -all the legs in a survex block instead of adding them up oursleves. Which means that we can -ignore all the Units and offset stuff, that troggle will work with survex files with backsights, -repeated readings from distox etc.. Not actually useful for pre 2022 survey data, but good future-proofing. -Also it will be a tiny bit more accurate as these leg lengths are after loop closure fixup. - + all the legs in a survex block instead of adding them up oursleves. Which means that we can + ignore all the Units and offset stuff, that troggle will work with survex files with backsights, + repeated readings from distox etc.. Not actually useful for pre 2022 survey data, + but good future-proofing. + Also it will be a tiny bit more accurate as these leg lengths are after loop closure fixup. """ survexblockroot = None survexomitsroot = None |