Discussion:
Phoenix - floatcanvas
Werner
2014-05-22 11:13:40 UTC
Permalink
Hi,

I am doing a bit of testing of Phoenix and floatcanvas.

In FloatCanvas.Read_MapGen we have:

data = map(string.strip,data)

'strip' function does not exist in Py3.

Not sure how to correct this so it work in Py2 and Py3.

Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Werner
2014-05-22 14:04:24 UTC
Permalink
Post by Werner
Hi,
I am doing a bit of testing of Phoenix and floatcanvas.
data = map(string.strip,data)
'strip' function does not exist in Py3.
Not sure how to correct this so it work in Py2 and Py3.
There are two Read_MapGen, the above and one in fc.animation.py, similar
but not the same.

What about having just one (the one in demo.FloatCanvas) and moving it
to fc.utilities?

Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chris Barker - NOAA Federal
2014-05-22 14:52:55 UTC
Permalink
Post by Werner
Hi,
I am doing a bit of testing of Phoenix and floatcanvas.
data = map(string.strip,data)
'strip' function does not exist in Py3.
Wow! That is old code! Pre-dating string methods!

Something like:
Data = [ s.strip() for a in data]

Should do it.
Post by Werner
Not sure how to correct this so it work in Py2 and Py3.
There are two Read_MapGen, the above and one in fc.animation.py, similar but not the same.
What about having just one (the one in demo.FloatCanvas) and moving it to fc.utilities?
That would be better, yes. It's only for the demo, anyway, so another
option would be to store the data in a format that wouldn't require
special parsing -- JSON maybe? Or even a pickle.

Chris
Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Werner
2014-05-26 11:07:27 UTC
Permalink
Hi Chris,

Could you review PR https://github.com/RobinD42/Phoenix/pull/78

Just made demo and unittests run on Py3, didn't get around to merge the
Read_MapGen method.

Werner
Post by Chris Barker - NOAA Federal
Post by Werner
Hi,
I am doing a bit of testing of Phoenix and floatcanvas.
data = map(string.strip,data)
'strip' function does not exist in Py3.
Wow! That is old code! Pre-dating string methods!
Data = [ s.strip() for a in data]
Should do it.
Post by Werner
Not sure how to correct this so it work in Py2 and Py3.
There are two Read_MapGen, the above and one in fc.animation.py, similar but not the same.
What about having just one (the one in demo.FloatCanvas) and moving it to fc.utilities?
That would be better, yes. It's only for the demo, anyway, so another
option would be to store the data in a format that wouldn't require
special parsing -- JSON maybe? Or even a pickle.
Chris
Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
For more options, visit https://groups.google.com/d/optout.
--
Niderenweg 6
CH-9043 Trogen

Tel: +41 71 340 06 30
Mob: +41 76 374 81 07
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chris Barker
2014-05-27 19:16:55 UTC
Permalink
Post by Werner
Hi Chris,
Could you review PR https://github.com/RobinD42/Phoenix/pull/78
done -- looks good, thanks!

-Chris
Post by Werner
Just made demo and unittests run on Py3, didn't get around to merge the
Read_MapGen method.
Werner
Post by Chris Barker - NOAA Federal
Post by Chris Barker - NOAA Federal
Post by Werner
Hi,
I am doing a bit of testing of Phoenix and floatcanvas.
data = map(string.strip,data)
'strip' function does not exist in Py3.
Wow! That is old code! Pre-dating string methods!
Data = [ s.strip() for a in data]
Should do it.
Not sure how to correct this so it work in Py2 and Py3.
Post by Chris Barker - NOAA Federal
There are two Read_MapGen, the above and one in fc.animation.py,
similar but not the same.
What about having just one (the one in demo.FloatCanvas) and moving it to fc.utilities?
That would be better, yes. It's only for the demo, anyway, so another
option would be to store the data in a format that wouldn't require
special parsing -- JSON maybe? Or even a pickle.
Chris
Werner
Post by Chris Barker - NOAA Federal
--
You received this message because you are subscribed to the Google
Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Niderenweg 6
CH-9043 Trogen
Tel: +41 71 340 06 30
Mob: +41 76 374 81 07
--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

***@noaa.gov
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...