def dccDescribe(data):
 orig_data = data
 data = string.split(data)
 if (len(data) < 4):
  return orig_data
 (dcctype, arg, address, port) = data[:4]
 if ('.' in address):
  pass
 else:
  try:
   address = long(address)
  except ValueError:
   pass
  else:
   address = (((address >> 24) & 255), ((address >> 16) & 255), ((address >> 8) & 255), (address & 255))
   address = string.join(map(str, map(int, address)), '.')
 if (dcctype == 'SEND'):
  filename = arg
  size_txt = ''
  if (len(data) >= 5):
   try:
    size = int(data[4])
    size_txt = (' of size %d bytes' % (size,))
   except ValueError:
    pass
  dcc_text = ("SEND for file '%s'%s at host %s, port %s" % (filename, size_txt, address, port))
 elif (dcctype == 'CHAT'):
  dcc_text = ('CHAT for host %s, port %s' % (address, port))
 else:
  dcc_text = orig_data
 return dcc_text

def dccDescribe ( data ) : orig_data = data data = string . split ( data ) if ( len ( data ) < 4 ) : return orig_data ( dcctype , arg , address , port ) = data [ : 4 ] if ( '.' in address ) : pass else : try : address = long ( address ) except ValueError : pass else : address = ( ( ( address >> 24 ) & 255 ) , ( ( address >> 16 ) & 255 ) , ( ( address >> 8 ) & 255 ) , ( address & 255 ) ) address = string . join ( map ( str , map ( int , address ) ) , '.' ) if ( dcctype == 'SEND' ) : filename = arg size_txt = '' if ( len ( data ) >= 5 ) : try : size = int ( data [ 4 ] ) size_txt = ( ' of size %d bytes' % ( size , ) ) except ValueError : pass dcc_text = ( "SEND for file '%s'%s at host %s, port %s" % ( filename , size_txt , address , port ) ) elif ( dcctype == 'CHAT' ) : dcc_text = ( 'CHAT for host %s, port %s' % ( address , port ) ) else : dcc_text = orig_data return dcc_text
given the data chunk from a dcc query .