parameters: (self, cmd)
docstring: Change to a directory based on cd command
          @param cmd: cd path
docstring_summary: Change to a directory based on cd command
          @param cmd: cd path
docstring_tokens: Change to a directory based on cd command @param cmd : cd path
function: def ChangeDir(self, cmd):
          """Change to a directory based on cd command
          @param cmd: cd path
  
          """
          path = cmd.replace('cd', '', 1).strip()
          if not os.path.isabs(path):
              if path.startswith('..'):
                  path = os.path.abspath(path)
              elif path.startswith('~'):
                  path = path.replace('~', wx.GetHomeDir(), 1)
              else:
                  path = os.path.join(self._curdir, path)
  
          if os.path.exists(path) and os.path.isdir(path):
              if os.access(path, os.R_OK):
                  os.chdir(path)
                  self._curdir = os.path.abspath(os.path.curdir) + os.sep
              else:
                  # Doesn't have permissions
                  ed_msg.PostMessage(ed_msg.EDMSG_UI_SB_TXT,
                                    (ed_glob.SB_INFO,
                                     _("Can't change directory to: %s") % path))
                  wx.Bell()
                  self.Clear()
          else:
              # Invalid path
              self.Clear()
              wx.Bell()
function_tokens: def ChangeDir ( self , cmd ) : path = cmd . replace ( 'cd' , '' , 1 ) . strip ( ) if not os . path . isabs ( path ) : if path . startswith ( '..' ) : path = os . path . abspath ( path ) elif path . startswith ( '~' ) : path = path . replace ( '~' , wx . GetHomeDir ( ) , 1 ) else : path = os . path . join ( self . _curdir , path ) if os . path . exists ( path ) and os . path . isdir ( path ) : if os . access ( path , os . R_OK ) : os . chdir ( path ) self . _curdir = os . path . abspath ( os . path . curdir ) + os . sep else : # Doesn't have permissions ed_msg . PostMessage ( ed_msg . EDMSG_UI_SB_TXT , ( ed_glob . SB_INFO , _ ( "Can't change directory to: %s" ) % path ) ) wx . Bell ( ) self . Clear ( ) else : # Invalid path self . Clear ( ) wx . Bell ( )