BeremizIDE.py
branchpython3
changeset 3758 bc71b19b45ff
parent 3755 ca814b175391
child 3766 f99def63cdd8
equal deleted inserted replaced
3757:814595c0ea16 3758:bc71b19b45ff
    23 # along with this program; if not, write to the Free Software
    23 # along with this program; if not, write to the Free Software
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    25 
    25 
    26 
    26 
    27 import os
    27 import os
       
    28 import pickle
    28 import sys
    29 import sys
    29 import shutil
    30 import shutil
    30 import time
    31 import time
    31 import signal
    32 import signal
    32 from time import time as gettime
    33 from time import time as gettime
    33 from threading import Lock, Timer, currentThread
    34 from threading import Lock, Timer, currentThread
    34 
    35 
    35 from six.moves import cPickle
       
    36 import wx.lib.buttons
    36 import wx.lib.buttons
    37 import wx.lib.statbmp
    37 import wx.lib.statbmp
    38 import wx.stc
    38 import wx.stc
    39 import wx.adv
    39 import wx.adv
    40 
    40 
   820             # Re-enable button
   820             # Re-enable button
   821             event.GetEventObject().Enable()
   821             event.GetEventObject().Enable()
   822         return OnMenu
   822         return OnMenu
   823 
   823 
   824     def GetConfigEntry(self, entry_name, default):
   824     def GetConfigEntry(self, entry_name, default):
   825         return cPickle.loads(str(self.Config.Read(entry_name, cPickle.dumps(default))))
   825         return pickle.loads(self.Config.Read(entry_name,
       
   826                                              pickle.dumps(default,
       
   827                                                           0).decode()).encode())
   826 
   828 
   827     def ResetConnectionStatusBar(self):
   829     def ResetConnectionStatusBar(self):
   828         for field in range(self.ConnectionStatusBar.GetFieldsCount()):
   830         for field in range(self.ConnectionStatusBar.GetFieldsCount()):
   829             self.ConnectionStatusBar.SetStatusText('', field)
   831             self.ConnectionStatusBar.SetStatusText('', field)
   830 
   832 
   846             recent_projects = []
   848             recent_projects = []
   847         if projectpath in recent_projects:
   849         if projectpath in recent_projects:
   848             recent_projects.remove(projectpath)
   850             recent_projects.remove(projectpath)
   849         if not err:
   851         if not err:
   850             recent_projects.insert(0, projectpath)
   852             recent_projects.insert(0, projectpath)
   851         self.Config.Write("RecentProjects", cPickle.dumps(
   853         self.Config.Write("RecentProjects",
   852             list(map(EncodeFileSystemPath, recent_projects[:MAX_RECENT_PROJECTS]))))
   854                           pickle.dumps(
       
   855                               list(map(EncodeFileSystemPath,
       
   856                                        recent_projects[:MAX_RECENT_PROJECTS])),
       
   857                               0))
   853         self.Config.Flush()
   858         self.Config.Flush()
   854 
   859 
   855     def ResetPerspective(self):
   860     def ResetPerspective(self):
   856         IDEFrame.ResetPerspective(self)
   861         IDEFrame.ResetPerspective(self)
   857         self.RefreshStatusToolBar()
   862         self.RefreshStatusToolBar()