[Git][debian-gis-team/pywps][master] 4 commits: New upstream version 4.2.10

Bas Couwenberg gitlab at salsa.debian.org
Tue Jan 26 05:04:31 GMT 2021



Bas Couwenberg pushed to branch master at Debian GIS Project / pywps


Commits:
a2fe2f3e by Bas Couwenberg at 2021-01-26T05:50:14+01:00
New upstream version 4.2.10
- - - - -
f63dcece by Bas Couwenberg at 2021-01-26T05:50:17+01:00
Update upstream source from tag 'upstream/4.2.10'

Update to upstream version '4.2.10'
with Debian dir 5ec21d38db762c78a42c849f7410d435eb01c219
- - - - -
6288db9f by Bas Couwenberg at 2021-01-26T05:54:24+01:00
New upstream release.

- - - - -
e8c30fd0 by Bas Couwenberg at 2021-01-26T05:55:23+01:00
Set distribution to unstable.

- - - - -


8 changed files:

- VERSION.txt
- debian/changelog
- pywps/__init__.py
- pywps/app/Common.py
- pywps/app/WPSRequest.py
- pywps/ext_autodoc.py
- pywps/processing/scheduler.py
- pywps/tests.py


Changes:

=====================================
VERSION.txt
=====================================
@@ -1 +1 @@
-4.2.9
+4.2.10


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+pywps (4.2.10-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 26 Jan 2021 05:55:09 +0100
+
 pywps (4.2.9-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
pywps/__init__.py
=====================================
@@ -9,7 +9,7 @@ import os
 
 from lxml.builder import ElementMaker
 
-__version__ = '4.2.9'
+__version__ = '4.2.10'
 
 LOGGER = logging.getLogger('PYWPS')
 LOGGER.debug('setting core variables')


=====================================
pywps/app/Common.py
=====================================
@@ -63,3 +63,21 @@ class Metadata(object):
             self.role == other.role,
             self.type == other.type,
         ])
+
+
+class MetadataUrl(Metadata):
+    """Metadata subclass to allow anonymous links generation in documentation.
+
+    Useful to avoid Sphinx "Duplicate explicit target name" warning.
+
+    See https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#anonymous-hyperlinks.
+
+    Meant to use in documentation only, not needed in the xml response, nor being serialized or
+    deserialized to/from json.  So that's why it is not directly in the base class.
+    """
+
+    def __init__(self, title, href=None, role=None, type_='simple',
+                 anonymous=False):
+        super().__init__(title, href=href, role=role, type_=type_)
+        self.anonymous = anonymous
+        "Whether to create anonymous link (boolean)."


=====================================
pywps/app/WPSRequest.py
=====================================
@@ -586,12 +586,16 @@ def _get_rawvalue_value(data, encoding=None):
     """Return real value of CDATA section"""
 
     try:
+        LOGGER.debug("encoding={}".format(encoding))
         if encoding is None or encoding == "":
             return data
+        elif encoding == "utf-8":
+            return data
         elif encoding == 'base64':
             return base64.b64decode(data)
         return base64.b64decode(data)
     except Exception:
+        LOGGER.warning("failed to decode base64")
         return data
 
 


=====================================
pywps/ext_autodoc.py
=====================================
@@ -5,22 +5,7 @@ from sphinx.util.docstrings import prepare_docstring
 from sphinx.util import force_decode
 from docutils.parsers.rst import directives
 from pywps import Process
-from pywps.app.Common import Metadata
-
-
-class MetadataUrl(Metadata):
-    """Metadata subclass to allow anonymous links generation.
-
-    Useful to avoid Sphinx "Duplicate explicit target name" warning.
-
-    See https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#anonymous-hyperlinks.
-    """
-
-    def __init__(self, title, href=None, role=None, type_='simple',
-                 anonymous=False):
-        super().__init__(title, href=href, role=role, type_=type_)
-        self.anonymous = anonymous
-        "Whether to create anonymous link (boolean)."
+from pywps.app.Common import Metadata, MetadataUrl
 
 
 class ProcessDocumenter(ClassDocumenter):


=====================================
pywps/processing/scheduler.py
=====================================
@@ -33,42 +33,39 @@ class Scheduler(Processing):
         LOGGER.info("Submitting job ...")
         try:
             import drmaa
-            session = drmaa.Session()
-            # init session
-            session.initialize()
-            # dump job to file
-            dump_filename = self.job.dump()
-            if not dump_filename:
-                raise Exception("Could not dump job status.")
-            # prepare remote command
-            jt = session.createJobTemplate()
-            jt.remoteCommand = os.path.join(
-                config.get_config_value('processing', 'path'),
-                'joblauncher')
-            if os.getenv("PYWPS_CFG"):
-                import shutil
-                cfg_file = os.path.join(self.job.workdir, "pywps.cfg")
-                shutil.copy2(os.getenv('PYWPS_CFG'), cfg_file)
-                LOGGER.debug("Copied pywps config: {}".format(cfg_file))
-                jt.args = ['-c', cfg_file, dump_filename]
-            else:
-                jt.args = [dump_filename]
-            drmaa_native_specification = config.get_config_value('processing', 'drmaa_native_specification')
-            if drmaa_native_specification:
-                jt.nativeSpecification = drmaa_native_specification
-            jt.joinFiles = True
-            jt.outputPath = ":{}".format(os.path.join(self.job.workdir, "job-output.txt"))
-            # run job
-            jobid = session.runJob(jt)
-            LOGGER.info('Your job has been submitted with ID {}'.format(jobid))
-            # show status
-            import time
-            time.sleep(1)
-            LOGGER.info('Job status: {}'.format(session.jobStatus(jobid)))
-            # Cleaning up
-            session.deleteJobTemplate(jt)
-            # close session
-            session.exit()
+            with drmaa.Session() as session:
+                # dump job to file
+                dump_filename = self.job.dump()
+                if not dump_filename:
+                    raise Exception("Could not dump job status.")
+                # prepare remote command
+                jt = session.createJobTemplate()
+                jt.remoteCommand = os.path.join(
+                    config.get_config_value('processing', 'path'),
+                    'joblauncher')
+                if os.getenv("PYWPS_CFG"):
+                    import shutil
+                    cfg_file = os.path.join(self.job.workdir, "pywps.cfg")
+                    shutil.copy2(os.getenv('PYWPS_CFG'), cfg_file)
+                    LOGGER.debug("Copied pywps config: {}".format(cfg_file))
+                    jt.args = ['-c', cfg_file, dump_filename]
+                else:
+                    jt.args = [dump_filename]
+                drmaa_native_specification = config.get_config_value('processing', 'drmaa_native_specification')
+                if drmaa_native_specification:
+                    jt.nativeSpecification = drmaa_native_specification
+                jt.joinFiles = False
+                jt.errorPath = ":{}".format(os.path.join(self.job.workdir, "job-error.txt"))
+                jt.outputPath = ":{}".format(os.path.join(self.job.workdir, "job-output.txt"))
+                # run job
+                jobid = session.runJob(jt)
+                LOGGER.info('Your job has been submitted with ID {}'.format(jobid))
+                # show status
+                import time
+                time.sleep(1)
+                LOGGER.info('Job status: {}'.format(session.jobStatus(jobid)))
+                # Cleaning up
+                session.deleteJobTemplate(jt)
         except Exception as e:
             raise SchedulerNotAvailable("Could not submit job: {}".format(str(e)))
         return jobid


=====================================
pywps/tests.py
=====================================
@@ -11,8 +11,7 @@ from pywps import __version__
 from pywps import Process
 from pywps.inout import LiteralInput, LiteralOutput, ComplexInput, ComplexOutput, BoundingBoxInput, BoundingBoxOutput
 from pywps.inout import Format
-from pywps.app.Common import Metadata
-from pywps.ext_autodoc import MetadataUrl
+from pywps.app.Common import Metadata, MetadataUrl
 
 import re
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/compare/b36eff5498d1177b5c1e9e1a03bfc7931184c860...e8c30fd0a225ae71cdc926f89bbc3e39adcbcbe9

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/compare/b36eff5498d1177b5c1e9e1a03bfc7931184c860...e8c30fd0a225ae71cdc926f89bbc3e39adcbcbe9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210126/04519fb6/attachment-0001.html>


More information about the Pkg-grass-devel mailing list