Modularization 2 - manage layer adding cache #212
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
2 new modules
Context
Improve plugin operation and make corrections (#180 ).
Achievments
modules/results/display.py
Issue : Module cache #179
Commits : f25e18c, 2e77b1d
Class name : ResultsManager
Purpose : This class includes two methods of the old ResultsManager class (show_results() and _filepath_builder()) in addition to build_postgis_dict() method from the old UrlBuilder class. The result display works in much the same way as before. This
modules/results/display.py
corresponds to what remains of the oldmodules/results.py
after removing the cache management and adding the build_postgis_dict() method.modules/results/cache.py
Issue : Module cache #179
Commits : f25e18c, 2ce825e
Class name : CacheManager
Purpose : This class includes the 3 methods removed from the old
modules/results.py
: _cache_dumper(), _cache_loader() and _cache_cleaner() renamed dumper(), loader() and cleaner(). The management of the cache related to the addition of layer is now isolated in thismodules/results/cache.py
. It manages the storage of inaccessible elements detected during use, the writing of these elements in the JSON cache file, the recovery of these elements from the JSON cache file and the cleaning of this file.Improvement : The old cache system only supported inaccessible file paths. This CacheManager has been developed to also store inaccessible services (OGC and ESRI) or databases. The structure of the JSON file has been modified to accommodate these 2 new types of elements while integrating the elements saved in the old cache format. It is therefore possible to manage the cache linked to all layer addition options but the detection of the elements to be cached will be developed later and will be managed in the
modules/results/display.py
.