Пример #1
0
Файл: conn.py Проект: Ricemast/q
 def __call__(self, *args):
     if len(args):
         args = list(args)
         if isinstance(args[0], str):
             args[0] = q_str(args[0])
             if len(args) == 1:
                 args = args[0]
         self._send(conn.SYNC, args)
     return self._receive()
Пример #2
0
 def _read(reader,tcode,endianness,offset,bytes):
   (n, offset) = parser.read_integer(endianness,offset+1,bytes)
   val = q_list([])
   if n == 0: return (val,offset)
   for i in range(0, n):
       (item,offset) = reader(endianness,offset,bytes)
       val.append(item)
   if tcode is CHAR_CODE:
     return (q_str(''.join(val)),offset)
   else:
     val._determine_type()
     return (val,offset)
Пример #3
0
 def _read(reader, tcode, endianness, offset, bytes):
     (n, offset) = parser.read_integer(endianness, offset + 1, bytes)
     val = q_list([])
     if n == 0: return (val, offset)
     for i in range(0, n):
         (item, offset) = reader(endianness, offset, bytes)
         val.append(item)
     if tcode is CHAR_CODE:
         return (q_str(''.join(val)), offset)
     else:
         val._determine_type()
         return (val, offset)