-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uploaded up-to-date version (QGIS 2.0 compatible)
- Loading branch information
1 parent
b306097
commit 31677e8
Showing
17 changed files
with
1,055 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#/*************************************************************************** | ||
# PPConverter | ||
# | ||
# Plugin to convert files created with PP | ||
# ------------------- | ||
# begin : 2013-04-03 | ||
# copyright : (C) 2013 by Nils Müller-Scheeßel | ||
# email : [email protected] | ||
# ***************************************************************************/ | ||
# | ||
#/*************************************************************************** | ||
# * * | ||
# * This program is free software; you can redistribute it and/or modify * | ||
# * it under the terms of the GNU General Public License as published by * | ||
# * the Free Software Foundation; either version 2 of the License, or * | ||
# * (at your option) any later version. * | ||
# * * | ||
# ***************************************************************************/ | ||
|
||
# CONFIGURATION | ||
PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py | ||
|
||
# Makefile for a PyQGIS plugin | ||
|
||
# translation | ||
SOURCES = ppconverter.py ui_ppconverter.py __init__.py ppconverterdialog.py | ||
#TRANSLATIONS = i18n/ppconverter_en.ts | ||
TRANSLATIONS = | ||
|
||
# global | ||
|
||
PLUGINNAME = ppconverter | ||
|
||
PY_FILES = ppconverter.py ppconverterdialog.py __init__.py | ||
|
||
EXTRAS = icon.png | ||
|
||
UI_FILES = ui_ppconverter.py | ||
|
||
RESOURCE_FILES = resources_rc.py | ||
|
||
HELP = help/build/html | ||
|
||
default: compile | ||
|
||
compile: $(UI_FILES) $(RESOURCE_FILES) | ||
|
||
%_rc.py : %.qrc | ||
pyrcc4 -o $*_rc.py $< | ||
|
||
%.py : %.ui | ||
pyuic4 -o $@ $< | ||
|
||
%.qm : %.ts | ||
lrelease $< | ||
|
||
# The deploy target only works on unix like operating system where | ||
# the Python plugin directory is located at: | ||
# $HOME/.qgis/python/plugins | ||
deploy: compile doc transcompile | ||
mkdir -p $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
cp -vf $(PY_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
cp -vf $(UI_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
cp -vf $(RESOURCE_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
cp -vf $(EXTRAS) $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
cp -vfr i18n $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
cp -vfr $(HELP) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)/help | ||
|
||
# The dclean target removes compiled python files from plugin directory | ||
# also delets any .svn entry | ||
dclean: | ||
find $(HOME)/.qgis/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete | ||
find $(HOME)/.qgis/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \; | ||
|
||
# The derase deletes deployed plugin | ||
derase: | ||
rm -Rf $(HOME)/.qgis/python/plugins/$(PLUGINNAME) | ||
|
||
# The zip target deploys the plugin and creates a zip file with the deployed | ||
# content. You can then upload the zip file on http://plugins.qgis.org | ||
zip: deploy dclean | ||
rm -f $(PLUGINNAME).zip | ||
cd $(HOME)/.qgis/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME) | ||
|
||
# Create a zip package of the plugin named $(PLUGINNAME).zip. | ||
# This requires use of git (your plugin development directory must be a | ||
# git repository). | ||
# To use, pass a valid commit or tag as follows: | ||
# make package VERSION=Version_0.3.2 | ||
package: compile | ||
rm -f $(PLUGINNAME).zip | ||
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION) | ||
echo "Created package: $(PLUGINNAME).zip" | ||
|
||
upload: zip | ||
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip | ||
|
||
# transup | ||
# update .ts translation files | ||
transup: | ||
pylupdate4 Makefile | ||
|
||
# transcompile | ||
# compile translation files into .qm binary format | ||
transcompile: $(TRANSLATIONS:.ts=.qm) | ||
|
||
# transclean | ||
# deletes all .qm files | ||
transclean: | ||
rm -f i18n/*.qm | ||
|
||
clean: | ||
rm $(UI_FILES) $(RESOURCE_FILES) | ||
|
||
# build documentation with sphinx | ||
doc: | ||
cd help; make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
###################################################################### | ||
# Automatically generated by qmake (2.01a) Fr. Apr 12 18:08:15 2013 | ||
###################################################################### | ||
|
||
TEMPLATE = app | ||
TARGET = | ||
DEPENDPATH += . i18n | ||
INCLUDEPATH += . | ||
|
||
# Input | ||
FORMS += ui_ppconverter.ui | ||
RESOURCES += resources.qrc | ||
TRANSLATIONS += i18n/ppconverter_de_DE.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
/*************************************************************************** | ||
PPConverter | ||
A QGIS plugin | ||
Plugin to convert files created with PP | ||
------------------- | ||
begin : 2013-04-03 | ||
copyright : (C) 2013 by Nils Müller-Scheeßel | ||
email : [email protected] | ||
***************************************************************************/ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
This script initializes the plugin, making it known to QGIS. | ||
""" | ||
|
||
|
||
def name(): | ||
return "PPConverter" | ||
|
||
|
||
def description(): | ||
return "Convert PhoToPlan-images to GeoTIFFs" | ||
|
||
|
||
def version(): | ||
return "Version 0.1" | ||
|
||
|
||
def icon(): | ||
return "icon.png" | ||
|
||
|
||
def qgisMinimumVersion(): | ||
return "1.8" | ||
|
||
def author(): | ||
return "Nils Müller-Scheeßel" | ||
|
||
def email(): | ||
return "[email protected]" | ||
|
||
def classFactory(iface): | ||
# load PPConverter class from file PPConverter | ||
from ppconverter import PPConverter | ||
return PPConverter(iface) | ||
|
||
def category(): | ||
return "Raster" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This file contains metadata for your plugin. Beginning | ||
# with version 1.8 this is the preferred way to supply information about a | ||
# plugin. The current method of embedding metadata in __init__.py will | ||
# be supported until version 2.0 | ||
|
||
# This file should be included when you package your plugin. | ||
|
||
# Mandatory items: | ||
|
||
|
||
[general] | ||
name=PPConverter | ||
qgisMinimumVersion=2.0 | ||
qgisMaximumVersion= 2.99 | ||
description=Convert PhoToPlan-images to GeoTIFFs | ||
category=Raster | ||
version=0.2 | ||
author=Nils Müller-Scheeßel | ||
[email protected] | ||
|
||
# end of mandatory metadata | ||
|
||
# Optional items: | ||
|
||
# Uncomment the following line and add your changelog entries: | ||
# changelog= | ||
|
||
# tags are comma separated with spaces allowed | ||
tags= | ||
|
||
homepage=http://hub.qgis.org/projects/ppconverter | ||
tracker=http://hub.qgis.org/projects/ppconverter | ||
repository=http://hub.qgis.org/projects/ppconverter | ||
icon=icon.png | ||
# experimental flag | ||
experimental=True | ||
|
||
# deprecated flag (applies to the whole plugin, not just a single version | ||
deprecated=False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env python | ||
# This script uploads a plugin package on the server | ||
# | ||
# Author: A. Pasotti, V. Picavet | ||
|
||
import xmlrpclib, sys, os | ||
import getpass | ||
from optparse import OptionParser | ||
|
||
# Configuration | ||
PROTOCOL='http' | ||
SERVER='plugins.qgis.org' | ||
PORT='80' | ||
ENDPOINT='/plugins/RPC2/' | ||
VERBOSE=False | ||
|
||
def main(options, args): | ||
address = "%s://%s:%s@%s:%s%s" % (PROTOCOL, options.username, options.password, | ||
options.server, options.port, ENDPOINT) | ||
print "Connecting to: %s" % hidepassword(address) | ||
|
||
server = xmlrpclib.ServerProxy(address, verbose=VERBOSE) | ||
|
||
try: | ||
plugin_id, version_id = server.plugin.upload(xmlrpclib.Binary(open(args[0]).read())) | ||
print "Plugin ID: %s" % plugin_id | ||
print "Version ID: %s" % version_id | ||
except xmlrpclib.ProtocolError, err: | ||
print "A protocol error occurred" | ||
print "URL: %s" % hidepassword(err.url, 0) | ||
print "HTTP/HTTPS headers: %s" % err.headers | ||
print "Error code: %d" % err.errcode | ||
print "Error message: %s" % err.errmsg | ||
except xmlrpclib.Fault, err: | ||
print "A fault occurred" | ||
print "Fault code: %d" % err.faultCode | ||
print "Fault string: %s" % err.faultString | ||
|
||
def hidepassword(url, start = 6): | ||
"""Returns the http url with password part replaced with '*'.""" | ||
passdeb = url.find(':', start) + 1 | ||
passend = url.find('@') | ||
return "%s%s%s" % (url[:passdeb], '*' * (passend - passdeb), url[passend:]) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = OptionParser(usage="%prog [options] plugin.zip") | ||
parser.add_option("-w", "--password", dest="password", | ||
help="Password for plugin site", metavar="******") | ||
parser.add_option("-u", "--username", dest="username", | ||
help="Username of plugin site", metavar="user") | ||
parser.add_option("-p", "--port", dest="port", | ||
help="Server port to connect to", metavar="80") | ||
parser.add_option("-s", "--server", dest="server", | ||
help="Specify server name", metavar="plugins.qgis.org") | ||
(options, args) = parser.parse_args() | ||
if len(args) != 1: | ||
print "Please specify zip file.\n" | ||
parser.print_help() | ||
sys.exit(1) | ||
if not options.server: | ||
options.server = SERVER | ||
if not options.port: | ||
options.port = PORT | ||
if not options.username: | ||
# interactive mode | ||
username = getpass.getuser() | ||
print "Please enter user name [%s] :"%username, | ||
res = raw_input() | ||
if res != "": | ||
options.username = res | ||
else: | ||
options.username = username | ||
if not options.password: | ||
# interactive mode | ||
options.password = getpass.getpass() | ||
main(options, args) | ||
|
Oops, something went wrong.