Esempio n. 1
0
    def _get_output_filename(self):
        if self._options.test_mode:
            return os.devnull

        if self._options.filename != '':
            filename = '%s-%s.wav' % (self._options.filename,
                                      self._profile.getMode())
        else:
            ts = time.strftime(
                self._profile.getFileTimestampFormat(), self._start_ts)
            filename = '%s.wav' % ts

        filename = os.path.join(Config.tmpdir(), self._options.station, self._profile.getMode(), self._band, filename)
        return filename
Esempio n. 2
0
    def __init__(self, station: str):
        self.spots = []
        self.spotLock = threading.Lock()
        self.station = station
        self.timer = None

        # prepare tmpdir for uploader
        self.tmpdir = os.path.join(Config.tmpdir(), station, "WSPR",
                                   "wsprnet.uploader")
        self.logdir = os.path.join(Config.logdir(), "spots", "wsprnet",
                                   station)
        os.makedirs(self.tmpdir, exist_ok=True)
        os.makedirs(self.logdir, exist_ok=True)

        self.uploader = Uploader(station, self.tmpdir, self.logdir)