Skip to content

Commit 668d374

Browse files
author
Matthieu
committed
dumped on github for christmas holiday
1 parent a0f37e2 commit 668d374

38 files changed

+4151
-0
lines changed

Makefile

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
#/***************************************************************************
2+
# SpatialPositionModel
3+
#
4+
# Compute spatial interaction models
5+
# -------------------
6+
# begin : 2015-12-10
7+
# git sha : $Format:%H$
8+
# copyright : (C) 2015 by #H
9+
# email : mth@#!.org
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+
SpatialPositionModel.py SpatialPositionModel_dialog.py SpatialPositionModel_utils.py
42+
43+
PLUGINNAME = SpatialPositionModel
44+
45+
PY_FILES = \
46+
__init__.py \
47+
SpatialPositionModel.py SpatialPositionModel_dialog.py SpatialPositionModel_utils.py
48+
49+
UI_FILES = SpatialPositionModel_dialog_base2.ui
50+
51+
EXTRAS = metadata.txt icon.png
52+
53+
COMPILED_RESOURCE_FILES = resources.py
54+
55+
PEP8EXCLUDE=pydev,resources.py,conf.py,third_party,ui
56+
57+
58+
#################################################
59+
# Normally you would not need to edit below here
60+
#################################################
61+
62+
HELP = help/build/html
63+
64+
PLUGIN_UPLOAD = $(c)/plugin_upload.py
65+
66+
RESOURCE_SRC=$(shell grep '^ *<file' resources.qrc | sed 's@</file>@@g;s/.*>//g' | tr '\n' ' ')
67+
68+
QGISDIR=.qgis2
69+
70+
default: compile
71+
72+
compile: $(COMPILED_RESOURCE_FILES)
73+
74+
%.py : %.qrc $(RESOURCES_SRC)
75+
pyrcc4 -o $*.py $<
76+
77+
%.qm : %.ts
78+
$(LRELEASE) $<
79+
80+
test: compile transcompile
81+
@echo
82+
@echo "----------------------"
83+
@echo "Regression Test Suite"
84+
@echo "----------------------"
85+
86+
@# Preceding dash means that make will continue in case of errors
87+
@-export PYTHONPATH=`pwd`:$(PYTHONPATH); \
88+
export QGIS_DEBUG=0; \
89+
export QGIS_LOG_FILE=/dev/null; \
90+
nosetests -v --with-id --with-coverage --cover-package=. \
91+
3>&1 1>&2 2>&3 3>&- || true
92+
@echo "----------------------"
93+
@echo "If you get a 'no module named qgis.core error, try sourcing"
94+
@echo "the helper script we have provided first then run make test."
95+
@echo "e.g. source run-env-linux.sh <path to qgis install>; make test"
96+
@echo "----------------------"
97+
98+
deploy: compile doc transcompile
99+
@echo
100+
@echo "------------------------------------------"
101+
@echo "Deploying plugin to your .qgis2 directory."
102+
@echo "------------------------------------------"
103+
# The deploy target only works on unix like operating system where
104+
# the Python plugin directory is located at:
105+
# $HOME/$(QGISDIR)/python/plugins
106+
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
107+
cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
108+
cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
109+
cp -vf $(COMPILED_RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
110+
cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
111+
cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
112+
cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
113+
114+
# The dclean target removes compiled python files from plugin directory
115+
# also deletes any .git entry
116+
dclean:
117+
@echo
118+
@echo "-----------------------------------"
119+
@echo "Removing any compiled python files."
120+
@echo "-----------------------------------"
121+
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
122+
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".git" -prune -exec rm -Rf {} \;
123+
124+
125+
derase:
126+
@echo
127+
@echo "-------------------------"
128+
@echo "Removing deployed plugin."
129+
@echo "-------------------------"
130+
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
131+
132+
zip: deploy dclean
133+
@echo
134+
@echo "---------------------------"
135+
@echo "Creating plugin zip bundle."
136+
@echo "---------------------------"
137+
# The zip target deploys the plugin and creates a zip file with the deployed
138+
# content. You can then upload the zip file on http://plugins.qgis.org
139+
rm -f $(PLUGINNAME).zip
140+
cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
141+
142+
package: compile
143+
# Create a zip package of the plugin named $(PLUGINNAME).zip.
144+
# This requires use of git (your plugin development directory must be a
145+
# git repository).
146+
# To use, pass a valid commit or tag as follows:
147+
# make package VERSION=Version_0.3.2
148+
@echo
149+
@echo "------------------------------------"
150+
@echo "Exporting plugin to zip package. "
151+
@echo "------------------------------------"
152+
rm -f $(PLUGINNAME).zip
153+
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
154+
echo "Created package: $(PLUGINNAME).zip"
155+
156+
upload: zip
157+
@echo
158+
@echo "-------------------------------------"
159+
@echo "Uploading plugin to QGIS Plugin repo."
160+
@echo "-------------------------------------"
161+
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip
162+
163+
transup:
164+
@echo
165+
@echo "------------------------------------------------"
166+
@echo "Updating translation files with any new strings."
167+
@echo "------------------------------------------------"
168+
@chmod +x scripts/update-strings.sh
169+
@scripts/update-strings.sh $(LOCALES)
170+
171+
transcompile:
172+
@echo
173+
@echo "----------------------------------------"
174+
@echo "Compiled translation files to .qm files."
175+
@echo "----------------------------------------"
176+
@chmod +x scripts/compile-strings.sh
177+
@scripts/compile-strings.sh $(LRELEASE) $(LOCALES)
178+
179+
transclean:
180+
@echo
181+
@echo "------------------------------------"
182+
@echo "Removing compiled translation files."
183+
@echo "------------------------------------"
184+
rm -f i18n/*.qm
185+
186+
clean:
187+
@echo
188+
@echo "------------------------------------"
189+
@echo "Removing uic and rcc generated files"
190+
@echo "------------------------------------"
191+
rm $(COMPILED_UI_FILES) $(COMPILED_RESOURCE_FILES)
192+
193+
doc:
194+
@echo
195+
@echo "------------------------------------"
196+
@echo "Building documentation using sphinx."
197+
@echo "------------------------------------"
198+
cd help; make html
199+
200+
pylint:
201+
@echo
202+
@echo "-----------------"
203+
@echo "Pylint violations"
204+
@echo "-----------------"
205+
@pylint --reports=n --rcfile=pylintrc . || true
206+
@echo
207+
@echo "----------------------"
208+
@echo "If you get a 'no module named qgis.core' error, try sourcing"
209+
@echo "the helper script we have provided first then run make pylint."
210+
@echo "e.g. source run-env-linux.sh <path to qgis install>; make pylint"
211+
@echo "----------------------"
212+
213+
214+
# Run pep8 style checking
215+
#http://pypi.python.org/pypi/pep8
216+
pep8:
217+
@echo
218+
@echo "-----------"
219+
@echo "PEP8 issues"
220+
@echo "-----------"
221+
@pep8 --repeat --ignore=E203,E121,E122,E123,E124,E125,E126,E127,E128 --exclude $(PEP8EXCLUDE) . || true
222+
@echo "-----------"
223+
@echo "Ignored in PEP8 check:"
224+
@echo $(PEP8EXCLUDE)

README.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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>SpatialPositionModel</b> was created in:<br>
9+
&nbsp;&nbsp;<b>C:\Users\Matthieu\Desktop\code\SpatialPositionModel</b>
10+
<p>
11+
Your QGIS plugin directory is located at:<br>
12+
&nbsp;&nbsp;<b>C:/Users/Matthieu/.qgis2/python/plugins</b>
13+
<p>
14+
<h3>What's Next</h3>
15+
<ol>
16+
<li>In your plugin directory, compile the resources file using pyrcc4 (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>SpatialPositionModel.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>SpatialPositionModel_dialog_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 <a href="http://loc8.cc/pb_tool">http://loc8.cc/pb_tool</a> for more information.
31+
</ul>
32+
</div>
33+
<div style='font-size:.9em;'>
34+
<p>
35+
For information on writing PyQGIS code, see <a href="http://loc8.cc/pyqgis_resources">http://loc8.cc/pyqgis_resources</a> for a list of resources.
36+
</p>
37+
</div>
38+
<img src="http://geoapt.com/geoapt_logo_p.png" alt='GeoApt LLC' title='GeoApt LLC' align='absmiddle'>
39+
&copy;2011-2015 GeoApt LLC - geoapt.com
40+
</body>
41+
</html>

README.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Plugin Builder Results
2+
3+
Your plugin SpatialPositionModel was created in:
4+
C:\Users\Matthieu\Desktop\code\SpatialPositionModel
5+
6+
Your QGIS plugin directory is located at:
7+
C:/Users/Matthieu/.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 resources file using pyrcc4
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: ``SpatialPositionModel.py``
21+
22+
* Create your own custom icon, replacing the default icon.png
23+
24+
* Modify your user interface by opening SpatialPositionModel.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-2014 GeoApt LLC - geoapt.com
33+
Git revision : $Format:%H$

0 commit comments

Comments
 (0)