Skip to content

Commit

Permalink
v0.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
wilhelmberg committed Feb 11, 2016
1 parent 9c9f7d1 commit 1e75bcb
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 13 deletions.
6 changes: 5 additions & 1 deletion CKAN-Browser/ckanconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def get_file_size(self, url):
self.util.msg_log(u'Requesting HEAD for: {0}'.format(url))

try:
request_head = requests.head(url, timeout=self.settings.request_timeout)
request_head = requests.head(
url
, proxies=self.settings.get_proxies()[1]
, timeout=self.settings.request_timeout
)
except requests.exceptions.ConnectTimeout as cte:
#self.util.msg_log(u'{0}\n{1}\n\n\n{2}'.format(cte, dir(cte), cte.message))
return False, self.util.tr(u'cc_connection_timeout').format(cte.message)
Expand Down
8 changes: 6 additions & 2 deletions CKAN-Browser/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name=CKAN-Browser
qgisMinimumVersion=2.0
about=Download and display Open Data from CKAN Metadata Servers
description=Download and display Open Data from CKAN Metadata Servers
version=0.2.8
version=0.2.9
author=BergWerkGIS
[email protected]

Expand All @@ -20,7 +20,11 @@ [email protected]
# Optional items:

# Uncomment the following line and add your changelog:
changelog=minor fixes for WM(T)S, WFS
changelog=v0.2.9 2015 (2016-02-11)
* Japanese translation by https://github.com/yoichigmf https://github.com/BergWerkGIS/QGIS-CKAN-Browser/pull/8
* Support for proxies with login/password https://github.com/BergWerkGIS/QGIS-CKAN-Browser/issues/5
* Extracting of geodata containing non ascii-characters https://github.com/BergWerkGIS/QGIS-CKAN-Browser/issues/3


# Tags are comma separated with spaces allowed
tags=open data, ckan
Expand Down
12 changes: 8 additions & 4 deletions CKAN-Browser/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ def get_proxies(self):
proxy_type = s.value('proxy/proxyType', '')
proxy_host = s.value('proxy/proxyHost', '')
proxy_port = s.value('proxy/proxyPort', '')
proxy_user = s.value('proxy/proxyUser', '')
proxy_password = s.value('proxy/proxyPassword', '')
proxy_user = s.value('proxy/proxyUser', None)
proxy_password = s.value('proxy/proxyPassword', None)
if proxy_enabled == 'false' or not proxy_enabled:
return False, None
if proxy_type == 'HttpProxy':
proxy_string = ''
if proxy_user is not None and proxy_password is not None:
proxy_string += proxy_user + ':' + proxy_password + '@'
proxy_string += proxy_host + ':' + proxy_port
return True, {
'http': proxy_host + ':' + proxy_port,
'https': proxy_host + ':' + proxy_port,
'http': proxy_string,
'https': proxy_string
}


Expand Down
8 changes: 5 additions & 3 deletions CKAN-Browser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def extract_zip(self, archive, dest_dir):
self.msg_log(u'dest_dir: {0}'.format(dest_dir))

for file_info in f.infolist():
file_name = os.path.join(dest_dir, file_info.filename.decode('utf8'))
#file_name = os.path.join(dest_dir, file_info.filename.decode('utf8'))
#decode('utf8') fails on Windows with umlauts in filenames
file_name = os.path.join(dest_dir, file_info.filename)
# different types of ZIPs
# some have a dedicated entry for folders
if file_name[-1] == u'/':
Expand Down Expand Up @@ -163,14 +165,14 @@ def add_lyrs_from_dir(self, data_dir, layer_name, layer_url):
if len(geo_files) < 1:
self.msg_log('len(geo_files)<1')
# return False, u'Keine anzeigbaren Daten gefunden in\n{0}.\n\n\n ===----!!!TODO!!!----===\n\nBenutzer anbieten Verzeichnis zu öffnen'.format(dir)
return False, {"message":"unknown fileytpe", "dir_path": data_dir}
return False, {"message": "unknown fileytpe", "dir_path": data_dir}
for geo_file in geo_files:
if os.path.basename(geo_file).lower().endswith('.shp.xml'):
self.msg_log(u'skipping {0}'.format(geo_file))
continue
self.msg_log(geo_file)
full_path = os.path.join(data_dir, geo_file)
full_layer_name = layer_name + ' - ' + geo_file
full_layer_name = layer_name + ' - ' + os.path.basename(geo_file)
low_case = os.path.basename(geo_file).lower()
lyr = None

Expand Down
Binary file modified CKANBrowser.zip
Binary file not shown.
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### v0.2.9 2015 (2016-02-11)

* Japanese translation by https://github.com/yoichigmf https://github.com/BergWerkGIS/QGIS-CKAN-Browser/pull/8
* Support for proxies with login/password https://github.com/BergWerkGIS/QGIS-CKAN-Browser/issues/5
* Extracting of geodata containing non ascii-characters https://github.com/BergWerkGIS/QGIS-CKAN-Browser/issues/3

### v0.2.8 2015 (2016-01-27)

* Inital public version
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ QGIS PlugIn to load and display Open Data from CKAN enabled data portals.

Sponsored by [Amt der Kärntner Landesregierung - KAGIS](http://www.kagis.ktn.gv.at)

[Change log](ChangeLog.md)

__DISCLAMER__

_This plugin has been tested with various CKAN servers (**API v3 supported only**), but we soon came to realize that each data portal implements its very own strategy for structuring the metadata._
_This plugin has been tested with various CKAN servers (**API v3 supported only**), but we soon came to realize that each data portal implements its very own strategy for structuring metadata._

**_It is very likely that data from some servers cannot be browsed or downloaded!_**

Expand Down
4 changes: 2 additions & 2 deletions plugins.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<plugins>
<pyqgis_plugin name="CKANBrowser" version="0.2.8">
<pyqgis_plugin name="CKANBrowser" version="0.2.9">
<description><![CDATA[Download and display CKAN enabled Open Data Portals]]></description>
<version>0.2.8</version>
<version>0.2.9</version>
<qgis_minimum_version>2.0.0</qgis_minimum_version>
<qgis_maximum_version>2.99.0</qgis_maximum_version>
<homepage>https://github.com/BergWerkGIS/QGIS-CKAN-Browser</homepage>
Expand Down

0 comments on commit 1e75bcb

Please sign in to comment.