[Pywps-commits] r775 - / addons addons/3.0
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Feb 20 13:15:52 CET 2009
Author: jachym
Date: 2009-02-20 13:15:51 +0100 (Fri, 20 Feb 2009)
New Revision: 775
Added:
addons/
addons/3.0/
addons/3.0/processes/
addons/README
Log:
added addons
Added: addons/README
===================================================================
--- addons/README 2009-02-12 21:22:20 UTC (rev 774)
+++ addons/README 2009-02-20 12:15:51 UTC (rev 775)
@@ -0,0 +1,81 @@
+#########################
+PyWPS Processes structure
+#########################
+This repository is aimed to collect all user-addons processes for PyWPS.
+They are organised to directories according to minor versions of PyWPS.
+
+Each process file has to have following form:
+
+#. The first line of each file shoud be #!/usr/bin/env python. This makes
+ it possible to run the file as a script invoking the interpreter
+ implicitly, e.g. in a CGI context.
+
+#. Next should be the docstring with a description. If the description is
+ long, the first line should be a short summary that makes sense on its own,
+ separated from the rest by a newline.
+
+#. All code, including import statements, should follow the docstring.
+ Otherwise, the docstring will not be recognized by the interpreter, and you
+ will not have access to it in interactive sessions (i.e. through
+ obj.__doc__) or when generating documentation with automated tools.
+
+#. Import built-in modules first, followed by third-party modules, followed by
+ any changes to the path and your own modules. Especially, additions to the
+ path and names of your modules are likely to change rapidly: keeping them
+ in one place makes them easier to find.
+
+#. Next should be authorship information. This information should follow this
+ format::
+
+ __author__ = "Foo Bar [, Foo Bar [,...]]"
+ __copyright__ = "Copyright 2009, PyWPS Development Team"
+ __credits__ = ["Foo Bar", "Foo Bar"]
+ __license__ = "GPL"
+ __version__ = "1.0.0"
+ __maintainer__ = "Foo Bar"
+ __email__ = "foo bar org"
+ __status__ = "Production"
+
+ Status should typically be one of "Prototype", "Development", or
+ "Production". __maintainer__ should be the person who will fix bugs and
+ make improvements if imported. __credits__ differs from __author__ in
+ that __credits__ includes people who reported bug fixes, made
+ suggestions, etc. but did not actually write the code.
+
+************************
+Example of PyWPS Process
+************************
+::
+
+ #!/usr/bin/env python
+ """Calculates buffer for vector maps
+
+ For this purpose, GRASS GIS is used.
+ """
+
+ from pywps.Process.Process import WPSProcess
+
+ __author__ = "Jachym Cepicky"
+ __copyright__ = "Copyright 2009, PyWPS Development Team"
+ __credits__ = ["Jachym Cepicky"]
+ __license__ = "GPL"
+ __version__ = "1.0.0"
+ __maintainer__ = "Jachym Cepicky"
+ __email__ = "jachym les-ejk cz"
+ __status__ = "Production"
+
+ class Process(WPSProcess):
+ def __init__(self):
+ WPSProcess.__init__(self,
+ identifier = "buffer",
+ title="Buffer"
+ ...
+
+ def execute(self):
+ ...
+
+ if __name__ == '__main__': #code to execute if called from command-line
+ pass #do nothing - code deleted
+ #use this either for a simple example of how to use the module,
+ #or when the module can meaningfully be called as a script.
+
More information about the Pywps-commits
mailing list