parameters: (self, url)
return_statement: return (parts.hostname, parts.port)
docstring: \
          extract host and port from an URL string, other settings are extracted
          an stored in instance
docstring_summary: \
          extract host and port from an URL string, other settings are extracted
          an stored in instance
docstring_tokens: \ extract host and port from an URL string other settings are extracted an stored in instance
function: def from_url(self, url):
          """\
          extract host and port from an URL string, other settings are extracted
          an stored in instance
          """
          parts = urlparse.urlsplit(url)
          if parts.scheme != "rfc2217":
              raise SerialException(
                  'expected a string in the form '
                  '"rfc2217://<host>:<port>[?option[&option...]]": '
                  'not starting with rfc2217:// ({!r})'.format(parts.scheme))
          try:
              # process options now, directly altering self
              for option, values in urlparse.parse_qs(parts.query, True).items():
                  if option == 'logging':
                      logging.basicConfig()   # XXX is that good to call it here?
                      self.logger = logging.getLogger('pySerial.rfc2217')
                      self.logger.setLevel(LOGGER_LEVELS[values[0]])
                      self.logger.debug('enabled logging')
                  elif option == 'ign_set_control':
                      self._ignore_set_control_answer = True
                  elif option == 'poll_modem':
                      self._poll_modem_state = True
                  elif option == 'timeout':
                      self._network_timeout = float(values[0])
                  else:
                      raise ValueError('unknown option: {!r}'.format(option))
              if not 0 <= parts.port < 65536:
                  raise ValueError("port not in range 0...65535")
          except ValueError as e:
              raise SerialException(
                  'expected a string in the form '
                  '"rfc2217://<host>:<port>[?option[&option...]]": {}'.format(e))
          return (parts.hostname, parts.port)
function_tokens: def from_url ( self , url ) : parts = urlparse . urlsplit ( url ) if parts . scheme != "rfc2217" : raise SerialException ( 'expected a string in the form ' '"rfc2217://<host>:<port>[?option[&option...]]": ' 'not starting with rfc2217:// ({!r})' . format ( parts . scheme ) ) try : # process options now, directly altering self for option , values in urlparse . parse_qs ( parts . query , True ) . items ( ) : if option == 'logging' : logging . basicConfig ( ) # XXX is that good to call it here? self . logger = logging . getLogger ( 'pySerial.rfc2217' ) self . logger . setLevel ( LOGGER_LEVELS [ values [ 0 ] ] ) self . logger . debug ( 'enabled logging' ) elif option == 'ign_set_control' : self . _ignore_set_control_answer = True elif option == 'poll_modem' : self . _poll_modem_state = True elif option == 'timeout' : self . _network_timeout = float ( values [ 0 ] ) else : raise ValueError ( 'unknown option: {!r}' . format ( option ) ) if not 0 <= parts . port < 65536 : raise ValueError ( "port not in range 0...65535" ) except ValueError as e : raise SerialException ( 'expected a string in the form ' '"rfc2217://<host>:<port>[?option[&option...]]": {}' . format ( e ) ) return ( parts . hostname , parts . port )