Commit 28cdf5c3 authored by Andreas Freise's avatar Andreas Freise
Browse files

changing prints to function and make selective exception import towards python 3 compatibility

parent 40cf2d2d
......@@ -4,9 +4,12 @@ Created on Mon Jan 28 11:58:09 2013
@author: Daniel
"""
from __future__ import print_function
import numpy
from numpy import min,max
import exceptions
import pykat.external.six as six
if six.PY2:
import exceptions
from components import *
from structs import *
from pykat.param import Param, putter
......
......@@ -4,7 +4,10 @@ Created on Mon Jan 28 11:10:01 2013
@author: Daniel
"""
import exceptions
from __future__ import print_function
import pykat.external.six as six
if six.PY2:
import exceptions
import pykat.exceptions as pkex
import pykat
from pykat.node_network import *
......
......@@ -4,7 +4,10 @@ Created on Fri Feb 01 0split()9:09:10 2013
@author: Daniel
"""
import exceptions
from __future__ import print_function
import pykat.external.six as six
if six.PY2:
import exceptions
import abc
from pykat.node_network import *
from pykat.param import Param
......@@ -878,4 +881,4 @@ class qhd(Detector2):
for p in self._params:
rtn.extend(p.getFinesseText())
return rtn
\ No newline at end of file
return rtn
import exceptions
from __future__ import print_function
import pykat.external.six as six
if six.PY2:
import exceptions
import os
class BasePyKatException(Exception):
......
......@@ -5,12 +5,15 @@ Created on Fri Feb 01 09:13:03 2013
@author: Daniel
"""
from __future__ import print_function
import pykat.external.six as six
if six.PY2:
import exceptions
from PyQt4.QtGui import *
from PyQt4.Qt import *
from PyQt4 import QtSvg
from PyQt4.QtSvg import QGraphicsSvgItem
import pykat.components
import exceptions
import weakref
nsize = 10
......
......@@ -4,7 +4,7 @@ Created on Sun Jan 27 10:02:41 2013
@author: Daniel
"""
from __future__ import print_function
from pykat import USE_GUI, NoGUIException
if USE_GUI:
......@@ -349,7 +349,7 @@ class NodeNetwork(object):
return False
elif isinstance(currcomp, pykat.components.isolator):
print "isol"
print("isol")
elif isinstance(currcomp, pykat.components.laser):
# if we are at a laser then we can't go any further
# and it isn;t this node as we checked before
......
from __future__ import print_function
import abc
import pykat.exceptions as pkex
import weakref
......@@ -150,7 +151,7 @@ class Param(putable, putter):
#if this param can be put somewhere we need to check if it is
if self.isPutable:
for a in self.putees:
print "Removing put from {0} {1} to {2} {3}".format(self.owner.name, self.name, a.owner.name, a.name)
print("Removing put from {0} {1} to {2} {3}".format(self.owner.name, self.name, a.owner.name, a.name))
a._putter = None
self.put_count -= 1
......@@ -160,7 +161,7 @@ class Param(putable, putter):
# check if we have anything being put to us
if self.isPutter:
if self._putter != None:
print "Removing put from {0} {1} to {2} {3}".format(self._putter.owner.name, self._putter.name, self.owner.name, self.name)
print("Removing put from {0} {1} to {2} {3}".format(self._putter.owner.name, self._putter.name, self.owner.name, self.name))
self._putter.put_count -= 1
self._putter.putees.remove(self)
self._putter = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment