parameters: (self, name, public)
return_statement: return out_dict
docstring: Returns the private SSH key associated with *name* to the client.  If
      *public* is `True`, returns the public key to the client.
docstring_summary: Returns the private SSH key associated with *name* to the client.  If
      *public* is `True`, returns the public key to the client.
docstring_tokens: Returns the private SSH key associated with * name * to the client . If * public * is True returns the public key to the client .
function: def get_key(self, name, public):
      """
      Returns the private SSH key associated with *name* to the client.  If
      *public* is `True`, returns the public key to the client.
      """
      if not isinstance(name, (str, unicode)):
          error_msg = _(
              'SSH Plugin Error: Invalid name given, %s' % repr(name))
          message = {'go:save_file': {'result': error_msg}}
          self.write_message(message)
          return
      if public and not name.endswith('.pub'):
          name += '.pub'
      out_dict = {
          'result': None, # Yet
          'filename': name,
          'data': None,
          'mimetype': 'text/plain'
      }
      users_ssh_dir = get_ssh_dir(self)
      key_path = os.path.join(users_ssh_dir, name)
      if os.path.exists(key_path):
          with open(key_path) as f:
              out_dict['data'] = f.read()
          out_dict['result'] = 'Success'
      else:
          out_dict['result'] = _(
              'SSH Plugin Error: Public key not found at %s' % key_path)
      message = {'go:save_file': out_dict}
      self.write_message(message)
      return out_dict
function_tokens: def get_key ( self , name , public ) : if not isinstance ( name , ( str , unicode ) ) : error_msg = _ ( 'SSH Plugin Error: Invalid name given, %s' % repr ( name ) ) message = { 'go:save_file' : { 'result' : error_msg } } self . write_message ( message ) return if public and not name . endswith ( '.pub' ) : name += '.pub' out_dict = { 'result' : None , # Yet 'filename' : name , 'data' : None , 'mimetype' : 'text/plain' } users_ssh_dir = get_ssh_dir ( self ) key_path = os . path . join ( users_ssh_dir , name ) if os . path . exists ( key_path ) : with open ( key_path ) as f : out_dict [ 'data' ] = f . read ( ) out_dict [ 'result' ] = 'Success' else : out_dict [ 'result' ] = _ ( 'SSH Plugin Error: Public key not found at %s' % key_path ) message = { 'go:save_file' : out_dict } self . write_message ( message ) return out_dict