From 4a2d794cdfe4adf057073c0baa941c58d69d0f4f Mon Sep 17 00:00:00 2001 From: nicolasjon Date: Sat, 12 Dec 2020 18:06:06 +0000 Subject: FT70 syntax/Lint changes (test) --- chirp/drivers/ft70.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chirp/drivers/ft70.py b/chirp/drivers/ft70.py index 2875c13..73d2df0 100644 --- a/chirp/drivers/ft70.py +++ b/chirp/drivers/ft70.py @@ -15,15 +15,16 @@ # along with this program. If not, see . import logging +import string from chirp.drivers import yaesu_clone from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettingValueString, \ + RadioSettingValueList, \ InvalidValueError from textwrap import dedent -import string + LOG = logging.getLogger(__name__) # Testing -- cgit v1.2.3 From eea7629ad5e77e9c7606576829247f06127b9c7e Mon Sep 17 00:00:00 2001 From: nicolasjon Date: Sat, 12 Dec 2020 19:15:21 +0000 Subject: FT70 syntax tidy, mainapp.py first try at proper Mac startup --- chirp/drivers/ft70.py | 15 +++++++-------- chirp/ui/mainapp.py | 11 ++++++++++- pylintrc | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/chirp/drivers/ft70.py b/chirp/drivers/ft70.py index 73d2df0..9aed7cb 100644 --- a/chirp/drivers/ft70.py +++ b/chirp/drivers/ft70.py @@ -1,5 +1,5 @@ # Copyright 2010 Dan Smith -# Copyright 2017 Nicolas Pike +# Copyright 2017 - 2019 Nicolas Pike # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,6 +16,7 @@ import logging import string +from textwrap import dedent from chirp.drivers import yaesu_clone from chirp import chirp_common, directory, bitwise @@ -23,7 +24,6 @@ from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ RadioSettingValueString, \ RadioSettingValueList, \ InvalidValueError -from textwrap import dedent LOG = logging.getLogger(__name__) @@ -505,9 +505,9 @@ class FT70Radio(yaesu_clone.YaesuCloneModeRadio): _DTMF_SPEED = ("50ms", "100ms") _DTMF_DELAY = ("50ms", "250ms", "450ms", "750ms", "1000ms") _TEMP_CF = ("Centigrade", "Fahrenheit") - _APO_SELECT = ("Off", "0.5H", "1.0H", "1.5H", "2.0H", "2.5H", "3.0H", "3.5H", "4.0H", "4.5H", "5.0H", - "5.5H", "6.0H", "6.5H", "7.0H", "7.5H", "8.0H", "8.5H", "9.0H", "9.5H", "10.0H", "10.5H", - "11.0H", "11.5H", "12.0H") + _APO_SELECT = ("Off", "0.5H", "1.0H", "1.5H", "2.0H", "2.5H", "3.0H", \ + "3.5H", "4.0H", "4.5H", "5.0H", "5.5H", "6.0H", "6.5H", "7.0H", "7.5H", \ + "8.0H", "8.5H", "9.0H", "9.5H", "10.0H", "10.5H", "11.0H", "11.5H", "12.0H") _MONI_TCALL = ("Monitor", "Tone-CALL") _HOME_REV = ("Home", "Reverse") _LOCK = ("KEY", "DIAL", "Key+Dial", "PTT", "Key+PTT", "Dial+PTT", "ALL") @@ -515,7 +515,7 @@ class FT70Radio(yaesu_clone.YaesuCloneModeRadio): _BEEP_LEVEL = ("Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6", "Level 7") _SET_MODE = ("Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6", "Level 7") _RX_SAVE = ("OFF", "0.2s", ".3s", ".4s", ".5s", ".6s", ".7s", ".8s", ".9s", "1.0s", "1.5s", - "2.0s", "2.5s", "3.0s", "3.5s", "4.0s", "4.5s", "5.0s", "5.5s", "6.0s", "6.5s", "7.0s", + "2.0s", "2.5s", "3.0s", "3.5s", "4.0s", "4.5s", "5.0s", "5.5s", "6.0s", "6.5s", "7.0s", "7.5s", "8.0s", "8.5s", "9.0s", "10.0s", "15s", "20s", "25s", "30s", "35s", "40s", "45s", "50s", "55s", "60s") _VFO_MODE = ("ALL", "BAND") @@ -944,8 +944,7 @@ class FT70Radio(yaesu_clone.YaesuCloneModeRadio): # MYCALL mycall = self._memobj.my_call - mycallstr = str(mycall.callsign).rstrip("\xFF") - + mycallstr = str(mycall.callsign).rstrip("\xFF") mycallentry = RadioSettingValueString(0, 10, mycallstr, False, charset=self._MYCALL_CHR_SET) rs = RadioSetting('mycall.callsign', 'MYCALL', mycallentry) rs.set_apply_callback(self.apply_mycall, mycall) diff --git a/chirp/ui/mainapp.py b/chirp/ui/mainapp.py index 4f8db4a..3265206 100644 --- a/chirp/ui/mainapp.py +++ b/chirp/ui/mainapp.py @@ -2051,9 +2051,18 @@ of file. except ImportError: pass + # for gtk3 + try: + import gi + gi.require_version("Gtk", "3.0") + from gi.repository import Gtk + macapp = Gtk.Application() + except ImportError: + pass + if macapp is None: LOG.error("No MacOS support") - return + return this_platform = platform.get_platform() icon = (this_platform.find_resource("chirp.png") or diff --git a/pylintrc b/pylintrc index b622882..ec0582e 100644 --- a/pylintrc +++ b/pylintrc @@ -80,7 +80,7 @@ ignore-docstrings=yes [FORMAT] # Maximum number of characters on a single line. -max-line-length=80 +max-line-length=120 # Maximum number of lines in a module max-module-lines=1000 -- cgit v1.2.3