[ecflow] 35/50: more python3

Alastair McKinstry mckinstry at moszumanska.debian.org
Wed Sep 20 15:30:53 UTC 2017


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

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

commit a775040af9afd2a24538e93c2c120a28109062ff
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Sat Jul 15 20:44:12 2017 +0100

    more python3
---
 debian/patches/python3.patch | 174 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 174 insertions(+)

diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index fb22ab9..30d2d77 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -249,3 +249,177 @@ Index: ecflow-4.6.1/Pyext/test/py_u_TestAutoAddExtern.py
 -    print defs
 +    print(defs)
      print("All Tests pass")
+Index: ecflow-4.6.1/Pyext/samples/api/sms2ecf.py
+===================================================================
+--- ecflow-4.6.1.orig/Pyext/samples/api/sms2ecf.py
++++ ecflow-4.6.1/Pyext/samples/api/sms2ecf.py
+@@ -56,7 +56,7 @@ DICT_SMS_ECF = {
+     'SMSLOGTIMEOUT': 'ECF_LOGTIMEOUT',
+ }
+ 
+-DICT_ECF_SMS = dict((v, k) for k, v in DICT_SMS_ECF.iteritems())
++DICT_ECF_SMS = dict((v, k) for k, v in list(DICT_SMS_ECF.items()))
+       
+ def translate(name, value=None):
+     """ find and replace submit, kill and status command, according to
+@@ -90,7 +90,7 @@ def translate(name, value=None):
+                 else: rc = STATCMD + " %s" % rc
+             return rc
+ 
+-    if ECF_MODE == "ecflow" and name in DICT_SMS_ECF.keys():
++    if ECF_MODE == "ecflow" and name in list(DICT_SMS_ECF.keys()):
+         if name in ('SMSCMD', 'SMSKILL', 'SMSSTATUSCMD', 'SMSHOME'):
+             value2 = value.replace('SMS', 'ECF_')
+             value  = value2.replace(smssubmit, ecfsubmit)
+@@ -99,7 +99,7 @@ def translate(name, value=None):
+             value  = value2.replace(smssubmit, ecfsubmit)
+         transl = DICT_SMS_ECF[name]
+ 
+-    elif ECF_MODE == "sms"  and name in DICT_ECF_SMS.keys():
++    elif ECF_MODE == "sms"  and name in list(DICT_ECF_SMS.keys()):
+         if name in  ('ECF_CMD_CMD', 'ECF_KILL_CMD', 'ECF_STATUS_CMD'):
+             value2 = value.replace('ECF_', 'SMS')  
+         transl = DICT_ECF_SMS[name]
+Index: ecflow-4.6.1/Pyext/samples/api/ecf.py
+===================================================================
+--- ecflow-4.6.1.orig/Pyext/samples/api/ecf.py
++++ ecflow-4.6.1/Pyext/samples/api/ecf.py
+@@ -7,13 +7,14 @@ variables overwrite
+ 
+ """
+ 
++from __future__ import print_function
+ import pwd, os, unittest
+ try:
+   from ecflow import TimeSlot
+   from ecflow import JobCreationCtrl as JobCreationCtrl
+   from ecflow import ChildCmdType
+   from ecflow import ZombieType, ZombieAttr, ZombieUserActionType
+-except: print "# ecf.py cannot import few types" 
++except: print ("# ecf.py cannot import few types" )
+ 
+ import ecflow
+ ecflow.Ecf.set_debug_level(3)
+@@ -244,7 +245,7 @@ class Trigger(Attribute):
+                             ecflow.PartExpression):
+             self.expr = ecflow.Expression(str(item))
+         else: 
+-          print type(expr)
++          print (type(expr))
+           raise Exception("what? trigger?")
+ 
+     def add_to(self, node):
+@@ -306,8 +307,8 @@ class Clock(Attribute):
+ 
+     def add_to(self, node):
+         if type(node) != Suite:
+-            print "WAR: clock can only be attached to suite node, "
+-            print "WAR: clock is ignored"
++            print ("WAR: clock can only be attached to suite node, ")
++            print ("WAR: clock is ignored")
+             return
+         node.add_clock(self.data)
+ 
+@@ -369,7 +370,7 @@ class Cron(Time):
+     def add_to(self, node):
+         if USE_TIME and self.data is not None:
+             node.add_cron(self.data)
+-        else: print "#WAR: ignoring: %s" % self.data
++        else: print ("#WAR: ignoring: %s" % self.data)
+ 
+ class Date(Time):
+     """ wrapper to add date """
+@@ -471,7 +472,7 @@ class Late(Attribute):
+     def __init__(self, arg):
+         self.data = None
+         if not USE_LATE: 
+-            if DEBUG: print "#MSG: late is disabled"
++            if DEBUG: print ("#MSG: late is disabled")
+             return
+         sub = False
+         act = False
+@@ -535,14 +536,14 @@ class Variables(Attribute):
+ 
+         if len(args) > 0:
+             if type(args) == list:
+-                for item in args.iteritems():
++                for item in list(args.items()):
+                     self._set_tvar(item.name(), item.value())
+             elif type(args) == tuple:
+-                for key, val in args.items():
++                for key, val in list(args.items()):
+                     self._set_tvar(key, val)
+             else: raise BaseException()
+         if len(kwargs) > 0: 
+-            for key, val in kwargs.items():
++            for key, val in list(kwargs.items()):
+                 self._set_tvar(key, val)
+         if type(__a) == dict:
+             for key, val in __a.items():
+@@ -577,7 +578,7 @@ class Variables(Attribute):
+             elif "edit HOST " in edit:
+               node.add_label("infophs", edit.replace("edit HOST ", ""))
+           except: pass
+-        if self.next is not None:
++        if self.__next__ is not None:
+             self.next.add_to(node)
+ 
+     def add(self, what): raise baseException(what.fullname())
+@@ -599,13 +600,13 @@ class Limits(Attribute):
+ 
+         if len(args) > 0:
+             if type(args) == list:
+-                for item in args.iteritems():
++                for item in list(args.items()):
+                     self._set_tvar(item.name(), item.value())
+             elif type(args) == tuple:
+-                for key, val in args.items():
++                for key, val in list(args.items()):
+                     self._set_tvar(key, val)
+         elif len(kwargs) > 0: 
+-            for key, val in kwargs.items():
++            for key, val in list(kwargs.items()):
+                 self._set_tvar(key, val)
+         elif type(__a) == dict:
+             for key in sorted(__a.iterkeys()):
+@@ -725,7 +726,7 @@ class Root(object): # from where Suite a
+ 
+     def add(self, item=None, *args):
+         """ add a task, a family or an attribute """
+-        if DEBUG: print self.fullname(), item, args
++        if DEBUG: print (self.fullname(), item, args)
+ 
+         if item is not None:
+             if type(item) == tuple:
+@@ -737,10 +738,10 @@ class Root(object): # from where Suite a
+             else:
+                 if DEBUG:
+                   if type(item) in (Task, Family): 
+-                    print item.fullname()
++                    print (item.fullname())
+                 try: item.add_to(self)
+-                except Exception, exc: 
+-                  print item
++                except Exception as exc: 
++                  print (item)
+                   raise BaseException("not yet", self, type(item), exc)
+ 
+         if len(args) > 0:
+@@ -786,7 +787,7 @@ class Node(Root): # from where Task and
+             assert __b is None
+             for key, val in __a.items():
+                 self.add_limit(key, val)
+-        for key, val in kwargs.items():
++        for key, val in list(kwargs.items()):
+             self.add_limit(key, val)
+         return self
+ 
+@@ -965,7 +966,7 @@ def display(defs, fname=None):
+       pass # print defs
+     else:
+         fop = open(fname, "w")
+-        print >> fop, defs
++        print (defs, file=fop)
+ 
+ 
+ class TestEcf(unittest.TestCase):

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



More information about the debian-science-commits mailing list