[INSTRM-272] Convert actorcore to python3 Created: 04/Jan/18  Updated: 04/Jan/18  Resolved: 04/Jan/18

Status: Done
Project: Instrument control development
Component/s: tron_actorcore
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: cloomis Assignee: cloomis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This is actually pretty much done. Here are some notes and a list of the leftovers.

Used python-future's futurize, of course. Removed ply from tron_actorcore: it is now an external dependency like twisted.

The mildly tricky bits were as expected: a couple of metaclass fiddles in the protocol types, and the bytes--str conversions in twisted.

twisted deals with bytes. Our CmdrConnection and CommandLink classes wrap all of the twisted interface, and that is where we put the conversions. FYI, the 'latin-1' encoding is 1-1 for all 8-bit uints.

I had hoped to remove the internal RO package, and use the newer pypi one instead: it is much much closer to being python3 compatible. Unfortunately it is not quite py3-ready, so I will upgrade and patch actorcore's RO instead. There is not much to do there.

Todo:

  • check/remove the (few) old_div calls added by futurize
  • check/remove the list(...} wrappers added by futurize
  • go back and add future.bytes calls to maintain python 2 compatibility.

All RO access is via the opscore.actor modules, and the following are the actual RO modules used:

RO
RO.AddCallback
RO.Alg
RO.Alg.GenericCallback
RO.Alg.IDGen
RO.Alg.MatchList
RO.Alg.MultiDict
RO.Alg.MultiListIter
RO.Alg.OrderedDict
RO.Alg.RandomWalk
RO.Comm
RO.Comm.HubConnection
RO.Comm.TCPConnection
RO.Comm.TkSocket
RO.Constants
RO.MathUtil
RO.OS
RO.OS.OSUtil
RO.OS.getDirs
RO.OS.getMacDirs
RO.ParseMsg
RO.ParseMsg.GetHeader
RO.ParseMsg.GetKeyword
RO.ParseMsg.GetString
RO.ParseMsg.GetValues
RO.ParseMsg.ParseData
RO.ParseMsg.ParseMsg
RO.PhysConst
RO.SeqUtil
RO.StringUtil
RO.SysConst
RO.TkUtil
RO.Version


 Comments   
Comment by cloomis [ 04/Jan/18 ]

Merged at 19515bc

I'd like to close this now and fix under smaller tickets.

Generated at Sat Feb 10 16:23:17 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.