Giter Club home page Giter Club logo

qgis-resourcesharing's Introduction

The QGIS Resource Sharing Plugin

Build Status Coverage Status

Code style: black pre-commit pre-commit.ci status Flake8

The QGIS Resource Sharing allows sharing of resources (currently SVGs, symbols, styles, color ramps, processing scripts, processing models and R scripts), and this plugin gives you access to shared collections.

The documentation explains how to use the plugin and how to share resources.

Contributing

Please read the contribution guidelines.

qgis-resourcesharing's People

Contributors

akbargumbira avatar anitagraser avatar dependabot[bot] avatar elpaso avatar gacarrillor avatar gitter-badger avatar gustry avatar guts avatar havatv avatar ismailsunni avatar pre-commit-ci[bot] avatar ptitjano avatar slarosa avatar ymoisan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qgis-resourcesharing's Issues

add processing models as resource

In addition to processing scripts, add also processing models as installable resources. Processing script collections may often have associated processing models which use the scripts.

classFactory() error

I get the following error when trying to install this plugin through QGIS 3 plugin manager. I am on 3.10.2-A Coruña:

Couldn't load plugin 'qgis_resource_sharing' due to an error when calling its classFactory() method 

AttributeError: 'NoneType' object has no attribute 'strip' 
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing\__init__.py", line 56, in classFactory
    return Plugin(iface)
  File "C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing\resource_sharing\plugin.py", line 65, in __init__
    self.dlg = ResourceSharingDialog(iface=self.iface)
  File "C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing\resource_sharing\gui\resource_sharing_dialog.py", line 156, in __init__
    self.repository_manager = RepositoryManager()
  File "C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing\resource_sharing\repository_manager.py", line 68, in __init__
    self.fetch_online_directories()
  File "C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing\resource_sharing\repository_manager.py", line 97, in fetch_online_directories
    self._online_directories[row['name']] = row['url'].strip()
AttributeError: 'NoneType' object has no attribute 'strip'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.10.2-A Coruña A Coruña, 616ad4531b 

Python Path:
C:/OSGEO4~1/apps/qgis/./python
C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGEO4~1/apps/qgis/./python/plugins
C:\OSGEO4~1\apps\Python37
C:\OSGEO4~1\apps\Python37\Scripts
C:\OSGeo4W64\bin\python37.zip
C:\OSGEO4~1\apps\Python37\DLLs
C:\OSGEO4~1\apps\Python37\lib
C:\OSGeo4W64\bin
C:\OSGEO4~1\apps\Python37\lib\site-packages
C:\OSGEO4~1\apps\Python37\lib\site-packages\win32
C:\OSGEO4~1\apps\Python37\lib\site-packages\win32\lib
C:\OSGEO4~1\apps\Python37\lib\site-packages\Pythonwin
C:/Users/christianl/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\christianl\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms
C:\Users\christianl\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing
C:\Users\christianl\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs

Design Plugin Toolbar Icon

If we keep the toolbar icon, it needs an icon.

... Thinking about it, maybe it would be best to remove the toolbar and only keep it in the menu - just like Plugin Installer.

urlopen error : proxy issue?

Hello,

I'm wondering if anybody is experiencing connection issue with this plugin when behind a proxy?
As for me, (I'm behind a proxy) , I can't download any collections and I systematically encounter:

Error : <urlopen error [Errno 10060] ..Failed attempt.. etc..

I precise that I can normally browse to Github with a regular browser through my proxy.

Uncaught KeyError: 'ssh'

Steps to reproduce

  1. First
  2. Second
  3. Third
Traceback (most recent call last):
  File "C:/Users/Salvatore/.qgis2/python/plugins\qgis_resources_sharing\resource_sharing\collection_manager.py", line 43, in run
    self._collection_id)
  File "C:/Users/Salvatore/.qgis2/python/plugins\qgis_resources_sharing\resource_sharing\collection_manager.py", line 139, in download
    collection_id, register_name)
  File "C:/Users/Salvatore/.qgis2/python/plugins\qgis_resources_sharing\resource_sharing\repository_handler\remote_git_handler.py", line 130, in download_collection
    if self.url.encode('utf-8') == git_parsed.url2ssh:
  File "C:/Users/Salvatore/.qgis2/python/plugins\qgis_resources_sharing\ext_libs\giturlparse\result.py", line 68, in url2ssh
    return self.format('ssh')
  File "C:/Users/Salvatore/.qgis2/python/plugins\qgis_resources_sharing\ext_libs\giturlparse\result.py", line 54, in format
    return self._platform_obj.FORMATS[protocol] % self._parsed
KeyError: 'ssh'

qgis_resources_sharing 0.5.1, QGIS 2.18.14 on Windows 10

Collection loading stops when a collection with incompatible version is found

If a repository contains a collection that has a version range that is incompatible with the user's QGIS version, collections that are listed after that incompatible collection are not considered.
This means that if the user is on QGIS 3.4, a collection that is for QGIS 2.0 to QGIS 2.99 that is listed before QGIS 3 collections in the repository will block those QGIS 3 collections.
The official "QGIS-Resources" repository starts with collections that have the QGIS version range 2.0 - 2.99, meaning that QGIS 3 users will not be able to load anything from the offical QGIS repository!

QgsSymbolLayerV2Utils.loadSymbol does not load one symbol

I wildly commented this line https://github.com/akbargumbira/qgis_resources_sharing/blob/develop/test/test_symbol_xml_extractor.py#L32 so that all the unittests can pass and release a new version (supporting gogs and gitlab repository handler from @slarosa).

But there is a bigger problem there that might be a problem in QGIS LTR. This line here https://github.com/akbargumbira/qgis_resources_sharing/blob/develop/resource_sharing/symbol_xml_extractor.py#L45 is to load a symbol from XML element. It failed to load one symbol from this xml here https://github.com/akbargumbira/qgis_resources_data/blob/master/collections/test_collection/symbol/various_symbols.xml. The symbol that can't be loaded is this one https://github.com/akbargumbira/qgis_resources_data/blob/master/collections/test_collection/symbol/various_symbols.xml#L83. QgsSymbolLayerV2Utils.loadSymbol() for that symbol element gives None from sip API, so some fixes in QGIS is needed.

Unable to add repository: Network access is disable

I just downloaded and installed version 0.6.0. First thing I noticed is that there were no default repos, secondly each time I try to add any repo I get the error "Unable to add repository: Network access is disable"

Make the plugin available from the Web menu

The plugin now resides in the Plugins menu, and for that menu, a submenu, Resource Sharing will be included (with only one entry - Resource Sharing)! This is not very convenient.
It has been proposed (#28) to move the plugin to the Settings menu. But this is currently not possible. Of the "available" menus, the Web menu seems to be the most natural to use (until it is possible to include it in the Settings menu).

Move ~/QGIS/Resource Sharing to ~/.qgis2/resource_sharing/

I guess I'm not the only one who immediately remove such directories that clutter my home dir,
what unfortunately casuses the nasty error #43 ;)

Moving the directory into .qgis2/resouce_sharing would:

  • Protect it from being hastily deleted by spitfires and lock the plugin

  • The opposite: allow to clear all local data by removing just one directory, easy to find in an expected location.

  • Make the home dir clean and the user happy 🎉

What do you think about it?

Crash on install of qrs, QGIS 2.16.1

Ubuntu 16.04.1
This is what stderr reports:
Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_NZ]
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_NZ]
Warning: QCss::Parser - Failed to load file "/style.qss"
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
Warning: QFileSystemWatcher: failed to add paths: /home/robin/.qgis2//project_templates
Warning: QLayout: Attempting to add QLayout "" to QgsPanelWidgetStack "mWidgetStack", which already has a layout
Warning: QFileInfo::absolutePath: Constructed with empty filename
Warning: QFileInfo::absolutePath: Constructed with empty filename
Exception UnboundLocalError: "local variable 'SSGetClass' referenced before assignment" in <bound method QadMBUFFERCommandClass.del of <qad.qad_mbuffer_cmd.QadMBUFFERCommandClass instance at 0x7fac7c856638>> ignored
Exception UnboundLocalError: "local variable 'SSGetClass' referenced before assignment" in <bound method QadMBUFFERCommandClass.del of <qad.qad_mbuffer_cmd.QadMBUFFERCommandClass instance at 0x7fac7c805ef0>> ignored
Warning: Object::connect: No such signal QWebPage::loadProgress(int)
Warning: Object::connect: No such signal QWebPage::unsupportedContent(QNetworkReply*)
Warning: Object::connect: No such signal QWebFrame::titleChanged(QString)
Warning: Object::connect: No such signal QWebPage::loadProgress(int)
Warning: Object::connect: No such signal QWebFrame::titleChanged(QString)
Warning: Object::connect: No such signal QWebFrame::iconChanged()
Warning: Object::connect: No such signal QWebFrame::urlChanged(QUrl)
Warning: Object::connect: No such signal QWebPage::loadStarted()
Warning: Object::connect: No such signal QWebPage::loadProgress(int)
Warning: Object::connect: No such signal QWebPage::loadFinished(bool)
Warning: Object::connect: No such signal QWebPage::statusBarMessage(QString)
Warning: Object::connect: No such signal QWebPage::linkClicked(QUrl)
Warning: Object::connect: No such signal QWebPage::selectionChanged()
Warning: Object::connect: No such signal QWebPage::microFocusChanged()
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
[1] 11865 segmentation fault (core dumped) qgis

Users of the quickosm project had some problems with qwebkit also, perhaps the two are related?
https://github.com/3liz/quickosm/issues

Deleting repositories does not work

In "Settings", if a collection repository is selected and the "Delete" button is pressed, the following error message appears:
error_message_iteritems
The reason for the error message is that this part of the code has not been updated to Python 3.
PR #58 fixes it for me. It is a simple fix - just change iteritems() to items() in line 113.

[WinErr 32] when installing collections

When testing on Windows 10, I get this WinErr 32, complaining that "The process cannot access the file because it is being used by another process: " and the a reference to some object in .git of the repository. No problems on Ubuntu 18.04.
I have tested on the developing version and on some earlier versions.

Use QgsSettings instead of QSettings

QgsSettings is preferred over QSettings.

See comments in #70.

- from qgis.PyQt.QtCore import QDir, QSettings
+ from qgis.PyQt.QtCore import QDir
+ from qgis.core import QgsSettings

QSettings is used in repository_manager.py, plugin.py, svg_handler.py, resource_sharing_dialog.py, ...

[Qgis <2.12] Error loading plugin / QgsAuthConfigSelect

QgsAuthConfigSelect is not available in Qgis before version 2.12 if I am right, so the plugin cannot be installed for example in Qgis 2.8.
If QgsAuthConfigSelect is absolutely necessary, qgisMinimumVersion should be 2.12 in metadata.txt and not 2.0

Share aloso R scripts

Would it be possible to extend the plugin to share also R scripts for QGIS 3?

Tricky part could be that now R Processing is a separated plugin and not a core part anymore

Can't run (or install) the plugin if ~/QGIS/Resource Sharing doesn't exist

I couldn't run the plugin after removing ~/QGIS/Resource Sharing. I had to re-create the directory manually prior to loading the plugin.

Traceback (most recent call last):
  File "/home/borys/sources/qgis/build-2_18/output/python/qgis/utils.py", line 333, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/__init__.py", line 58, in classFactory
    return Plugin(iface)
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/plugin.py", line 61, in __init__
    self.dlg = ResourceSharingDialog(iface=self.iface)
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/gui/resource_sharing_dialog.py", line 140, in __init__
    self.repository_manager = RepositoryManager()
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/repository_manager.py", line 72, in __init__
    self.load_repositories()
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/repository_manager.py", line 358, in load_repositories
    self.rebuild_collections()
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/repository_manager.py", line 325, in rebuild_collections
    self._collections_manager.uninstall(collection_id)
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/collection_manager.py", line 169, in uninstall
    resource_handler_instance.uninstall()
  File "/home/borys/.qgis2/python/plugins/qgis_resource_sharing/resource_sharing/resource_handler/svg_handler.py", line 55, in uninstall
    collection_directories = os.listdir(local_collection_path())
OSError: [Errno 2] No file or directory: '/home/borys/QGIS/Resource Sharing'

By the way, what about using the existing ~/.qgis2/resource_sharing rather than creating an additional top-level subdirectory in the homedir?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.