IDEFrame.py
branchpython3
changeset 3755 ca814b175391
parent 3752 9f6f46dbe3ae
child 3758 bc71b19b45ff
equal deleted inserted replaced
3754:98a76dbb1b6d 3755:ca814b175391
    96 #                               Helper Functions
    96 #                               Helper Functions
    97 # -------------------------------------------------------------------------------
    97 # -------------------------------------------------------------------------------
    98 
    98 
    99 
    99 
   100 def EncodeFileSystemPath(path, use_base64=True):
   100 def EncodeFileSystemPath(path, use_base64=True):
   101     path = path.encode(sys.getfilesystemencoding())
       
   102     if use_base64:
   101     if use_base64:
   103         return base64.encodestring(path)
   102         path = base64.b64encode(path.encode()).decode()
   104     return path
   103     return path
   105 
   104 
   106 
   105 
   107 def DecodeFileSystemPath(path, is_base64=True):
   106 def DecodeFileSystemPath(path, is_base64=True):
   108     if is_base64:
   107     if is_base64:
   109         path = base64.decodestring(path)
   108         path = base64.b64decode(path.encode()).decode()
   110     return str(path, sys.getfilesystemencoding())
   109     return path
   111 
   110 
   112 
   111 
   113 def AppendMenu(parent, help, kind, text, id=wx.ID_ANY):
   112 def AppendMenu(parent, help, kind, text, id=wx.ID_ANY):
   114     return parent.Append(wx.MenuItem(helpString=help, kind=kind, text=text, id=id))
   113     return parent.Append(wx.MenuItem(helpString=help, kind=kind, text=text, id=id))
   115 
   114