Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4e6a53f

Browse files
author
Peter Wells
committedJul 14, 2014
Initial commit.
1 parent 49d5b12 commit 4e6a53f

31 files changed

+3524
-0
lines changed
 

‎ConstraintChecker/Makefile

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#/***************************************************************************
2+
# ConstraintChecker
3+
#
4+
# FIXME - Check for constraints (e.g. planning) within varying distances from a polygon of interest.
5+
# -------------------
6+
# begin : 2014-03-19
7+
# copyright : (C) 2014 by Lutra Consulting for Dartmoor National Park Authority
8+
# email : fixme@dnpa.gov.uk
9+
# ***************************************************************************/
10+
#
11+
#/***************************************************************************
12+
# * *
13+
# * This program is free software; you can redistribute it and/or modify *
14+
# * it under the terms of the GNU General Public License as published by *
15+
# * the Free Software Foundation; either version 2 of the License, or *
16+
# * (at your option) any later version. *
17+
# * *
18+
# ***************************************************************************/
19+
20+
# CONFIGURATION
21+
PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py
22+
23+
QGISDIR=.qgis2
24+
25+
# Makefile for a PyQGIS plugin
26+
27+
# translation
28+
SOURCES = constraintchecker.py ui_constraintchecker.py __init__.py constraintcheckerdialog.py
29+
#TRANSLATIONS = i18n/constraintchecker_en.ts
30+
TRANSLATIONS =
31+
32+
# global
33+
34+
PLUGINNAME = constraintchecker
35+
36+
PY_FILES = constraintchecker.py constraintcheckerdialog.py __init__.py
37+
38+
EXTRAS = icon.png metadata.txt
39+
40+
UI_FILES = ui_constraintchecker.py
41+
42+
RESOURCE_FILES = resources_rc.py
43+
44+
HELP = help/build/html
45+
46+
default: compile
47+
48+
compile: $(UI_FILES) $(RESOURCE_FILES)
49+
50+
%_rc.py : %.qrc
51+
pyrcc4 -o $*_rc.py $<
52+
53+
%.py : %.ui
54+
pyuic4 -o $@ $<
55+
56+
%.qm : %.ts
57+
lrelease $<
58+
59+
# The deploy target only works on unix like operating system where
60+
# the Python plugin directory is located at:
61+
# $HOME/$(QGISDIR)/python/plugins
62+
deploy: compile doc transcompile
63+
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
64+
cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
65+
cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
66+
cp -vf $(RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
67+
cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
68+
cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
69+
cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
70+
71+
# The dclean target removes compiled python files from plugin directory
72+
# also delets any .svn entry
73+
dclean:
74+
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
75+
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \;
76+
77+
# The derase deletes deployed plugin
78+
derase:
79+
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
80+
81+
# The zip target deploys the plugin and creates a zip file with the deployed
82+
# content. You can then upload the zip file on http://plugins.qgis.org
83+
zip: deploy dclean
84+
rm -f $(PLUGINNAME).zip
85+
cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
86+
87+
# Create a zip package of the plugin named $(PLUGINNAME).zip.
88+
# This requires use of git (your plugin development directory must be a
89+
# git repository).
90+
# To use, pass a valid commit or tag as follows:
91+
# make package VERSION=Version_0.3.2
92+
package: compile
93+
rm -f $(PLUGINNAME).zip
94+
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
95+
echo "Created package: $(PLUGINNAME).zip"
96+
97+
upload: zip
98+
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip
99+
100+
# transup
101+
# update .ts translation files
102+
transup:
103+
pylupdate4 Makefile
104+
105+
# transcompile
106+
# compile translation files into .qm binary format
107+
transcompile: $(TRANSLATIONS:.ts=.qm)
108+
109+
# transclean
110+
# deletes all .qm files
111+
transclean:
112+
rm -f i18n/*.qm
113+
114+
clean:
115+
rm $(UI_FILES) $(RESOURCE_FILES)
116+
117+
# build documentation with sphinx
118+
doc:
119+
cd help; make html

‎ConstraintChecker/README.html

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<html>
2+
<body style='background-color:##D7ECF8;'>
3+
<h3>Plugin Builder Results</h3>
4+
<div id='help' style='font-size:.9em;'>
5+
Your plugin <b>ConstraintChecker</b> was created in:<br>
6+
&nbsp;&nbsp;<b>C:\Users\pete\.qgis2\python\plugins\ConstraintChecker\ConstraintChecker</b>
7+
<p>
8+
Your QGIS plugin directory is located at:<br>
9+
&nbsp;&nbsp;<b>C:/Users/pete/.qgis2/python/plugins</b>
10+
<p>
11+
<b>What's Next</b>
12+
<ol>
13+
<li>Copy the entire directory containing your new plugin to the QGIS plugin directory
14+
<li>Compile the ui file using pyuic4
15+
<li>Compile the resources file using pyrcc4
16+
<li>Test the plugin by enabling it in the QGIS plugin manager
17+
<li>Customize it by editing the implementation file <b>constraintchecker.py</b>
18+
<li>Create your own custom icon, replacing the default <b>icon.png</b>
19+
<li>Modify your user interface by opening <b>constraintchecker.ui</b> in Qt Designer (don't forget to compile it with pyuic4 after changing it)
20+
<li>You can use the <b>Makefile</b> to compile your Ui and resource files when you make changes. This requires GNU make (gmake)
21+
</ul>
22+
</div>
23+
<div style='font-size:.9em;'>
24+
<p>
25+
For more information, see the PyQGIS Developer Cookbook at:
26+
<a href="http://www.qgis.org/pyqgis-cookbook/index.html">http://www.qgis.org/pyqgis-cookbook/index.html</a>.
27+
</p>
28+
</div>
29+
<img src="http://geoapt.com/geoapt_logo_p.png" alt='GeoApt LLC' title='GeoApt LLC' align='absmiddle'>
30+
&copy;2013 GeoApt LLC - geoapt.com
31+
</body>
32+
</html>

‎ConstraintChecker/README.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Plugin Builder Results
2+
3+
Your plugin ConstraintChecker was created in:
4+
C:\Users\pete\.qgis2\python\plugins\ConstraintChecker\ConstraintChecker
5+
6+
Your QGIS plugin directory is located at:
7+
C:/Users/pete/.qgis2/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 ui file using pyuic4
15+
16+
* Compile the resources file using pyrcc4
17+
18+
* Test the plugin by enabling it in the QGIS plugin manager
19+
20+
* Customize it by editing the implementation file:
21+
constraintchecker.py
22+
23+
* Create your own custom icon, replacing the default icon.png
24+
25+
* Modify your user interface by opening constraintchecker.ui
26+
in Qt Designer (don't forget to compile it with pyuic4 after changing it)
27+
28+
* You can use the Makefile to compile your Ui and resource files when
29+
you make changes. This requires GNU make (gmake)
30+
31+
For more information, see the PyQGIS Developer Cookbook at:
32+
http://www.qgis.org/pyqgis-cookbook/index.html
33+
34+
(C) 2013 GeoApt LLC - geoapt.com

‎ConstraintChecker/__init__.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
/***************************************************************************
4+
Constraint Checker
5+
A QGIS plugin
6+
Generate reports of constraints (e.g. planning constraints) applicable to an area of interest.
7+
-------------------
8+
begin : 2014-03-19
9+
copyright : (C) 2014 by Lutra Consulting for Dartmoor National Park Authority
10+
email : it@dnpa.gov.uk
11+
***************************************************************************/
12+
13+
/***************************************************************************
14+
* *
15+
* This program is free software; you can redistribute it and/or modify *
16+
* it under the terms of the GNU General Public License as published by *
17+
* the Free Software Foundation; either version 2 of the License, or *
18+
* (at your option) any later version. *
19+
* *
20+
***************************************************************************/
21+
"""
22+
23+
def classFactory(iface):
24+
# load ConstraintChecker class from file ConstraintChecker
25+
from constraintchecker import ConstraintChecker
26+
return ConstraintChecker(iface)

0 commit comments

Comments
 (0)
Please sign in to comment.