Пример #1
0
 def putc(data, timeout=10):
     try:
         size = scheduler.iotimeout(sys.stdout.write, (data,), timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size
Пример #2
0
 def getc(size, timeout=10):
     try:
         data = scheduler.iotimeout(sys.stdin.read, (size,), timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return data
Пример #3
0
 def putc(self, data, timeout=10):
     try:
         size = scheduler.iotimeout(self.stream.write, (data,), timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size
Пример #4
0
 def putc(data, timeout=10):
     try:
         size = scheduler.iotimeout(sys.stdout.write, (data, ),
                                    timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size
Пример #5
0
 def getc(size, timeout=10):
     try:
         data = scheduler.iotimeout(sys.stdin.read, (size, ),
                                    timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return data
Пример #6
0
 def putc(self, data, timeout=10):
     try:
         size = scheduler.iotimeout(self.stream.write, (data, ),
                                    timeout=timeout)
     except scheduler.TimeoutError:
         return None
     else:
         return size