#NEWLINE# def glob_to_iptuple( ipglob ) : #NEWLINE# #INDENT# '\n    A function that accepts a glob-style IP range and returns the component\n    lower and upper bound IP address.\n\n    :param ipglob: an IP address range in a glob-style format.\n\n    :return: a tuple contain lower and upper bound IP objects.\n    ' #NEWLINE# if ( not valid_glob ( ipglob ) ) : #NEWLINE# #INDENT# raise AddrFormatError ( ( 'not a recognised IP glob range: %r!' % ipglob ) ) #NEWLINE# #UNINDENT# start_tokens = [ ] #NEWLINE# end_tokens = [ ] #NEWLINE# for octet in ipglob . split ( '.' ) : #NEWLINE# #INDENT# if ( '-' in octet ) : #NEWLINE# #INDENT# tokens = octet . split ( '-' ) #NEWLINE# start_tokens . append ( tokens [ 0 ] ) #NEWLINE# end_tokens . append ( tokens [ 1 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( octet == '*' ) : #NEWLINE# #INDENT# start_tokens . append ( '0' ) #NEWLINE# end_tokens . append ( '255' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# start_tokens . append ( octet ) #NEWLINE# end_tokens . append ( octet ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( IPAddress ( '.' . join ( start_tokens ) ) , IPAddress ( '.' . join ( end_tokens ) ) )