diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-11-19 00:05:56 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-11-19 00:05:56 +0000 |
| commit | 878e43fb254bc6fef35372890b0a9d27a0ce33bb (patch) | |
| tree | b80dff07618f9a0372bbf5c00e320e1b51f13de4 | |
| parent | 49939b3439da13f610be2aff4e40473fa2e2f7b3 (diff) | |
New upstream version 20241115upstream/20241115
| -rw-r--r-- | PKG-INFO | 2 | ||||
| -rw-r--r-- | chirp.egg-info/PKG-INFO | 2 | ||||
| -rw-r--r-- | chirp/__init__.py | 2 | ||||
| -rw-r--r-- | chirp/bandplan.py | 23 | ||||
| -rw-r--r-- | chirp/bandplan_na.py | 7 | ||||
| -rw-r--r-- | chirp/locale/zh_CN/LC_MESSAGES/CHIRP.mo | bin | 9634 -> 75781 bytes | |||
| -rw-r--r-- | chirp/wxui/clone.py | 6 | ||||
| -rw-r--r-- | chirp/wxui/main.py | 35 | ||||
| -rw-r--r-- | chirp/wxui/memedit.py | 5 | ||||
| -rw-r--r-- | setup.py | 2 |
10 files changed, 51 insertions, 33 deletions
@@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: chirp -Version: 20241108 +Version: 20241115 Summary: A cross-platform cross-radio programming tool Home-page: https://chirp.danplanet.com Requires-Python: >=3.10,<4 diff --git a/chirp.egg-info/PKG-INFO b/chirp.egg-info/PKG-INFO index 2190c52..cccce57 100644 --- a/chirp.egg-info/PKG-INFO +++ b/chirp.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: chirp -Version: 20241108 +Version: 20241115 Summary: A cross-platform cross-radio programming tool Home-page: https://chirp.danplanet.com Requires-Python: >=3.10,<4 diff --git a/chirp/__init__.py b/chirp/__init__.py index 7a22d5d..22069ec 100644 --- a/chirp/__init__.py +++ b/chirp/__init__.py @@ -1 +1 @@ -CHIRP_VERSION = "next-20241108" +CHIRP_VERSION = "next-20241115" diff --git a/chirp/bandplan.py b/chirp/bandplan.py index ea80da4..30b940e 100644 --- a/chirp/bandplan.py +++ b/chirp/bandplan.py @@ -22,7 +22,8 @@ LOG = logging.getLogger(__name__) class Band(object): def __init__(self, limits, name, mode=None, step_khz=None, - input_offset=None, output_offset=None, tones=None): + input_offset=None, output_offset=None, tones=None, + duplex=None): # Apply semantic and chirp limitations to settings. # memedit applies radio limitations when settings are applied. try: @@ -46,14 +47,10 @@ class Band(object): self.step_khz = step_khz self.tones = tones self.limits = limits - self.offset = None - self.duplex = "simplex" - if input_offset is not None: - self.offset = input_offset - self.duplex = "rpt TX" - elif output_offset is not None: - self.offset = output_offset - self.duplex = "rpt RX" + self.offset = input_offset + self.duplex = duplex + if duplex is None and self.offset: + self.duplex = '+' if self.offset > 0 else '-' def __eq__(self, other): return (other.limits[0] == self.limits[0] and @@ -72,9 +69,10 @@ class Band(object): return self limits = (self.limits[0] + self.offset, self.limits[1] + self.offset) offset = -1 * self.offset - if self.duplex == "rpt RX": + if self.duplex in '+-': + duplex = '+' if self.duplex == '-' else '-' return Band(limits, self.name, self.mode, self.step_khz, - input_offset=offset, tones=self.tones) + input_offset=offset, tones=self.tones, duplex=duplex) return Band(limits, self.name, self.mode, self.step_khz, output_offset=offset, tones=self.tones) @@ -135,7 +133,8 @@ class BandPlans(object): result.mode = match.mode or result.mode result.step_khz = match.step_khz or result.step_khz result.offset = match.offset or result.offset - result.duplex = match.duplex or result.duplex + result.duplex = (match.duplex if match.duplex is not None + else result.duplex) result.tones = match.tones or result.tones if match.name: result.name = '/'.join((result.name or '', match.name)) diff --git a/chirp/bandplan_na.py b/chirp/bandplan_na.py index a1f7ea6..b83b026 100644 --- a/chirp/bandplan_na.py +++ b/chirp/bandplan_na.py @@ -178,6 +178,11 @@ BANDS_70CM = ( "(local option)", input_offset=-5000000), ) +BANDS_US_GMRS = ( + bandplan.Band((462550000, 462725000), "GMRS Repeaters", + input_offset=5000000, duplex=''), +) + BANDS_33CM = ( bandplan.Band((902000000, 928000000), "33 Centimeter Band"), bandplan.Band((902075000, 902100000), "CW/SSB, Weak signal"), @@ -267,7 +272,7 @@ BANDS = bandplan_iaru_r2.BANDS + \ BANDS_160M + BANDS_80M + BANDS_40M + BANDS_30M + BANDS_20M + \ BANDS_17M + BANDS_15M + BANDS_12M + BANDS_10M + BANDS_6M + \ BANDS_2M + BANDS_1_25M + BANDS_70CM + BANDS_33CM + BANDS_23CM + \ - BANDS_13CM + BANDS_13CM + BANDS_US_GMRS # US 2017+ GMRS/FRS Frequencies diff --git a/chirp/locale/zh_CN/LC_MESSAGES/CHIRP.mo b/chirp/locale/zh_CN/LC_MESSAGES/CHIRP.mo Binary files differindex d71b822..e5c080e 100644 --- a/chirp/locale/zh_CN/LC_MESSAGES/CHIRP.mo +++ b/chirp/locale/zh_CN/LC_MESSAGES/CHIRP.mo diff --git a/chirp/wxui/clone.py b/chirp/wxui/clone.py index 22d38e6..93877bd 100644 --- a/chirp/wxui/clone.py +++ b/chirp/wxui/clone.py @@ -600,9 +600,9 @@ class ChirpCloneDialog(wx.Dialog): hbox.Add(always, border=10, flag=wx.ALL | wx.EXPAND) hbox.Add(remove, border=10, flag=wx.ALL) - d.SetSize((300, 300)) - d.SetMaxSize((300, 300)) - d.SetMinSize((300, 300)) + d.SetSize((400, 400)) + d.SetMinSize((400, 400)) + d.SetMaxSize((400, 400)) d.Center() c = d.ShowModal() if c == wx.ID_OK and recent: diff --git a/chirp/wxui/main.py b/chirp/wxui/main.py index 87e2052..fa8cdb3 100644 --- a/chirp/wxui/main.py +++ b/chirp/wxui/main.py @@ -1525,30 +1525,30 @@ class ChirpMain(wx.Frame): 'to take effect'), _('Restart Required')) - def _make_backup(self, radio): + def _make_backup(self, radio, backup_type): if not isinstance(radio, chirp_common.CloneModeRadio): LOG.debug('Not backing up %s' % radio) return backup_dir = chirp_platform.get_platform().config_file('backups') now = datetime.datetime.now() - fn = os.path.join(backup_dir, - '%s_%s' % (directory.radio_class_id(radio.__class__), - now.strftime('%Y%m%dT%H%M%S.img'))) + backup_fn = os.path.join(backup_dir, + '%s_%s_%s' % (directory.radio_class_id( + radio.__class__), + backup_type, + now.strftime( + '%Y%m%dT%H%M%S.img'))) try: os.makedirs(backup_dir, exist_ok=True) - radio.save(fn) - LOG.info('Saved backup to %s', fn) + radio.save(backup_fn) + LOG.info('Saved %s backup to %s', backup_type, backup_fn) except Exception as e: - LOG.warning('Failed to backup %s: %s', radio, e) + LOG.warning('Failed to backup %s %s: %s', backup_type, radio, e) return try: keep_days = CONF.get_int('keep_backups_days', 'prefs') except TypeError: keep_days = 365 - if keep_days < 0: - # Never prune - return try: files = os.listdir(backup_dir) bydate = [(os.stat(os.path.join(backup_dir, f)).st_mtime, f) @@ -1556,7 +1556,7 @@ class ChirpMain(wx.Frame): now = time.time() for mtime, fn in sorted(bydate): age = (now - mtime) // 86400 - if age > keep_days: + if keep_days > 0 and age > keep_days: os.remove(os.path.join(backup_dir, fn)) LOG.warning('Pruned backup %s older than %i days', fn, keep_days) @@ -1567,13 +1567,15 @@ class ChirpMain(wx.Frame): except Exception as e: LOG.exception('Failed to prune: %s' % e) + return backup_fn + def _menu_download(self, event): self.enable_bugreport() with clone.ChirpDownloadDialog(self) as d: d.Centre() if d.ShowModal() == wx.ID_OK: radio = d._radio - self._make_backup(radio) + self._make_backup(radio, 'download') report.report_model(radio, 'download') if isinstance(radio, chirp_common.LiveRadio): editorset = ChirpLiveEditorSet(radio, None, self._editors) @@ -1583,6 +1585,7 @@ class ChirpMain(wx.Frame): def _menu_upload(self, event): radio = self.current_editorset.radio + fn = self._make_backup(radio, 'upload') report.report_model(radio, 'upload') CSVRadio = directory.get_radio('Generic_CSV') @@ -1603,7 +1606,13 @@ class ChirpMain(wx.Frame): d = clone.ChirpUploadDialog(radio, self) d.Centre() - d.ShowModal() + r = d.ShowModal() + if r != wx.ID_OK: + LOG.info('Removing un-uploaded backup %s', fn) + try: + os.remove(fn) + except Exception: + pass @common.error_proof() def _menu_reload_driver(self, event, andfile=False): diff --git a/chirp/wxui/memedit.py b/chirp/wxui/memedit.py index 50503a1..b0cd202 100644 --- a/chirp/wxui/memedit.py +++ b/chirp/wxui/memedit.py @@ -1304,9 +1304,14 @@ class ChirpMemEdit(common.ChirpEditor, common.ChirpSyncEditor): defaults = self.bandplan.get_defaults_for_frequency(mem.freq) features = self._features + LOG.debug('Using band defaults: %s' % defaults) + if not defaults.offset: want_duplex = '' want_offset = None + elif defaults.duplex is not None: + want_duplex = defaults.duplex + want_offset = abs(defaults.offset) elif defaults.offset > 0: want_duplex = '+' want_offset = defaults.offset @@ -5,7 +5,7 @@ setup(name='chirp', description='A cross-platform cross-radio programming tool', packages=find_packages(include=["chirp*"]), include_package_data=True, - version='20241108', + version='20241115', url='https://chirp.danplanet.com', python_requires=">=3.10,<4", install_requires=[ |
