[metview] 03/04: Move python scripts to python3; dep. on it, not python

Alastair McKinstry mckinstry at moszumanska.debian.org
Wed Jan 3 13:00:22 UTC 2018


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository metview.

commit 21735b804088a662e7738c98c8eba6947416a698
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Jan 3 10:32:05 2018 +0000

    Move python scripts to python3; dep. on it, not python
---
 debian/changelog             |  2 +-
 debian/control               |  2 +-
 debian/patches/python3.patch | 86 ++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |  1 +
 4 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ec9247c..c087fc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ metview (5.0.0~beta.1-1) UNRELEASED; urgency=medium
   * New upstream release
   * Set chmod 644 on ssvg images in metview
   * Standards-Version: 4.1.2; no  changes required
-  
+  * Move python scripts to python3; dep. on it, not python
 
  -- Alastair McKinstry <mckinstry at debian.org>  Wed, 13 Dec 2017 10:23:03 +0000
 
diff --git a/debian/control b/debian/control
index dfc801a..835c27c 100644
--- a/debian/control
+++ b/debian/control
@@ -38,7 +38,7 @@ Vcs-Git: git://anonscm.debian.org/debian-science/packages/metview.git
 Package: metview
 Architecture: any
 Depends: ${misc:Depends}, ${shlibs:Depends},
- x11-utils, metview-data, python
+ x11-utils, metview-data, python3
 Recommends: magics++
 Description: Interactive data visualization and analysis environment,
  Metview has been designed as a flexible, modular and extendible system 
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
new file mode 100644
index 0000000..4c501ef
--- /dev/null
+++ b/debian/patches/python3.patch
@@ -0,0 +1,86 @@
+Description: Port  python scripts to Python3
+Author: Alastair McKinstry <mckinstry at debian.org>
+Forwarded: no
+Last-Updated: 2018-01-03
+
+Index: metview-5.0.0~beta.1/scripts/metgram.py
+===================================================================
+--- metview-5.0.0~beta.1.orig/scripts/metgram.py
++++ metview-5.0.0~beta.1/scripts/metgram.py
+@@ -1,3 +1,4 @@
++#!/usr/bin/python3
+ 
+ import xml.sax
+ import requests
+@@ -50,19 +51,19 @@ class MetgramHandler( xml.sax.ContentHan
+             "expver" : self.expver,
+             "epsgram" : epsgrams[self.type]
+          }
+-         if attributes.has_key("height") :
++         if "height" in attributes:
+             request["altitude"] =  attributes["height"],
+ 
+          if self.date != "" :
+             request["time"] = self.date
+ 
+-         if attributes.has_key("pngfile") :
++         if "pngfile" in attributes:
+             request["format"] = "png"
+             output =  attributes["pngfile"]
+-         if attributes.has_key("psfile") :
++         if "psfile" in attributes:
+             request["format"] = "ps"
+             output =  attributes["psfile"]
+-         if attributes.has_key("pdffile") :
++         if "pdffile" in attributes :
+             request["format"] = "pdf"
+             output =  attributes["pdffile"]
+          self.stations.append({"request" : request,
+@@ -96,14 +97,14 @@ class MetgramHandler( xml.sax.ContentHan
+             request = requests.get(url, params = request,
+             proxies = { "http":  "http://proxy.ecmwf.int:3333/", 
+                         "https": "http://proxy.ecmwf.int:3333/" })
+-            print request.url
++            print (request.url)
+             if request.status_code == 200 :
+                 out = open(station["output"], "w")
+                 out.write(request.content)
+                 out.close()
+-                print "Result saved in %s" % (station["output"], )
++                print ("Result saved in %s" % (station["output"], ))
+             else :
+-                print "No Result -->Error %d" % (request.status_code)
++                print ("No Result -->Error %d" % (request.status_code))
+         self.stations = []
+ 
+ 
+@@ -111,11 +112,11 @@ def main(argv):
+     try:
+       opts, args = getopt.getopt(argv,"hi:",["input="])
+     except getopt.GetoptError:
+-      print 'metgram.py -i <inputfile> '
++      print ('metgram.py -i <inputfile> ')
+       sys.exit(2)
+     for opt, arg in opts:
+       if opt == '-h':
+-         print 'metgram.py -i <inputfile> '
++         print ('metgram.py -i <inputfile> ')
+          sys.exit()
+       elif opt in ("-i", "--input"):
+          input = arg
+Index: metview-5.0.0~beta.1/scripts/mv_mars_catalog.py
+===================================================================
+--- metview-5.0.0~beta.1.orig/scripts/mv_mars_catalog.py
++++ metview-5.0.0~beta.1/scripts/mv_mars_catalog.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ # Copyright 2012 ECMWF and INPE. This software is distributed under the terms
+ # of the Apache License version 2.0. In applying this license, ECMWF does not
+ # waive the privileges and immunities granted to it by virtue of its status as
+@@ -39,4 +39,4 @@ tree    = []
+ output ={"axis":[], "tree":[], "choices":{}}
+ fetch().navigate(path,output)
+ #print fetch().kids.keys()
+-print json.dumps(output, indent = 4)
++print (json.dumps(output, indent = 4))
diff --git a/debian/patches/series b/debian/patches/series
index 379014e..909722c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ fpic.patch
 hurd.patch
 fix-bashisms.patch
 auto-ptr.patch
+python3.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/metview.git



More information about the debian-science-commits mailing list