Because plugins are loaded for every paster command, regardless of which
paster command is being run, when lots of plugins are installed startup
time can be substantial.
To fix this, making sure that plugin.py in various extensions doesn't
import unnecessary (and potentially slow) modules, this PR moves the
imports of some function into the function where they are called.
This reduces paster startup time (for me) by up to .5 seconds, which
while not significant by itself, contributes to my current 8 second
startup time.
Set the L.TileLayer as a TMS. It's required if the base layer specified in custom.url is a TMS. The default value of tms is false in Leaflet.
To use the TMS option, ```ckanext.spatial.common_map.tms = true``` has to be set in the ckan .INI file.
Same as https://github.com/ckan/ckanext-geoview/pull/24
* Keep old entry points for preview plugins so people does not need to
do python setup.py develop
* Version checks should be done including the min_version parameter,
otherwise they will fail for 2.4, 2.5...
* No need to define different methods for different interfaces. If
running eg 2.3, the IResourcePreview interface methods will simply be
ignored.
* Simplified same domain checking
* Add note about these being eventually migrated to ckanext-geoviews
* Added docs
Completely reviewed and refactored tests to support both CKAN 2.2/2.3,
geoalchemy 1/2 and PostGIS 1/2 (TODO test on PostGIS 1.5)
Removed all references to legacy ckan tests, and removed old or
incomplete tests.
This allows code in lib, model etc to not worry about GeoAlchemy
versions. This assume the correct library installed, as the check has
been done when starting up.
If using CKAN>=2.3 and GeoAlchemy2 is not installed an ImportError
will be raised with details about how to proceed. Added a section
on the Troubleshooting.
Moved the call to get_site_user higher on base.py so it's available to
extensions. Also added the parsed XML etree so it does not need to be
parsed from the string again.