def testReadEmpty(self): tempfn = tempfile.mkstemp()[1] try: list(mseed.iload(tempfn)) except FileLoadError as e: assert str(e).find('No SEED data detected') != -1 os.remove(tempfn)
def process(self): try: ready, _, _ = select.select([self.slink.stdout], [], [], .2) if not ready: return False line = self.slink.stdout.read(RECORD_LENGTH) with tempfile.NamedTemporaryFile(prefix='slink-stream') as f: f.write(line) f.flush() traces = mseed.iload(f.name) for tr in traces: self.got_trace(tr) return True except Exception as e: logger.debug(e) return False