def __init__(self, work_dir, partition=(1, 1), tag="mlat", authenticator=None, pseudorange_filename=None): """If authenticator is not None, it should be a callable that takes two arguments: the newly created Receiver, plus the 'auth' argument provided by the connection. The authenticator may modify the receiver if needed. The authenticator should either return silently on success, or raise an exception (propagated to the caller) on failure. """ self.work_dir = work_dir self.receivers = {} # keyed by uuid self.sighup_handlers = [] self.authenticator = authenticator self.partition = partition self.tag = tag self.tracker = tracker.Tracker(partition) self.clock_tracker = clocktrack.ClockTracker() self.mlat_tracker = mlattrack.MlatTracker( self, blacklist_filename=work_dir + '/blacklist.txt', pseudorange_filename=pseudorange_filename) self.output_handlers = [self.forward_results] self.receiver_mlat = self.mlat_tracker.receiver_mlat self.receiver_sync = self.clock_tracker.receiver_sync
def __init__(self, work_dir, partition=(1, 1), tag="mlat", authenticator=None, pseudorange_filename=None): """If authenticator is not None, it should be a callable that takes two arguments: the newly created Receiver, plus the 'auth' argument provided by the connection. The authenticator may modify the receiver if needed. The authenticator should either return silently on success, or raise an exception (propagated to the caller) on failure. """ self.work_dir = work_dir self.receivers = {} # keyed by uuid self.sighup_handlers = [] self.authenticator = authenticator self.partition = partition self.tag = tag self.tracker = tracker.Tracker(self, partition) self.clock_tracker = clocktrack.ClockTracker(self) self.mlat_tracker = mlattrack.MlatTracker( self, blacklist_filename=work_dir + '/blacklist.txt', pseudorange_filename=pseudorange_filename) self.output_handlers = [self.forward_results] self.receiver_mlat = self.mlat_tracker.receiver_mlat self.receiver_sync = self.clock_tracker.receiver_sync self.handshake_logger = logging.getLogger("handshake") self.handshake_logger.setLevel(logging.DEBUG) self.handshake_handler = logging.handlers.RotatingFileHandler( (self.work_dir + '/handshakes.log'), maxBytes=(1 * 1024 * 1024), backupCount=2) self.handshake_logger.addHandler(self.handshake_handler)