Skip to content

Commit 1cb53f0

Browse files
committed
Initial qgis plugin setup, generated through QGIS plugin builder.
1 parent 5651486 commit 1cb53f0

37 files changed

+2571
-0
lines changed

Makefile

+244
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
#/***************************************************************************
2+
# Geodms
3+
#
4+
# Geodms plugin for qgis
5+
# -------------------
6+
# begin : 2025-03-28
7+
# git sha : $Format:%H$
8+
# copyright : (C) 2025 by Object Vision BV
9+
10+
# ***************************************************************************/
11+
#
12+
#/***************************************************************************
13+
# * *
14+
# * This program is free software; you can redistribute it and/or modify *
15+
# * it under the terms of the GNU General Public License as published by *
16+
# * the Free Software Foundation; either version 2 of the License, or *
17+
# * (at your option) any later version. *
18+
# * *
19+
# ***************************************************************************/
20+
21+
#################################################
22+
# Edit the following to match your sources lists
23+
#################################################
24+
25+
26+
#Add iso code for any locales you want to support here (space separated)
27+
# default is no locales
28+
# LOCALES = af
29+
LOCALES =
30+
31+
# If locales are enabled, set the name of the lrelease binary on your system. If
32+
# you have trouble compiling the translations, you may have to specify the full path to
33+
# lrelease
34+
#LRELEASE = lrelease
35+
#LRELEASE = lrelease-qt4
36+
37+
38+
# translation
39+
SOURCES = \
40+
__init__.py \
41+
geodms.py geodms_dockwidget.py
42+
43+
PLUGINNAME = geodms
44+
45+
PY_FILES = \
46+
__init__.py \
47+
geodms.py geodms_dockwidget.py
48+
49+
UI_FILES = geodms_dockwidget_base.ui
50+
51+
EXTRAS = metadata.txt icon.png
52+
53+
EXTRA_DIRS =
54+
55+
COMPILED_RESOURCE_FILES = resources.py
56+
57+
PEP8EXCLUDE=pydev,resources.py,conf.py,third_party,ui
58+
59+
# QGISDIR points to the location where your plugin should be installed.
60+
# This varies by platform, relative to your HOME directory:
61+
# * Linux:
62+
# .local/share/QGIS/QGIS3/profiles/default/python/plugins/
63+
# * Mac OS X:
64+
# Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
65+
# * Windows:
66+
# AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins'
67+
68+
QGISDIR=C:\Users\Cicada\AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins
69+
70+
#################################################
71+
# Normally you would not need to edit below here
72+
#################################################
73+
74+
HELP = help/build/html
75+
76+
PLUGIN_UPLOAD = $(c)/plugin_upload.py
77+
78+
RESOURCE_SRC=$(shell grep '^ *<file' resources.qrc | sed 's@</file>@@g;s/.*>//g' | tr '\n' ' ')
79+
80+
.PHONY: default
81+
default:
82+
@echo While you can use make to build and deploy your plugin, pb_tool
83+
@echo is a much better solution.
84+
@echo A Python script, pb_tool provides platform independent management of
85+
@echo your plugins and runs anywhere.
86+
@echo You can install pb_tool using: pip install pb_tool
87+
@echo See https://g-sherman.github.io/plugin_build_tool/ for info.
88+
89+
compile: $(COMPILED_RESOURCE_FILES)
90+
91+
%.py : %.qrc $(RESOURCES_SRC)
92+
pyrcc5 -o $*.py $<
93+
94+
%.qm : %.ts
95+
$(LRELEASE) $<
96+
97+
test: compile transcompile
98+
@echo
99+
@echo "----------------------"
100+
@echo "Regression Test Suite"
101+
@echo "----------------------"
102+
103+
@# Preceding dash means that make will continue in case of errors
104+
@-export PYTHONPATH=`pwd`:$(PYTHONPATH); \
105+
export QGIS_DEBUG=0; \
106+
export QGIS_LOG_FILE=/dev/null; \
107+
nosetests -v --with-id --with-coverage --cover-package=. \
108+
3>&1 1>&2 2>&3 3>&- || true
109+
@echo "----------------------"
110+
@echo "If you get a 'no module named qgis.core error, try sourcing"
111+
@echo "the helper script we have provided first then run make test."
112+
@echo "e.g. source run-env-linux.sh <path to qgis install>; make test"
113+
@echo "----------------------"
114+
115+
deploy: compile doc transcompile
116+
@echo
117+
@echo "------------------------------------------"
118+
@echo "Deploying plugin to your .qgis2 directory."
119+
@echo "------------------------------------------"
120+
# The deploy target only works on unix like operating system where
121+
# the Python plugin directory is located at:
122+
# $HOME/$(QGISDIR)/python/plugins
123+
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
124+
cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
125+
cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
126+
cp -vf $(COMPILED_RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
127+
cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
128+
cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
129+
cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
130+
# Copy extra directories if any
131+
(foreach EXTRA_DIR,(EXTRA_DIRS), cp -R (EXTRA_DIR) (HOME)/(QGISDIR)/python/plugins/(PLUGINNAME)/;)
132+
133+
134+
# The dclean target removes compiled python files from plugin directory
135+
# also deletes any .git entry
136+
dclean:
137+
@echo
138+
@echo "-----------------------------------"
139+
@echo "Removing any compiled python files."
140+
@echo "-----------------------------------"
141+
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
142+
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".git" -prune -exec rm -Rf {} \;
143+
144+
145+
derase:
146+
@echo
147+
@echo "-------------------------"
148+
@echo "Removing deployed plugin."
149+
@echo "-------------------------"
150+
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
151+
152+
zip: deploy dclean
153+
@echo
154+
@echo "---------------------------"
155+
@echo "Creating plugin zip bundle."
156+
@echo "---------------------------"
157+
# The zip target deploys the plugin and creates a zip file with the deployed
158+
# content. You can then upload the zip file on http://plugins.qgis.org
159+
rm -f $(PLUGINNAME).zip
160+
cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
161+
162+
package: compile
163+
# Create a zip package of the plugin named $(PLUGINNAME).zip.
164+
# This requires use of git (your plugin development directory must be a
165+
# git repository).
166+
# To use, pass a valid commit or tag as follows:
167+
# make package VERSION=Version_0.3.2
168+
@echo
169+
@echo "------------------------------------"
170+
@echo "Exporting plugin to zip package. "
171+
@echo "------------------------------------"
172+
rm -f $(PLUGINNAME).zip
173+
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
174+
echo "Created package: $(PLUGINNAME).zip"
175+
176+
upload: zip
177+
@echo
178+
@echo "-------------------------------------"
179+
@echo "Uploading plugin to QGIS Plugin repo."
180+
@echo "-------------------------------------"
181+
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip
182+
183+
transup:
184+
@echo
185+
@echo "------------------------------------------------"
186+
@echo "Updating translation files with any new strings."
187+
@echo "------------------------------------------------"
188+
@chmod +x scripts/update-strings.sh
189+
@scripts/update-strings.sh $(LOCALES)
190+
191+
transcompile:
192+
@echo
193+
@echo "----------------------------------------"
194+
@echo "Compiled translation files to .qm files."
195+
@echo "----------------------------------------"
196+
@chmod +x scripts/compile-strings.sh
197+
@scripts/compile-strings.sh $(LRELEASE) $(LOCALES)
198+
199+
transclean:
200+
@echo
201+
@echo "------------------------------------"
202+
@echo "Removing compiled translation files."
203+
@echo "------------------------------------"
204+
rm -f i18n/*.qm
205+
206+
clean:
207+
@echo
208+
@echo "------------------------------------"
209+
@echo "Removing uic and rcc generated files"
210+
@echo "------------------------------------"
211+
rm $(COMPILED_UI_FILES) $(COMPILED_RESOURCE_FILES)
212+
213+
doc:
214+
@echo
215+
@echo "------------------------------------"
216+
@echo "Building documentation using sphinx."
217+
@echo "------------------------------------"
218+
cd help; make html
219+
220+
pylint:
221+
@echo
222+
@echo "-----------------"
223+
@echo "Pylint violations"
224+
@echo "-----------------"
225+
@pylint --reports=n --rcfile=pylintrc . || true
226+
@echo
227+
@echo "----------------------"
228+
@echo "If you get a 'no module named qgis.core' error, try sourcing"
229+
@echo "the helper script we have provided first then run make pylint."
230+
@echo "e.g. source run-env-linux.sh <path to qgis install>; make pylint"
231+
@echo "----------------------"
232+
233+
234+
# Run pep8 style checking
235+
#http://pypi.python.org/pypi/pep8
236+
pep8:
237+
@echo
238+
@echo "-----------"
239+
@echo "PEP8 issues"
240+
@echo "-----------"
241+
@pep8 --repeat --ignore=E203,E121,E122,E123,E124,E125,E126,E127,E128 --exclude $(PEP8EXCLUDE) . || true
242+
@echo "-----------"
243+
@echo "Ignored in PEP8 check:"
244+
@echo $(PEP8EXCLUDE)

README.html

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<html>
2+
<body>
3+
<h3>Plugin Builder Results</h3>
4+
5+
Congratulations! You just built a plugin for QGIS!<br/><br />
6+
7+
<div id='help' style='font-size:.9em;'>
8+
Your plugin <b>Geodms</b> was created in:<br>
9+
&nbsp;&nbsp;<b>C:/dev/geodms_qgis\geodms</b>
10+
<p>
11+
Your QGIS plugin directory is located at:<br>
12+
&nbsp;&nbsp;<b>C:/Users/Cicada/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins</b>
13+
<p>
14+
<h3>What's Next</h3>
15+
<ol>
16+
<li>In your plugin directory, compile the resources file using pyrcc5 (simply run <b>make</b> if you have automake or use <b>pb_tool</b>)
17+
<li>Test the generated sources using <b>make test</b> (or run tests from your IDE)
18+
<li>Copy the entire directory containing your new plugin to the QGIS plugin directory (see Notes below)
19+
<li>Test the plugin by enabling it in the QGIS plugin manager
20+
<li>Customize it by editing the implementation file <b>geodms.py</b>
21+
<li>Create your own custom icon, replacing the default <b>icon.png</b>
22+
<li>Modify your user interface by opening <b>geodms_dockwidget_base.ui</b> in Qt Designer
23+
</ol>
24+
Notes:
25+
<ul>
26+
<li>You can use the <b>Makefile</b> to compile and deploy when you
27+
make changes. This requires GNU make (gmake). The Makefile is ready to use, however you
28+
will have to edit it to add addional Python source files, dialogs, and translations.
29+
<li>You can also use <b>pb_tool</b> to compile and deploy your plugin. Tweak the <i>pb_tool.cfg</i> file included with your plugin as you add files. Install <b>pb_tool</b> using
30+
<i>pip</i> or <i>easy_install</i>. See <b>http://loc8.cc/pb_tool</b> for more information.
31+
</ul>
32+
</div>
33+
<div style='font-size:.9em;'>
34+
<p>
35+
For information on writing PyQGIS code, see <b>http://loc8.cc/pyqgis_resources</b> for a list of resources.
36+
</p>
37+
</div>
38+
<p>
39+
&copy;2011-2018 GeoApt LLC - geoapt.com
40+
</p>
41+
</body>
42+
</html>

README.txt

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Plugin Builder Results
2+
3+
Your plugin Geodms was created in:
4+
C:/dev/geodms_qgis\geodms
5+
6+
Your QGIS plugin directory is located at:
7+
C:/Users/Cicada/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins
8+
9+
What's Next:
10+
11+
* Copy the entire directory containing your new plugin to the QGIS plugin
12+
directory
13+
14+
* Compile the resources file using pyrcc5
15+
16+
* Run the tests (``make test``)
17+
18+
* Test the plugin by enabling it in the QGIS plugin manager
19+
20+
* Customize it by editing the implementation file: ``geodms.py``
21+
22+
* Create your own custom icon, replacing the default icon.png
23+
24+
* Modify your user interface by opening Geodms_dockwidget_base.ui in Qt Designer
25+
26+
* You can use the Makefile to compile your Ui and resource files when
27+
you make changes. This requires GNU make (gmake)
28+
29+
For more information, see the PyQGIS Developer Cookbook at:
30+
http://www.qgis.org/pyqgis-cookbook/index.html
31+
32+
(C) 2011-2018 GeoApt LLC - geoapt.com

__init__.py

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
/***************************************************************************
4+
Geodms
5+
A QGIS plugin
6+
Geodms plugin for qgis
7+
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
8+
-------------------
9+
begin : 2025-03-28
10+
copyright : (C) 2025 by Object Vision BV
11+
12+
git sha : $Format:%H$
13+
***************************************************************************/
14+
15+
/***************************************************************************
16+
* *
17+
* This program is free software; you can redistribute it and/or modify *
18+
* it under the terms of the GNU General Public License as published by *
19+
* the Free Software Foundation; either version 2 of the License, or *
20+
* (at your option) any later version. *
21+
* *
22+
***************************************************************************/
23+
This script initializes the plugin, making it known to QGIS.
24+
"""
25+
26+
27+
# noinspection PyPep8Naming
28+
def classFactory(iface): # pylint: disable=invalid-name
29+
"""Load Geodms class from file Geodms.
30+
31+
:param iface: A QGIS interface instance.
32+
:type iface: QgsInterface
33+
"""
34+
#
35+
from .geodms import Geodms
36+
return Geodms(iface)

compile.bat

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@echo off
2+
call C:/OSGeo4W/bin/o4w_env.bat
3+
@echo on
4+
5+
C:/OSGeo4W/apps/Python312/Scripts/pyrcc5.exe -o resources.py resources.qrc
6+
7+
xcopy C:\dev\geodms_qgis\geodms C:\OSGeo4W\apps\qgis\python\plugins\geodms /E /H /C /I
8+

0 commit comments

Comments
 (0)