#NEWLINE# def splituser( host ) : #NEWLINE# #INDENT# "splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'." #NEWLINE# global _userprog #NEWLINE# if ( _userprog is None ) : #NEWLINE# #INDENT# import re #NEWLINE# _userprog = re . compile ( '^(.*)@(.*)$' ) #NEWLINE# #UNINDENT# match = _userprog . match ( host ) #NEWLINE# if match : #NEWLINE# #INDENT# return match . group ( 1 , 2 ) #NEWLINE# #UNINDENT# return ( None , host )