Actions
Task #6109
openleginon python3 conversion
Start date:
10/02/2018
Due date:
% Done:
0%
Estimated time:
Deliverable:
Description
Want to use sinedon for some new projects.
Updated by Anchi Cheng almost 4 years ago
- Related to Bug #9843: Configparser.SafeConfigParser is configparser.ConfigParser in python 3.2 added
Updated by Anchi Cheng almost 4 years ago
- Target version changed from Appion/Leginon Future Version to Appion/Leginon 4.0
Updated by Anchi Cheng over 2 years ago
- Subject changed from sinedon python3 conversion to leginon python3 conversion
Here are changes I noted down.
SocketServer > socketserver>pickle
cPickle
ConfigParser ->configparser
- when index is needed range(10) -> list(range(10)
- y_dict.has_keyx in y_dict.keys()
- integer math 5/2 -> 5//2
- types
long -> int
02 octa -> 0o2 octa
- string module can not be used to operate as an instance of a text string.
- string.join([‘a’,’b’]) -> “ “.join([‘a’, ‘b’])
string.join([‘a’,’b’],”:") -> “:“.join([‘a’, ‘b’])
- Exceptions
- except Exception, e -> Exception as e
- sort(cmpfunc0 -> sort(key=functools.cmp_to_key(cmpfunc)
- numpy
- numpy.frombuffer(‘REAL’, numpy.int32) -> numpy.frombuffer(b‘REAL’, numpy.int32)
- numpy.dtype(‘Int’) -> numpy.dtype(‘int’)
- wxPython
1,$s/pyDeadObjectError/RuntimeError
1,$s/wx.wizard/wx.adv.wizard
1,$s/Wizard.EVT_WI/EVT_WI
1,$s/from \./from leginon
1,$s/gui.wx/leginon.gui.wx
1,$s/shortHelpString/shortHelp
1,$s/AppendItem(/Append(/g
1,$s/BitmapFromImage/Bitmap/g
1,$s/EmptyBitmap/Bitmap/g
1,$s/FindItemData/FindItem/g
1,$s/SetStringItem/SetItem/g
1,$s/InsertStringItem/InsertItem/g
1,$s/StockCursor/StockCursor/g
dc.BeginDrawing nad EndDrawing dprecated (just comment them out)
wx.colour is not hashable -> tuple(wx.colour)
Actions