Skip to content

Commit

Permalink
plugin init updated
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed Oct 29, 2023
1 parent 332b599 commit 572b5eb
Show file tree
Hide file tree
Showing 19 changed files with 186 additions and 193 deletions.
22 changes: 6 additions & 16 deletions build_plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,19 @@ Build the plugin

.. figure:: images/pyrcc5-help.png

.. note:: If you are on MS Windows, open *OSGeo4W Shell* (ideally as
*administrator*) and run two scripts before any attempts:
``py3_env`` and ``qt5_env``
.. note:: If you are on MS Windows, open *OSGeo4W Shell*:

.. code-block:: bash
c:\> py3_env
c:\> qt5_env
c:\> pyrcc5 -help
.. figure:: images/pyrcc5-windows.png
.. figure:: images/pyrcc5-windows.png

To build the plugin :program:`pb_tool` must be available in the system. This
package is available via PyPI service (using ``pip install``).
package is available via PyPI service.

.. note:: It might look as good idea to use standard ``make``, since
Makefile is available too. This is considered deprecated option and
should no longer be used. ``pb_tool`` is more complex build system
(and supports various operating systems).

To install ``pb_tool``, just use
To install ``pb_tool`` run the command below (on MS Windows use *OSGeo4W Shell*):

.. code-block:: bash
Expand Down Expand Up @@ -67,7 +57,7 @@ First we compile UI files

.. code-block:: bat
%homepath%\AppData\Roaming\Python\Python37\Scripts\pb_tool compile
%homepath%\AppData\Roaming\Python\Python39\Scripts\pb_tool compile
..
..
Expand Down Expand Up @@ -158,7 +148,7 @@ To create the virtualenv, run
python3 -m venv myvenv
For QGIS running within Python `virtualenv`, you need to adjust
:file:``activate` script and add :envvar:`PYTHONPATH` with Python, Qt
:file:`activate` script and add :envvar:`PYTHONPATH` with Python, Qt
and QGIS libraries.

.. code-block:: bash
Expand Down
Binary file removed images/plugin_builder7.png
Binary file not shown.
Binary file modified images/pyrcc5-windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/01-initial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ The key file is :file:`save_views.py` and the ``run()`` method:
:linenos:

.. note:: The code can be downloaded from `our Github
<https://github.com/GISMentors/qgis-plugins/tree/master/src/save_views-01-init>`__.
<https://github.com/GISMentors/qgis-plugins/tree/master/src/save_views01-init>`__.
9 changes: 8 additions & 1 deletion plugins/02-ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ For now, we need two user inputs:
* Output target directory

.. task:: In the Qt Designer create two required inputs. Use
:pyqgis:`QgsMapLayerComboBox` for layer selection, :pyqgis:`QgsFileWidget` for
`QgsMapLayerComboBox
<https://qgis.org/pyqgis/3.28/gui/QgsMapLayerComboBox.html>`__ for
layer selection, `QgsFileWidget
<https://qgis.org/pyqgis/3.28/gui/QgsFileWidget.html>`__ for
output dir name.

Use ``objectName`` attribute to name the objects: `layers`,
Expand Down Expand Up @@ -75,3 +78,7 @@ Finally, we approach to the heart of the plugin: the ``save_views()`` method.
:class: large

Example of image files stored in output directory.

.. note:: The code can be downloaded from `our Github
<https://github.com/GISMentors/qgis-plugins/tree/master/src/save_views02>`__.

10 changes: 5 additions & 5 deletions src/save_views01-init/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#/***************************************************************************
# SaveViews
#
# Plugin saves map image for every feature in the layer
# xxx
# -------------------
# begin : 2020-03-06
# begin : 2023-10-28
# git sha : $Format:%H$
# copyright : (C) 2020 by GISMentors
# email : [email protected]
# copyright : (C) 2023 by x
# email : y
# ***************************************************************************/
#
#/***************************************************************************
Expand Down Expand Up @@ -65,7 +65,7 @@ PEP8EXCLUDE=pydev,resources.py,conf.py,third_party,ui
# * Windows:
# AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins'

QGISDIR=/home/jachym/.local/share/QGIS/QGIS3/profiles/default/python/plugins/
QGISDIR=C:\Users\martin\AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins

#################################################
# Normally you would not need to edit below here
Expand Down
4 changes: 2 additions & 2 deletions src/save_views01-init/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ <h3>Plugin Builder Results</h3>

<div id='help' style='font-size:.9em;'>
Your plugin <b>SaveViews</b> was created in:<br>
&nbsp;&nbsp;<b>/home/jachym/src/qgis_plugins/save_views</b>
&nbsp;&nbsp;<b>C:/Users/martin/Documents/qgis_plugins\save_views</b>
<p>
Your QGIS plugin directory is located at:<br>
&nbsp;&nbsp;<b>/home/jachym/.local/share/QGIS/QGIS3/profiles/default/python/plugins</b>
&nbsp;&nbsp;<b>C:/Users/martin/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins</b>
<p>
<h3>What's Next</h3>
<ol>
Expand Down
4 changes: 2 additions & 2 deletions src/save_views01-init/README.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Plugin Builder Results

Your plugin SaveViews was created in:
/home/jachym/src/qgis_plugins/save_views
C:/Users/martin/Documents/qgis_plugins\save_views

Your QGIS plugin directory is located at:
/home/jachym/.local/share/QGIS/QGIS3/profiles/default/python/plugins
C:/Users/martin/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins

What's Next:

Expand Down
8 changes: 4 additions & 4 deletions src/save_views01-init/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
/***************************************************************************
SaveViews
A QGIS plugin
Plugin saves map image for every feature in the layer
xxx
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2020-03-06
copyright : (C) 2020 by GISMentors
email : [email protected]
begin : 2023-10-28
copyright : (C) 2023 by x
email : y
git sha : $Format:%H$
***************************************************************************/
Expand Down
6 changes: 3 additions & 3 deletions src/save_views01-init/help/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

# General information about the project.
project = u'SaveViews'
copyright = u'2013, GISMentors'
copyright = u'2013, x'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -179,7 +179,7 @@
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'SaveViews.tex', u'SaveViews Documentation',
u'GISMentors', 'manual'),
u'x', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -212,5 +212,5 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'TemplateClass', u'SaveViews Documentation',
[u'GISMentors'], 1)
[u'x'], 1)
]
6 changes: 3 additions & 3 deletions src/save_views01-init/pb_tool.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Configuration file for plugin builder tool (pb_tool)
# Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
# -------------------
# begin : 2020-03-06
# copyright : (C) 2020 by GISMentors
# email : [email protected]
# begin : 2023-10-28
# copyright : (C) 2023 by x
# email : y
# ***************************************************************************/
#
#/***************************************************************************
Expand Down
Empty file modified src/save_views01-init/plugin_upload.py
100755 → 100644
Empty file.
Loading

0 comments on commit 572b5eb

Please sign in to comment.