def _parseServer(description, factory, default=None):
 (args, kw) = _parse(description)
 if ((not args) or ((len(args) == 1) and (not kw))):
  deprecationMessage = ("Unqualified strport description passed to 'service'.Use qualified endpoint descriptions; for example, 'tcp:%s'." % (description,))
  if (default is None):
   default = 'tcp'
   warnings.warn(deprecationMessage, category=DeprecationWarning, stacklevel=4)
  elif (default is _NO_DEFAULT):
   raise ValueError(deprecationMessage)
  args[0:0] = [default]
 endpointType = args[0]
 parser = _serverParsers.get(endpointType)
 if (parser is None):
  for plugin in getPlugins(IStreamServerEndpointStringParser):
   if (plugin.prefix == endpointType):
    return (plugin, args[1:], kw)
  raise ValueError(("Unknown endpoint type: '%s'" % (endpointType,)))
 return ((endpointType.upper(),) + parser(factory, *args[1:], **kw))

def _parseServer ( description , factory , default = None ) : ( args , kw ) = _parse ( description ) if ( ( not args ) or ( ( len ( args ) == 1 ) and ( not kw ) ) ) : deprecationMessage = ( "Unqualified strport description passed to 'service'.Use qualified endpoint descriptions; for example, 'tcp:%s'." % ( description , ) ) if ( default is None ) : default = 'tcp' warnings . warn ( deprecationMessage , category = DeprecationWarning , stacklevel = 4 ) elif ( default is _NO_DEFAULT ) : raise ValueError ( deprecationMessage ) args [ 0 : 0 ] = [ default ] endpointType = args [ 0 ] parser = _serverParsers . get ( endpointType ) if ( parser is None ) : for plugin in getPlugins ( IStreamServerEndpointStringParser ) : if ( plugin . prefix == endpointType ) : return ( plugin , args [ 1 : ] , kw ) raise ValueError ( ( "Unknown endpoint type: '%s'" % ( endpointType , ) ) ) return ( ( endpointType . upper ( ) , ) + parser ( factory , * args [ 1 : ] , ** kw ) )
parse a stports description into a 2-tuple of arguments and keyword values .