Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
28cdf5c3
Commit
28cdf5c3
authored
Dec 14, 2014
by
Andreas Freise
Browse files
changing prints to function and make selective exception import towards python 3 compatibility
parent
40cf2d2d
Changes
7
Hide whitespace changes
Inline
Side-by-side
pykat/commands.py
View file @
28cdf5c3
...
...
@@ -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
...
...
pykat/components.py
View file @
28cdf5c3
...
...
@@ -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
*
...
...
pykat/detectors.py
View file @
28cdf5c3
...
...
@@ -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
pykat/exceptions.py
View file @
28cdf5c3
import
exceptions
from
__future__
import
print_function
import
pykat.external.six
as
six
if
six
.
PY2
:
import
exceptions
import
os
class
BasePyKatException
(
Exception
):
...
...
pykat/gui/graphics.py
View file @
28cdf5c3
...
...
@@ -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
...
...
pykat/node_network.py
View file @
28cdf5c3
...
...
@@ -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
...
...
pykat/param.py
View file @
28cdf5c3
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment