[Pywps-commits] r770 - in branches/pywps-3.0: . pywps/Wps

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 12 09:48:23 CET 2009


Author: jachym
Date: 2009-02-12 09:48:22 +0100 (Thu, 12 Feb 2009)
New Revision: 770

Modified:
   branches/pywps-3.0/pywps/Wps/Execute.py
   branches/pywps-3.0/pywps/Wps/Response.py
   branches/pywps-3.0/wps.py
Log:
several bugfixes merged from trunk (revisions 768,769)

Modified: branches/pywps-3.0/pywps/Wps/Execute.py
===================================================================
--- branches/pywps-3.0/pywps/Wps/Execute.py	2009-02-12 08:43:14 UTC (rev 769)
+++ branches/pywps-3.0/pywps/Wps/Execute.py	2009-02-12 08:48:22 UTC (rev 770)
@@ -174,8 +174,6 @@
         # OGC 05-007r7 page 36, Table 50, note (a)
         # OGC 05-007r7 page 42
         if self.storeRequired and self.statusRequired:
-            # Output response to client
-            print "Content-type: text/xml\n"
             # set status to accepted
             self.promoteStatus(self.accepted,"Process %s accepted" %\
                     self.process.identifier)
@@ -380,24 +378,29 @@
 
                 if respOut:
                     # asReference
-                    if respOut.has_key("asreference"):
+                    if respOut.has_key("asreference") and \
+                        "asReference" in dir(poutput):
                         poutput.asReference = respOut["asreference"]
 
                     # mimetype
-                    if respOut.has_key("mimetype"):
+                    if respOut.has_key("mimetype") and \
+                        "format" in dir(poutput):
                         poutput.format["mimeType"] = respOut["mimetype"]
 
                     # schema
-                    if respOut.has_key("schema"):
+                    if respOut.has_key("schema") and \
+                        "format" in dir(poutput):
                         poutput.format["schema"] = respOut["schema"]
 
                     # encoding
-                    if respOut.has_key("encoding"):
+                    if respOut.has_key("encoding") and \
+                        "format" in dir(poutput):
                         poutput.format["encoding"] = respOut["encoding"]
 
                     # uom
-                    if respOut.has_key("uom"):
-                        poutput.format["uom"] = respOut["uom"]
+                    if respOut.has_key("uom") and \
+                        "uom" in dir(poutput):
+                        poutput.uom = respOut["uom"]
 
     def onInputProblem(self,what,why):
         """

Modified: branches/pywps-3.0/pywps/Wps/Response.py
===================================================================
--- branches/pywps-3.0/pywps/Wps/Response.py	2009-02-12 08:43:14 UTC (rev 769)
+++ branches/pywps-3.0/pywps/Wps/Response.py	2009-02-12 08:48:22 UTC (rev 770)
@@ -127,6 +127,11 @@
 
         for f in fileDes:
 
+            if f == STDOUT:
+                print "Content-Type: text/xml"
+                print "Content-Length: %d" % len(self.response)
+                print ""
+
             # open file
             if f != STDOUT and f.closed:
                 f = open(f.name,"w")

Modified: branches/pywps-3.0/wps.py
===================================================================
--- branches/pywps-3.0/wps.py	2009-02-12 08:43:14 UTC (rev 769)
+++ branches/pywps-3.0/wps.py	2009-02-12 08:48:22 UTC (rev 770)
@@ -146,9 +146,6 @@
             # print only to standard out
             if self.request.statusFiles == sys.stdout or\
                sys.stdout in self.request.statusFiles:
-                print "Content-type: text/xml"
-                print "Content-length: %s" % len(self.request.response)
-                print ""
                 self.request.printResponse(self.request.statusFiles)
 
         return



More information about the Pywps-commits mailing list