<s> from urlparse import urlparse , parse_qsl <EOL> __author__ = '<STR_LIT>' <EOL> class ServiceURL ( object ) : <EOL> protocol = '<STR_LIT>' <EOL> location = '<STR_LIT>' <EOL> path = '<STR_LIT>' <EOL> ip = '<STR_LIT:127.0.0.1>' <EOL> port = '<STR_LIT>' <EOL> version = '<STR_LIT>' <EOL> group = '<STR_LIT>' <EOL> def __init__ ( self , url ) : <EOL> result = urlparse ( url ) <EOL> self . protocol = result [ <NUM_LIT:0> ] <EOL> self . location = result [ <NUM_LIT:1> ] <EOL> self . path = result [ <NUM_LIT:2> ] <EOL> if self . location . find ( '<STR_LIT::>' ) > - <NUM_LIT:1> : <EOL> self . ip , self . port = result [ <NUM_LIT:1> ] . split ( '<STR_LIT::>' ) <EOL> params = parse_qsl ( result [ <NUM_LIT:4> ] ) <EOL> for key , value in params : <EOL> pos = key . find ( '<STR_LIT:.>' ) <EOL> if pos > - <NUM_LIT:1> : <EOL> key = key [ pos + <NUM_LIT:1> : ] <EOL> self . __dict__ [ key ] = value </s>
