summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-03-31 17:57:07 +0200
committerChristoph Berg <myon@debian.org>2020-03-31 17:57:07 +0200
commitc2bdd8f8d96bf5329672163cc0905a22589d26d3 (patch)
tree76ce2d78c98a958f97dfb6128fee9c529a2a55aa
parentb255867dd3e05fff714c5d3325c02596bf5854c8 (diff)
New upstream version 20200227+py3+20200213upstream/20200227+py3+20200213
-rw-r--r--.hg_archival.txt6
-rw-r--r--.hgignore18
-rw-r--r--.hgtags17
-rw-r--r--.pylintrc308
-rw-r--r--INSTALL52
-rw-r--r--MANIFEST.in8
-rw-r--r--PKG-INFO10
-rw-r--r--README.chirpc104
-rw-r--r--README.developers64
-rw-r--r--README.rpttool23
-rw-r--r--build/chirp.app/Contents/Info.plist26
-rwxr-xr-xbuild/chirp.app/Contents/MacOS/chirp19
-rw-r--r--build/chirp.app/Contents/PkgInfo1
-rw-r--r--build/chirp.app/Contents/Resources/.placeholder0
-rw-r--r--build/macos/make_pango.sh51
-rwxr-xr-xbuild/make_source_release.sh23
-rw-r--r--build/version1
-rw-r--r--chirp.xsd47
-rw-r--r--chirp/__init__.py2
-rw-r--r--chirp/bandplan.py2
-rw-r--r--chirp/bitwise.py189
-rw-r--r--chirp/bitwise_grammar.py5
-rw-r--r--chirp/chirp_common.py60
-rw-r--r--chirp/detect.py8
-rw-r--r--chirp/directory.py85
-rw-r--r--chirp/drivers/boblov_x3plus.py2
-rw-r--r--chirp/drivers/btech.py129
-rw-r--r--chirp/drivers/ft7800.py36
-rw-r--r--chirp/drivers/ft817.py75
-rw-r--r--chirp/drivers/ft857.py38
-rw-r--r--chirp/drivers/generic_csv.py37
-rw-r--r--chirp/drivers/generic_tpe.py5
-rw-r--r--chirp/drivers/generic_xml.py149
-rw-r--r--chirp/drivers/h777.py35
-rw-r--r--chirp/drivers/ic208.py12
-rw-r--r--chirp/drivers/ic2200.py2
-rw-r--r--chirp/drivers/ic2300.py2
-rw-r--r--chirp/drivers/ic2730.py4
-rw-r--r--chirp/drivers/ic2820.py2
-rw-r--r--chirp/drivers/ic9x.py14
-rw-r--r--chirp/drivers/ic9x_ll.py4
-rw-r--r--chirp/drivers/icf.py181
-rw-r--r--chirp/drivers/icp7.py4
-rw-r--r--chirp/drivers/icq7.py4
-rw-r--r--chirp/drivers/ict70.py8
-rw-r--r--chirp/drivers/ict7h.py4
-rw-r--r--chirp/drivers/ict8.py2
-rw-r--r--chirp/drivers/icw32.py6
-rw-r--r--chirp/drivers/icx8x.py3
-rw-r--r--chirp/drivers/icx8x_ll.py7
-rw-r--r--chirp/drivers/id31.py14
-rw-r--r--chirp/drivers/id51.py12
-rw-r--r--chirp/drivers/id51plus.py12
-rw-r--r--chirp/drivers/id880.py2
-rw-r--r--chirp/drivers/kenwood_hmk.py4
-rw-r--r--chirp/drivers/kenwood_itm.py2
-rw-r--r--chirp/drivers/kenwood_live.py15
-rw-r--r--chirp/drivers/repeaterbook.py8
-rw-r--r--chirp/drivers/th350.py69
-rw-r--r--chirp/drivers/tk8102.py60
-rw-r--r--chirp/drivers/uv5r.py107
-rw-r--r--chirp/drivers/uvb5.py57
-rw-r--r--chirp/drivers/vx2.py12
-rw-r--r--chirp/drivers/vx3.py16
-rw-r--r--chirp/drivers/vx7.py2
-rw-r--r--chirp/drivers/vx8.py7
-rw-r--r--chirp/drivers/yaesu_clone.py55
-rw-r--r--chirp/logger.py8
-rw-r--r--chirp/memmap.py86
-rw-r--r--chirp/platform.py28
-rw-r--r--chirp/pyPEG.py69
-rw-r--r--chirp/radioreference.py6
-rw-r--r--chirp/settings.py12
-rw-r--r--chirp/ui/bankedit.py2
-rw-r--r--chirp/ui/clone.py62
-rw-r--r--chirp/ui/common.py6
-rw-r--r--chirp/ui/compat.py82
-rw-r--r--chirp/ui/config.py10
-rw-r--r--chirp/ui/dstaredit.py14
-rw-r--r--chirp/ui/editorset.py28
-rw-r--r--chirp/ui/importdialog.py22
-rw-r--r--chirp/ui/inputdialog.py2
-rw-r--r--chirp/ui/mainapp.py173
-rw-r--r--chirp/ui/memdetail.py23
-rw-r--r--chirp/ui/memedit.py115
-rw-r--r--chirp/ui/miscwidgets.py171
-rw-r--r--chirp/ui/reporting.py2
-rw-r--r--chirp/ui/settingsedit.py19
-rw-r--r--chirp/ui/shiftdialog.py2
-rw-r--r--chirp/util.py53
-rw-r--r--chirp/wxui/__init__.py0
-rw-r--r--chirp/wxui/clone.py276
-rw-r--r--chirp/wxui/common.py272
-rw-r--r--chirp/wxui/developer.py364
-rw-r--r--chirp/wxui/main.py522
-rw-r--r--chirp/wxui/memedit.py601
-rw-r--r--chirp/wxui/settingsedit.py161
-rw-r--r--chirp/xml_ll.py256
-rw-r--r--chirp_banks.xsd8
-rw-r--r--chirp_memory.xsd121
-rwxr-xr-xchirpc403
-rwxr-xr-xchirpw30
-rwxr-xr-xchirpwx.py57
-rw-r--r--locale/Makefile28
-rwxr-xr-xlocale/check_parameters.py31
-rw-r--r--locale/de.po1081
-rw-r--r--locale/de/LC_MESSAGES/CHIRP.mobin17226 -> 0 bytes
-rw-r--r--locale/en_US.po955
-rw-r--r--locale/en_US/LC_MESSAGES/CHIRP.mobin4802 -> 0 bytes
-rw-r--r--locale/es_ES.po946
-rw-r--r--locale/es_ES/LC_MESSAGES/CHIRP.mobin15564 -> 0 bytes
-rw-r--r--locale/fr.po944
-rw-r--r--locale/fr/LC_MESSAGES/CHIRP.mobin15724 -> 0 bytes
-rw-r--r--locale/hu.po1216
-rw-r--r--locale/hu/LC_MESSAGES/CHIRP.mobin20248 -> 0 bytes
-rw-r--r--locale/it.po944
-rw-r--r--locale/it/LC_MESSAGES/CHIRP.mobin15243 -> 0 bytes
-rw-r--r--locale/nl.po945
-rw-r--r--locale/nl/LC_MESSAGES/CHIRP.mobin15633 -> 0 bytes
-rw-r--r--locale/pl.po987
-rw-r--r--locale/pl/LC_MESSAGES/CHIRP.mobin11138 -> 0 bytes
-rw-r--r--locale/pt_BR.po897
-rw-r--r--locale/pt_BR/LC_MESSAGES/CHIRP.mobin15187 -> 0 bytes
-rw-r--r--locale/ru.po907
-rw-r--r--locale/ru/LC_MESSAGES/CHIRP.mobin16689 -> 0 bytes
-rw-r--r--locale/uk_UA.po917
-rw-r--r--locale/uk_UA/LC_MESSAGES/CHIRP.mobin17917 -> 0 bytes
-rw-r--r--pylintrc249
-rw-r--r--requirements.txt4
-rw-r--r--run_all_tests.bat3
-rw-r--r--setup.py31
-rw-r--r--share/chirp.icnsbin0 -> 80528 bytes
-rw-r--r--share/chirp.svg224
-rw-r--r--share/contrib/chirp.rnc28
-rw-r--r--share/contrib/chirp.rng58
-rw-r--r--share/contrib/chirp_banks.rnc3
-rw-r--r--share/contrib/chirp_banks.rng11
-rw-r--r--share/contrib/chirp_memory.rnc64
-rw-r--r--share/contrib/chirp_memory.rng193
-rwxr-xr-xshare/make_supported.py178
-rw-r--r--test-requirements.txt4
-rw-r--r--tests/__init__.py151
-rw-r--r--tests/icom_clone_simulator.py195
-rw-r--r--tests/images/Alinco_DJ-G7EG.imgbin0 -> 108480 bytes
-rw-r--r--tests/images/Alinco_DJ175.imgbin0 -> 6896 bytes
-rw-r--r--tests/images/Alinco_DJ596.imgbin0 -> 4096 bytes
-rw-r--r--tests/images/Alinco_DR235T.imgbin0 -> 4096 bytes
-rw-r--r--tests/images/AnyTone_OBLTR-8R.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/AnyTone_TERMN-8R.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/BTECH_GMRS-50X1.imgbin0 -> 16384 bytes
-rw-r--r--tests/images/BTECH_GMRS-V1.imgbin0 -> 8200 bytes
-rw-r--r--tests/images/BTECH_MURS-V1.imgbin0 -> 8200 bytes
-rwxr-xr-xtests/images/BTECH_UV-2501+220.imgbin0 -> 16384 bytes
-rwxr-xr-xtests/images/BTECH_UV-25X2.imgbin0 -> 16384 bytes
-rwxr-xr-xtests/images/BTECH_UV-25X4.imgbin0 -> 16384 bytes
-rwxr-xr-xtests/images/BTECH_UV-5001.imgbin0 -> 16384 bytes
-rwxr-xr-xtests/images/BTECH_UV-50X2.imgbin0 -> 16384 bytes
-rw-r--r--tests/images/BTECH_UV-50X3.imgbin0 -> 32768 bytes
-rwxr-xr-xtests/images/BTECH_UV-5X3.imgbin0 -> 8206 bytes
-rw-r--r--tests/images/Baofeng_BF-888.imgbin0 -> 992 bytes
-rw-r--r--tests/images/Baofeng_BF-A58S.imgbin0 -> 8361 bytes
-rw-r--r--tests/images/Baofeng_BF-T1.imgbin0 -> 2048 bytes
-rw-r--r--tests/images/Baofeng_F-11.imgbin0 -> 6472 bytes
-rw-r--r--tests/images/Baofeng_UV-3R.imgbin0 -> 3648 bytes
-rw-r--r--tests/images/Baofeng_UV-5R.imgbin0 -> 6472 bytes
-rwxr-xr-xtests/images/Baofeng_UV-6R.imgbin0 -> 8200 bytes
-rw-r--r--tests/images/Baofeng_UV-B5.imgbin0 -> 4144 bytes
-rw-r--r--tests/images/Baojie_BJ-9900.imgbin0 -> 6385 bytes
-rw-r--r--tests/images/Boblov_X3Plus.imgbin0 -> 1008 bytes
-rwxr-xr-xtests/images/Feidaxin_FD-268A.imgbin0 -> 2048 bytes
-rwxr-xr-xtests/images/Feidaxin_FD-268B.imgbin0 -> 2048 bytes
-rwxr-xr-xtests/images/Feidaxin_FD-288B.imgbin0 -> 2048 bytes
-rw-r--r--tests/images/Generic_CSV.csv104
-rw-r--r--tests/images/Icom_IC-208H.imgbin0 -> 9728 bytes
-rw-r--r--tests/images/Icom_IC-2100H.imgbin0 -> 2016 bytes
-rw-r--r--tests/images/Icom_IC-2200H.imgbin0 -> 6848 bytes
-rw-r--r--tests/images/Icom_IC-2300H.imgbin0 -> 6304 bytes
-rw-r--r--tests/images/Icom_IC-2720H.imgbin0 -> 5152 bytes
-rw-r--r--tests/images/Icom_IC-2730A.imgbin0 -> 21312 bytes
-rw-r--r--tests/images/Icom_IC-2820H.imgbin0 -> 44224 bytes
-rwxr-xr-xtests/images/Icom_IC-P7.imgbin0 -> 29952 bytes
-rw-r--r--tests/images/Icom_IC-Q7A.imgbin0 -> 1984 bytes
-rw-r--r--tests/images/Icom_IC-T70.imgbin0 -> 6624 bytes
-rw-r--r--tests/images/Icom_IC-T7H.imgbin0 -> 944 bytes
-rw-r--r--tests/images/Icom_IC-T8A.imgbin0 -> 1968 bytes
-rw-r--r--tests/images/Icom_IC-V82_U82.imgbin0 -> 6464 bytes
-rw-r--r--tests/images/Icom_IC-W32A.imgbin0 -> 4064 bytes
-rw-r--r--tests/images/Icom_IC-W32E.imgbin0 -> 4065 bytes
-rw-r--r--tests/images/Icom_ID-31A.imgbin0 -> 87296 bytes
-rw-r--r--tests/images/Icom_ID-51.imgbin0 -> 129856 bytes
-rwxr-xr-xtests/images/Icom_ID-51_Plus.imgbin0 -> 129856 bytes
-rw-r--r--tests/images/Icom_ID-800H_v2.imgbin0 -> 14528 bytes
-rw-r--r--tests/images/Icom_ID-880H.imgbin0 -> 62976 bytes
-rw-r--r--tests/images/Jetstream_JT220M.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Jetstream_JT270M.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Jetstream_JT270MH.imgbin0 -> 8192 bytes
-rwxr-xr-xtests/images/KYD_IP-620.imgbin0 -> 8192 bytes
-rwxr-xr-xtests/images/KYD_NC-630A.imgbin0 -> 824 bytes
-rw-r--r--tests/images/Kenwood_HMK.hmk71
-rw-r--r--tests/images/Kenwood_TH-D72_clone_mode.imgbin0 -> 65536 bytes
-rwxr-xr-xtests/images/Kenwood_TK-272G.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Kenwood_TK-3180K2.imgbin0 -> 53681 bytes
-rwxr-xr-xtests/images/Kenwood_TK-760G.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Kenwood_TK-8102.imgbin0 -> 1040 bytes
-rw-r--r--tests/images/Kenwood_TK-8180.imgbin0 -> 53673 bytes
-rw-r--r--tests/images/Kenwood_TS-480_CloneMode.imgbin0 -> 3018 bytes
-rwxr-xr-xtests/images/LUITON_LT-725UV.imgbin0 -> 7176 bytes
-rw-r--r--tests/images/Leixen_VV-898.imgbin0 -> 8192 bytes
-rwxr-xr-xtests/images/Leixen_VV-898S.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Polmar_DB-50M.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Puxing_PX-2R.imgbin0 -> 4064 bytes
-rw-r--r--tests/images/Puxing_PX-777.imgbin0 -> 3168 bytes
-rw-r--r--tests/images/Puxing_PX-888K.imgbin0 -> 4096 bytes
-rwxr-xr-xtests/images/QYT_KT7900D.imgbin0 -> 16384 bytes
-rwxr-xr-xtests/images/QYT_KT8900D.imgbin0 -> 16384 bytes
-rw-r--r--tests/images/Radioddity_R2.imgbin0 -> 1181 bytes
-rwxr-xr-xtests/images/Radtel_T18.imgbin0 -> 1008 bytes
-rw-r--r--tests/images/Retevis_RT21.imgbin0 -> 1024 bytes
-rw-r--r--tests/images/Retevis_RT22.imgbin0 -> 1032 bytes
-rwxr-xr-xtests/images/Retevis_RT23.imgbin0 -> 4096 bytes
-rw-r--r--tests/images/Retevis_RT26.imgbin0 -> 1024 bytes
-rwxr-xr-xtests/images/TDXone_TD-Q8A.imgbin0 -> 8200 bytes
-rw-r--r--tests/images/TYT_TH-350.imgbin0 -> 4297 bytes
-rw-r--r--tests/images/TYT_TH-7800.imgbin0 -> 65296 bytes
-rw-r--r--tests/images/TYT_TH-9800.imgbin0 -> 65296 bytes
-rwxr-xr-xtests/images/TYT_TH-UV3R-25.imgbin0 -> 2864 bytes
-rw-r--r--tests/images/TYT_TH-UV3R.imgbin0 -> 2320 bytes
-rw-r--r--tests/images/TYT_TH-UV8000.imgbin0 -> 5040 bytes
-rw-r--r--tests/images/TYT_TH-UVF1.imgbin0 -> 4112 bytes
-rw-r--r--tests/images/TYT_TH9000_144.imgbin0 -> 16384 bytes
-rw-r--r--tests/images/Vertex_Standard_VXA-700.imgbin0 -> 4096 bytes
-rwxr-xr-xtests/images/WACCOM_MINI-8900.imgbin0 -> 16384 bytes
-rw-r--r--tests/images/Wouxun_KG-816.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Wouxun_KG-818.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Wouxun_KG-UV6.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Wouxun_KG-UV8D.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Wouxun_KG-UV8D_Plus.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Wouxun_KG-UV8E.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Wouxun_KG-UV9D_Plus.imgbin0 -> 32768 bytes
-rw-r--r--tests/images/Wouxun_KG-UVD1P.imgbin0 -> 8192 bytes
-rw-r--r--tests/images/Yaesu_FT-1500M.imgbin0 -> 4140 bytes
-rw-r--r--tests/images/Yaesu_FT-1802M.imgbin0 -> 8011 bytes
-rw-r--r--tests/images/Yaesu_FT-1D_R.imgbin0 -> 130507 bytes
-rw-r--r--tests/images/Yaesu_FT-25R.imgbin0 -> 8689 bytes
-rw-r--r--tests/images/Yaesu_FT-2800M.imgbin0 -> 7680 bytes
-rwxr-xr-xtests/images/Yaesu_FT-2900R_1900R.imgbin0 -> 8000 bytes
-rw-r--r--tests/images/Yaesu_FT-450D.imgbin0 -> 15024 bytes
-rw-r--r--tests/images/Yaesu_FT-4VR.imgbin0 -> 8697 bytes
-rw-r--r--tests/images/Yaesu_FT-4XE.imgbin0 -> 8697 bytes
-rw-r--r--tests/images/Yaesu_FT-4XR.imgbin0 -> 8689 bytes
-rwxr-xr-xtests/images/Yaesu_FT-50.imgbin0 -> 3723 bytes
-rw-r--r--tests/images/Yaesu_FT-60.imgbin0 -> 28617 bytes
-rw-r--r--tests/images/Yaesu_FT-65E.imgbin0 -> 8697 bytes
-rw-r--r--tests/images/Yaesu_FT-65R.imgbin0 -> 8693 bytes
-rw-r--r--tests/images/Yaesu_FT-70D.imgbin0 -> 65227 bytes
-rw-r--r--tests/images/Yaesu_FT-7100M.imgbin0 -> 7936 bytes
-rw-r--r--tests/images/Yaesu_FT-7800_7900.imgbin0 -> 31561 bytes
-rw-r--r--tests/images/Yaesu_FT-817.imgbin0 -> 6509 bytes
-rw-r--r--tests/images/Yaesu_FT-817ND.imgbin0 -> 6521 bytes
-rw-r--r--tests/images/Yaesu_FT-817ND_US.imgbin0 -> 6651 bytes
-rw-r--r--tests/images/Yaesu_FT-818.imgbin0 -> 6730 bytes
-rw-r--r--tests/images/Yaesu_FT-857_897.imgbin0 -> 7341 bytes
-rw-r--r--tests/images/Yaesu_FT-857_897_US.imgbin0 -> 7481 bytes
-rw-r--r--tests/images/Yaesu_FT-8800.imgbin0 -> 22217 bytes
-rw-r--r--tests/images/Yaesu_FT-8900.imgbin0 -> 14793 bytes
-rw-r--r--tests/images/Yaesu_FT2D_R.imgbin0 -> 130507 bytes
-rw-r--r--tests/images/Yaesu_FT3D_R.imgbin0 -> 130652 bytes
-rw-r--r--tests/images/Yaesu_FTM-3200D_R.imgbin0 -> 65227 bytes
-rw-r--r--tests/images/Yaesu_FTM-350.imgbin0 -> 65664 bytes
-rw-r--r--tests/images/Yaesu_VX-2.imgbin0 -> 32595 bytes
-rw-r--r--tests/images/Yaesu_VX-3.imgbin0 -> 32587 bytes
-rw-r--r--tests/images/Yaesu_VX-5.imgbin0 -> 8123 bytes
-rw-r--r--tests/images/Yaesu_VX-6.imgbin0 -> 32587 bytes
-rw-r--r--tests/images/Yaesu_VX-7.imgbin0 -> 16211 bytes
-rw-r--r--tests/images/Yaesu_VX-8DR.imgbin0 -> 65227 bytes
-rw-r--r--tests/images/Yaesu_VX-8GE.imgbin0 -> 65227 bytes
-rw-r--r--tests/images/Yaesu_VX-8R.imgbin0 -> 65227 bytes
-rwxr-xr-xtests/run_tests3
-rwxr-xr-xtests/run_tests.py1372
-rw-r--r--tests/test_drivers.py24
-rw-r--r--tests/unit/__init__.py0
-rw-r--r--tests/unit/base.py50
-rw-r--r--tests/unit/test_bitwise.py341
-rw-r--r--tests/unit/test_chirp_common.py415
-rw-r--r--tests/unit/test_directory.py69
-rw-r--r--tests/unit/test_icom_clone.py117
-rw-r--r--tests/unit/test_import_logic.py373
-rw-r--r--tests/unit/test_mappingmodel.py283
-rw-r--r--tests/unit/test_memedit_edits.py82
-rw-r--r--tests/unit/test_platform.py62
-rw-r--r--tests/unit/test_repeaterbook.py28
-rw-r--r--tests/unit/test_settings.py140
-rw-r--r--tests/unit/test_shiftdialog.py112
-rw-r--r--tests/unit/test_utils.py21
-rw-r--r--tests/unit/test_yaesu_clone.py41
-rw-r--r--tools/Makefile35
-rw-r--r--tools/bitdiff.py166
-rwxr-xr-xtools/check_for_bug.sh7
-rwxr-xr-xtools/checkpatch.sh72
-rw-r--r--tools/cpep8.blacklist3
-rw-r--r--tools/cpep8.exceptions10
-rw-r--r--tools/cpep8.manifest152
-rwxr-xr-xtools/cpep8.py137
-rwxr-xr-xtools/icomsio.sh95
-rw-r--r--tools/img2thd72.py127
-rw-r--r--tools/serialsniff.c440
-rw-r--r--tox.ini61
307 files changed, 22149 insertions, 1472 deletions
diff --git a/.hg_archival.txt b/.hg_archival.txt
new file mode 100644
index 0000000..c9100da
--- /dev/null
+++ b/.hg_archival.txt
@@ -0,0 +1,6 @@
+repo: 31cfb1a376fb354ec5e007193bde57cf2fb9f442
+node: 68534f20c1418ae8e4cc09f3ff468d0375ba843a
+branch: py3
+latesttag: release_0_4_0
+latesttagdistance: 996
+changessincelatesttag: 1144
diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000..74517dc
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,18 @@
+.*\~$
+.*\.pyc$
+.*\.orig$
+.*\.rej$
+dist
+build/bdist
+tools/cpep8.venv/
+tests/logs/
+logs/
+ignored/
+patch_queue/
+archived_builds/
+.tox/
+.*\.mo$
+.*\.pot$
+locale/.files
+MANIFEST
+.pytest_cache
diff --git a/.hgtags b/.hgtags
new file mode 100644
index 0000000..3192edf
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1,17 @@
+1428729c41b76d9e88023a8d9073bd947b1f64e4 release_0_1_1
+b6d7fbb63c67b431afb526c1c5682198884050e7 release_0_1_2
+1ed337baf81ee9e3a8cf80c095c79fda40f09000 release_0_1_3
+05dd19dd4db874ae9b94fd2ce4b81a9fe1a7b279 release_0_1_4
+5ab503b39a8609f428b4d44389507672090ddee6 release_0_1_5
+f31a4c4d772dfb9f0519586bfc683ac0c095e8a8 release_0_1_6
+61ed9897712816f2959ecda8135526e15ec7a046 release_0_1_7
+22c1e4d0f349c13e8a9e02cd2f0c4ba58033824e release_0_1_8
+c6f153e861ddca4b2568f83ef8d20c9ef3d6565e release_0_1_9
+03e812a988209069d5de9ff744a7c5d77bca4b94 release_0_1_10
+629e127c61ded83612f322d86b960c4fcbb5df7d release_0_1_11
+3dd33f5175ca34b06fd118a63c692297b5eb2550 release_0_1_12
+df5342f5ce3d3615dff38238d3112711c3628be6 release_0_2_0
+744ce08c8bea0868ce756e270043dbef59b5eb7f release_0_2_1
+30eeb96b77fb90ca88689cc2f76af379123e5e6e release_0_2_2
+e4901095dc40aa73cc9eb95105e7b32c756f53b0 release_0_3_0
+e91f09ca03d07a9f565291a60e8b84073298b8ac release_0_4_0
diff --git a/.pylintrc b/.pylintrc
new file mode 100644
index 0000000..8a8f0a3
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,308 @@
+# lint Python modules using external checkers.
+#
+# This is the main checker controling the other ones and the reports
+# generation. It is itself both a raw checker and an astng checker in order
+# to:
+# * handle message activation / deactivation at the module level
+# * handle some basic but necessary stats'data (number of classes, methods...)
+#
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add <file or directory> to the black list. It should be a base name, not a
+# path. You may set this option multiple times.
+ignore=dist
+ignore=icons
+ignore=.hg
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Set the cache size for astng objects.
+cache-size=500
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflicts with the
+# disable-checker option
+#enable-checker=
+
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
+disable-checker=SIMILARITIES
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+disable-msg=W0142,C0111
+
+
+[REPORTS]
+
+# set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+output-format=text
+
+# Include message's id in output
+include-ids=no
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells wether to display a full report or only the messages
+reports=yes
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note).You have access to the variables errors warning, statement which
+# respectivly contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (R0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (R0004).
+comment=no
+
+# Enable the report(s) with the given id(s).
+#enable-report=
+
+# Disable the report(s) with the given id(s).
+#disable-report=
+
+
+# checks for :
+# * doc strings
+# * modules / classes / functions / methods / arguments / variables name
+# * number of arguments, local variables, branchs, returns and statements in
+# functions, methods
+# * required module attributes
+# * dangerous default values as arguments
+# * redefinition of function / method / class
+# * uses of the global statement
+#
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+#no-docstring-rgx=__.*__
+no-docstring-rgx=.*
+
+# Regular expression which should only match correct module names
+module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct method names
+method-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct argument names
+argument-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct variable names
+variable-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,j,k,ex,Run,_,e
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=foo,bar,baz,toto,tutu,tata
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=map,filter,apply,input
+
+
+# try to find bugs in the code using type inference
+#
+[TYPECHECK]
+
+# Tells wether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# When zope mode is activated, consider the acquired-members option to ignore
+# access to some undefined attributes.
+zope=no
+
+# List of members which are usually get through zope's acquisition mecanism and
+# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
+acquired-members=REQUEST,acl_users,aq_parent
+
+
+# checks for
+# * unused variables / imports
+# * undefined variables
+# * redefinition of variable from builtins or from an outer scope
+# * use of variable before assigment
+#
+[VARIABLES]
+
+# Tells wether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching names used for dummy variables (i.e. not used).
+dummy-variables-rgx=_|dummy
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+# checks for sign of poor/misdesign:
+# * number of methods, attributes, local variables...
+# * size, complexity of functions, methods
+#
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+# checks for :
+# * methods without self as first argument
+# * overridden methods signature
+# * access only to existant members via self
+# * attributes not defined in the __init__ method
+# * supported interfaces implementation
+# * unreachable code
+#
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+
+# checks for
+# * external modules dependencies
+# * relative / wildcard imports
+# * cyclic imports
+# * uses of deprecated modules
+#
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report R0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report R0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report R0402 must
+# not be disabled)
+int-import-graph=
+
+
+# checks for:
+# * warning notes in the code like FIXME, XXX
+# * PEP 263: source code with non ascii character but no encoding declaration
+#
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
+
+
+# checks for :
+# * unauthorized constructions
+# * strict indentation
+# * line length
+# * use of <> instead of !=
+#
+[FORMAT]
+
+# Maximum number of characters on a single line.
+max-line-length=80
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+# tab).
+indent-string=' '
+
+
+# checks for similarities and duplicated code. This computation may be
+# memory / CPU intensive, so you should disable it if you experiments some
+# problems.
+#
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..a55c4d4
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,52 @@
+This file describes the installation of Chirp without package management
+on Linux and other Unix-like operating systems. This sort of thing may
+be your only choice because 1) a package has not yet been made for your
+OS or distribution, 2) the packaged version is obsolete, or 3) you want
+to try a daily build.
+
+
+For Debian, Ubuntu, and related systems, the following packages are required:
+python
+python-gtk2
+python-libxml2
+python-libxslt1
+python-serial
+python-suds (optional)
+python-support
+
+For Redhat, Fedora, CentOS and related systems, the following packages
+are required: (This list is incomplete. Please submit corrections.)
+python
+pygtk2
+libxml2-python
+python-libxslt
+
+For openSUSE, the following packages are required:
+python
+python-gtk
+python-pyserial
+python-libxml2
+libxslt-python
+python-suds-jurko
+
+Once these packages are installed, you can run Chirp directly from the
+distribution directory by typing "./chirpw". If you want to install it
+properly, type this:
+
+ sudo python setup.py install --record files.txt
+
+This will install the package and create a list of files that were
+added to your system. If you want to deinstall Chirp, type this:
+
+ sudo xargs -0 rm -rf < files.txt
+
+This will cause rm(1) to take its list of arguments from the file named
+"files.txt" and remove those files from the system. If you forgot to
+create "files.txt", you can simply reinstall the way it is shown here
+and continue on your way.
+
+Note: This will not uninstall directories created by the installation of
+Chirp. Presence of these empty directories shouldn't be a problem, but
+if they are, it's easy to go through the files.txt file, identify them,
+and remove them.
+
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..77a5f3a
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,8 @@
+include *.xsd
+include share/*.desktop
+include share/chirp.png
+include share/chirp.ico
+include share/*.1
+include stock_configs/*
+include COPYING
+include *requirements.txt
diff --git a/PKG-INFO b/PKG-INFO
deleted file mode 100644
index 6558d6f..0000000
--- a/PKG-INFO
+++ /dev/null
@@ -1,10 +0,0 @@
-Metadata-Version: 1.0
-Name: chirp
-Version: daily-20200213
-Summary: UNKNOWN
-Home-page: UNKNOWN
-Author: UNKNOWN
-Author-email: UNKNOWN
-License: UNKNOWN
-Description: UNKNOWN
-Platform: UNKNOWN
diff --git a/README.chirpc b/README.chirpc
new file mode 100644
index 0000000..a367fac
--- /dev/null
+++ b/README.chirpc
@@ -0,0 +1,104 @@
+chirpc: CHIRP Command-line interface
+====================================
+
+CHIRP provides a CLI tool (chirpc) to interact with your radio and
+memory image files. It has been designed to be used from programs or
+scripts written in other languages, providing facilities for automating
+queries and transformations.
+
+
+WARNING: All modifications are made in-place, overwriting the original
+file with new contents. Be sure to make a backup copy of any files
+that you want unchanged.
+
+
+========
+Cookbook
+========
+
+This section provides copy-and-paste recipies for accomplishing some
+tasks using the CLI.
+
+
+List Radios
+-----------
+
+To see the list of supported <radio> names that can be passed to the
+-r/--radio option:
+
+ chirpc --list-radios
+
+
+Download from Radio
+-------------------
+
+To download a new image from your radio:
+
+ chirpc -r <radio> --serial=<port> --mmap=<file> --download-mmap
+
+This will connect to the specified <radio> on <port>, saving the image
+obtained from the radio into the specified <file>.
+
+
+Upload to Radio
+---------------
+
+To upload an existing image to your radio:
+
+ chirpc -r <radio> --serial=<port> --mmap=<file> --upload-mmap
+
+This will connect to the specified <radio> on <port>, loading the image
+in the specified <file> onto the radio.
+
+
+List Settings
+-------------
+
+For radios that support settings, you can list the current settings
+in a saved image:
+
+ chirpc --mmap=<file> --list-settings
+
+
+Show Memory Channels
+--------------------
+
+You can list all current memory channels in a saved image:
+
+ chirpc --mmap=<file> --list-mem
+
+That command only lists the currently programmed channels. To see the
+complete list (including empty channels), add '--verbose'.
+
+To view only a single channel, use the --get-mem option:
+
+ chirpc --mmap=<file> --get-mem <channel>
+
+
+Set a Memory Channel
+--------------------
+
+ chirpc --mmap=<file> --set-mem-name=<name> ... <channel>
+
+See the --help text for a complete list of options that can be used
+to configure the channel. Any settings that are not configured using
+a command option will be left unchanged.
+
+
+Clearing a Memory Channel
+-------------------------
+
+You can clear a memory channel, discarding all settings:
+
+ chirpc --mmap=<file> --clear-mem <channel>
+
+
+Copying a Memory Channel
+------------------------
+
+You can copy a memory channel:
+
+ chirpc --mmap=<file> --copy-mem <source_channel> <destination_channel>
+
+Note: The contents of <destination_channel> will be overwritten with
+the contents from <source_channel>
diff --git a/README.developers b/README.developers
new file mode 100644
index 0000000..e784b2a
--- /dev/null
+++ b/README.developers
@@ -0,0 +1,64 @@
+This file describes some features in the Chirp Developer's Functions
+that allow some customization of their behavior, but are only
+accessible through editing the chirp.config file before starting
+Chirp, and are not accessible through the GUI.
+
+The Developer Functions are enabled in the GUI by checking the box
+in the "Help" tab. They enable the Image Browser tab in the left
+sidebar, several tools under the View -> Developer tab, and some others.
+
+These directives are similar to other chirp.config entries in syntax.
+They reside in the [developer] section in chirp.config.
+This section, and all the directives, are not required to be present;
+all the options have defaults.
+
+Here is an example [developer] section listing all the directives,
+followed by an explanation of each directive:
+
+===================================
+[developer]
+diff_fontsize = 16
+browser_fontsize = 13
+hexdump_addrfmt = %(addr)04i x%(addr)04X
+
+===================================
+browser_fontsize = <integer>
+This specifies the fontsize used in the file browser, invoked by selecting
+the "Browser" tab in the left sidebar, which is visible when the Developer
+tools are enabled.
+
+The default size is 10. Values less than 4, greater than 144, or not
+recognized as an integer will result in a log message and the default
+size will be used.
+
+========
+diff_fontize = <integer>
+This specifies the fontsize used in the hex dump/diff display which is
+invoked by selecting View -> Developer -> Diff tabs.
+
+The default size is 11. Values less than 4, greater than 144, or not
+recognized as an integer will result in a log message and the default
+size will be used.
+
+========
+hexdump_addrfmt = <python format specification string>
+This specifies the format of the address printed during some hexdump
+operations. The default is %(addr)03i which prints the byte offset
+of the first byte of each line in decimal, producing lines such as
+ 064: 00 00 00 ...
+
+Any of the variables in local scope of chirp/util.py::hexdump() are
+valid for substitution, including block and block_size. Any may
+be used more than once. The example above, %(addr)04i x%(addr)04X
+produces lines such as
+ 0064 x0040: 00 00 00 ...
+
+0x%(addr)04x specifies lower case hex, and wwould produce lines such as
+ 0x0040: 00 00 00 ...
+
+Exceptions that have been observed in testing formats which are
+invalid in this context are caught, and the default format is used.
+
+========
+
+
diff --git a/README.rpttool b/README.rpttool
new file mode 100644
index 0000000..9968348
--- /dev/null
+++ b/README.rpttool
@@ -0,0 +1,23 @@
+ *** KK7DS ID-RP* Frequency Tool ***
+
+This is a simple tool that allows setting of the frequency parameters
+on ICOM D-STAR Repeaters. It has been tested on the following
+modules:
+
+ - ID-RP2000V and ID-RP4000V
+ - ID-RP2D (the ID-RP2V is expected to work as well)
+
+To run the tool, connect one of the repeater's SERVICE ports to a USB
+port on this machine and then run the tool as root:
+
+ # ./rpttool
+
+WARNING: Do not connect or try to program the ID-RP2C controller
+module. This tool should be safe to use, but no guarantees are made.
+The author believes that the ICOM devices are smart enough to prevent
+bricking, but you're on your own if anything happens.
+
+If you have any other devices connected that are using an FTDI
+USB-to-Serial device, they must be disconnected prior to running this
+tool. The FTDI driver module will be re-loaded with a special
+parameter to allow it to recognize the ICOM device.
diff --git a/build/chirp.app/Contents/Info.plist b/build/chirp.app/Contents/Info.plist
new file mode 100644
index 0000000..673eeeb
--- /dev/null
+++ b/build/chirp.app/Contents/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>chirp</string>
+ <key>CFBundleIconFile</key>
+ <string>Chirp</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.danplanet.chirp</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>chirp</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+ <key>LSHasLocalizedDisplayName</key>
+ <false/>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.5</string>
+</dict>
+</plist>
diff --git a/build/chirp.app/Contents/MacOS/chirp b/build/chirp.app/Contents/MacOS/chirp
new file mode 100755
index 0000000..d0ff86e
--- /dev/null
+++ b/build/chirp.app/Contents/MacOS/chirp
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+LOCATION=$(dirname "${BASH_SOURCE}")
+
+PYTHON=/opt/kk7ds/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
+
+not_translocated () {
+ security translocate-status-check "${LOCATION}" 2>&1 | grep -q -e NOT -e unknown -e "not found"
+}
+
+if [ ! -x $PYTHON ]; then
+ PYTHON=/opt/kk7ds/bin/python2.7
+elif not_translocated; then
+ ln -s $PYTHON "${LOCATION}/../CHIRP"
+ PYTHON=${LOCATION}/../CHIRP
+ export PYTHONPATH=/opt/kk7ds/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
+fi
+
+exec "$PYTHON" "${LOCATION}/../Resources/chirp/chirpw"
diff --git a/build/chirp.app/Contents/PkgInfo b/build/chirp.app/Contents/PkgInfo
new file mode 100644
index 0000000..bd04210
--- /dev/null
+++ b/build/chirp.app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPL???? \ No newline at end of file
diff --git a/build/chirp.app/Contents/Resources/.placeholder b/build/chirp.app/Contents/Resources/.placeholder
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/build/chirp.app/Contents/Resources/.placeholder
diff --git a/build/macos/make_pango.sh b/build/macos/make_pango.sh
new file mode 100644
index 0000000..57d3429
--- /dev/null
+++ b/build/macos/make_pango.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+
+make_pango_modules() {
+ local src=$1
+ local dst=$2
+ local sf=${src}/etc/pango/pango.modules
+ local df=${dst}/etc/pango/pango.modules
+
+ cat $sf | sed 's/\/opt\/.*\/lib/..\/Resources/' > $df
+}
+
+make_pango_rc() {
+ local src=$1
+ local dst=$2
+ local sf=${src}/etc/pango/pangorc
+ local df=${dst}/etc/pango/pangorc
+
+ cat $sf | sed 's/\/opt\/.*\/etc/.\/etc/' > $df
+}
+
+make_pangox_aliases() {
+ local src=$1
+ local dst=$2
+
+ cp ${src}/etc/pango/pangox.aliases ${dst}/etc/pango
+}
+
+usage() {
+ echo 'Usage: make_pango.sh [PATH_TO_MACPORTS] [PATH_TO_APP]'
+ echo 'Example:'
+ echo ' make_pango.sh /opt/local dist/d-rats.app'
+}
+
+if [ -z "$1" ]; then
+ usage
+ exit 1
+fi
+
+if [ -z "$2" ]; then
+ usage
+ exit 1
+fi
+
+base=$1
+app="$2/Contents/Resources"
+
+mkdir -p ${app}/etc/pango
+
+make_pango_modules $base $app
+make_pango_rc $base $app
+make_pangox_aliases $base $app
diff --git a/build/make_source_release.sh b/build/make_source_release.sh
new file mode 100755
index 0000000..2a5af86
--- /dev/null
+++ b/build/make_source_release.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+VERSION=$(cat build/version)
+INCLUDE="COPYING"
+TMP=$(mktemp -d)
+EXCLUDE=""
+
+sed -i 's/^CHIRP_VERSION.*$/CHIRP_VERSION=\"'$VERSION'\"/' chirp/__init__.py
+
+RELDIR=chirp-${VERSION}
+
+DST="${TMP}/${RELDIR}"
+
+mkdir -p $DST
+
+cp -rav --parents chirp/*.py chirp/drivers/*.py csvdump/*.py chirp/ui/* $DST
+cp -av *.py ${DST}
+
+cp -rav $INCLUDE ${DST}
+
+(cd $TMP && tar czf - $RELDIR) > ${RELDIR}.tar.gz
+
+rm -Rf ${TMP}/${RELDIR}
diff --git a/build/version b/build/version
new file mode 100644
index 0000000..8508cef
--- /dev/null
+++ b/build/version
@@ -0,0 +1 @@
+0.3.0dev
diff --git a/chirp.xsd b/chirp.xsd
deleted file mode 100644
index ff0d93c..0000000
--- a/chirp.xsd
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
-
- CHIRP XML Schema
- Copyright 2008 Dan Smith <dsmith@danplanet.com>
-
- -->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:include schemaLocation="chirp_memory.xsd"/>
- <xsd:include schemaLocation="chirp_banks.xsd"/>
-
- <xsd:element name="radio" type="radioType"/>
-
- <xsd:complexType name="radioType">
- <xsd:sequence>
- <xsd:element name="comment" type="xsd:string"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="memories" type="memoryList"
- minOccurs="1" maxOccurs="1"/>
- <xsd:element name="banks" type="bankList"
- minOccurs="1" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="chirpSchemaVersionType"/>
- </xsd:complexType>
-
- <xsd:complexType name="memoryList">
- <xsd:sequence>
- <xsd:element name="memory" type="memoryType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="bankList">
- <xsd:sequence>
- <xsd:element name="bank" type="bankType"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name="chirpSchemaVersionType">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[0-9][0-9]*.[0-9][0-9]*.[0-9]{1,4}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
diff --git a/chirp/__init__.py b/chirp/__init__.py
index 7c35bda..7b48821 100644
--- a/chirp/__init__.py
+++ b/chirp/__init__.py
@@ -17,7 +17,7 @@ import os
import sys
from glob import glob
-CHIRP_VERSION="daily-20200213"
+CHIRP_VERSION = "0.3.0dev"
module_dir = os.path.dirname(sys.modules["chirp"].__file__)
__all__ = []
diff --git a/chirp/bandplan.py b/chirp/bandplan.py
index 97f2425..19d70a3 100644
--- a/chirp/bandplan.py
+++ b/chirp/bandplan.py
@@ -34,7 +34,7 @@ class Band(object):
for tone in tones:
assert tone in chirp_common.TONES, (
"tone %s not one of %s" % (tone, chirp_common.TONES))
- except AssertionError, e:
+ except AssertionError as e:
raise ValueError("%s %s: %s" % (name, limits, e))
self.name = name
diff --git a/chirp/bitwise.py b/chirp/bitwise.py
index 39efe8f..1559162 100644
--- a/chirp/bitwise.py
+++ b/chirp/bitwise.py
@@ -61,6 +61,9 @@ import struct
import os
import logging
+import six
+from builtins import bytes
+
from chirp import bitwise_grammar
from chirp.memmap import MemoryMap
@@ -72,6 +75,57 @@ class ParseError(Exception):
pass
+def byte_to_int(b):
+ if six.PY3 or isinstance(b, int):
+ return b
+ else:
+ return ord(b)
+
+
+def int_to_byte(i):
+ if six.PY3:
+ return bytes([i])
+ else:
+ return chr(i)
+
+
+def string_straight_encode(string):
+ """str -> bytes"""
+ # So, there are a lot of py2-thinking chirp drivers that
+ # will do something like this:
+ #
+ # memobj.name = 'foo\xff'
+ #
+ # because they need the string to be stored in radio memory
+ # with a 0xFF byte terminating the string. If they do that in
+ # py3 we will get the unicode equivalent, which is a non-ASCII
+ # character. Conventional unicode wisdom would tell us we need
+ # to encode() the string to get UTF-8 bytes, but that's not
+ # what we want here (the radio doesn't support UTF-8 and we need
+ # specific binary values in memory). Ideally we would have
+ # written all of chirp with bytes() for these values, but alas.
+ # We can get the intended string here by doing bytes([ord(char)]).
+ return bytes(b''.join(int_to_byte(ord(b)) for b in string))
+
+
+def string_straight_decode(string):
+ """bytes -> str"""
+ # Normally, we would want to decode bytes() to str() for py3.
+ # However...chirp drivers are currently using strings with
+ # hex escapes for setting binary byte values in memories.
+ # Technically, this is char, which is a little more like bytes()
+ # in py3, but until every driver has converted its strings to
+ # bytes(), this is massively simpler. Since set_value() is
+ # doing the inverse, we can do this here. If something sets
+ # a char to '\xFF' it will arrive below as the unicode character,
+ # and be converted to the integer/bytes value. When it is read out
+ # here, we will return that same unicode character and the driver
+ # will detect '\xFF' properly.
+ # FIXMEPY3: Remove this and the hack below when drivers convert to
+ # bytestrings.
+ return ''.join(chr(byte_to_int(b)) for b in string)
+
+
def format_binary(nbits, value, pad=8):
s = ""
for i in range(0, nbits):
@@ -81,8 +135,8 @@ def format_binary(nbits, value, pad=8):
def bits_between(start, end):
- bits = (1 << (end - start)) - 1
- return bits << start
+ bits = (1 << (int(end) - int(start))) - 1
+ return bits << int(start)
def pp(structure, level=0):
@@ -91,12 +145,12 @@ def pp(structure, level=0):
pp(i, level+2)
elif isinstance(i, tuple):
if isinstance(i[1], str):
- print "%s%s: %s" % (" " * level, i[0], i[1])
+ print("%s%s: %s" % (" " * level, i[0], i[1]))
else:
- print "%s%s:" % (" " * level, i[0])
+ print("%s%s:" % (" " * level, i[0]))
pp(i, level+2)
elif isinstance(i, str):
- print "%s%s" % (" " * level, i)
+ print("%s%s" % (" " * level, i))
def array_copy(dst, src):
@@ -120,7 +174,7 @@ def bcd_to_int(bcd_array):
def int_to_bcd(bcd_array, value):
"""Convert an int like 1234 into bcdDataElements like "\x12\x34" """
- for i in reversed(range(0, len(bcd_array))):
+ for i in reversed(list(range(0, len(bcd_array)))):
bcd_array[i].set_value(value % 100)
value /= 100
@@ -140,7 +194,7 @@ class DataElement:
def __init__(self, data, offset, count=1):
self._data = data
- self._offset = offset
+ self._offset = int(offset)
self._count = count
def size(self):
@@ -159,10 +213,16 @@ class DataElement:
def set_value(self, value):
raise Exception("Not implemented for %s" % self.__class__)
- def get_raw(self):
- return self._data[self._offset:self._offset+self._size]
+ def get_raw(self, asbytes=False):
+ raw = self._data[self._offset:self._offset+self._size]
+ if asbytes:
+ return bytes(raw)
+ else:
+ return string_straight_decode(raw)
def set_raw(self, data):
+ if isinstance(data, str):
+ data = string_straight_encode(data)
self._data[self._offset] = data[:self._size]
def __getattr__(self, name):
@@ -198,21 +258,32 @@ class arrayDataElement(DataElement):
def get_value(self):
return list(self.__items)
- def get_raw(self):
- return "".join([item.get_raw() for item in self.__items])
+ def get_raw(self, asbytes=False):
+ raw = [item.get_raw(asbytes=asbytes) for item in self.__items]
+ if asbytes:
+ return bytes(b''.join(raw))
+ else:
+ return "".join(raw)
def __setitem__(self, index, val):
self.__items[index].set_value(val)
def __getitem__(self, index):
- return self.__items[index]
+ if isinstance(index, slice):
+ return self.__items[int(index.start):int(index.stop)]
+ else:
+ return self.__items[int(index)]
def __len__(self):
return len(self.__items)
def __str__(self):
if isinstance(self.__items[0], charDataElement):
- return "".join([x.get_value() for x in self.__items])
+ # NOTE: All the values should be strings coming out of py3.
+ # and on py2 they could be a mix of unicode and str, the latter
+ # for non-ASCII values. On py2 we can just coerce all of these
+ # types to a string for compatbility.
+ return "".join([str(x.get_value()) for x in self.__items])
else:
return str(self.__items)
@@ -244,8 +315,8 @@ class arrayDataElement(DataElement):
def __set_value_char(self, value):
if len(value) != len(self.__items):
- raise ValueError("String expects exactly %i characters" %
- len(self.__items))
+ raise ValueError("String expects exactly %i characters, not %i" % (
+ len(self.__items), len(value)))
for i in range(0, len(self.__items)):
self.__items[i].set_value(value[i])
@@ -255,7 +326,7 @@ class arrayDataElement(DataElement):
elif isinstance(self.__items[0], lbcdDataElement):
self.__set_value_lbcd(int(value))
elif isinstance(self.__items[0], charDataElement):
- self.__set_value_char(str(value))
+ self.__set_value_char(value)
elif len(value) != len(self.__items):
raise ValueError("Array cardinality mismatch")
else:
@@ -294,6 +365,9 @@ class intDataElement(DataElement):
def __int__(self):
return self.get_value()
+ def __nonzero__(self):
+ return int(self) != 0
+
def __invert__(self):
return ~self.get_value()
@@ -309,9 +383,15 @@ class intDataElement(DataElement):
def __mul__(self, val):
return self.get_value() * val
+ def __truediv__(self, val):
+ return self.get_value() / val
+
def __div__(self, val):
return self.get_value() / val
+ def __floordiv__(self, val):
+ return self.get_value() // val
+
def __add__(self, val):
return self.get_value() + val
@@ -410,7 +490,7 @@ class intDataElement(DataElement):
def __ge__(self, val):
return self.get_value() >= val
- def __nonzero__(self):
+ def __bool__(self):
return self.get_value() != 0
@@ -445,8 +525,8 @@ class u24DataElement(intDataElement):
_endianess = ">"
def _get_value(self, data):
- pre = self._endianess == ">" and "\x00" or ""
- post = self._endianess == "<" and "\x00" or ""
+ pre = self._endianess == ">" and b"\x00" or b""
+ post = self._endianess == "<" and b"\x00" or b""
return struct.unpack(self._endianess + "I", pre+data+post)[0]
def set_value(self, value):
@@ -556,10 +636,15 @@ class charDataElement(DataElement):
return ord(self.get_value())
def _get_value(self, data):
- return data
+ return string_straight_decode(data)
def set_value(self, value):
- self._data[self._offset] = str(value)
+ if isinstance(value, int):
+ # This is the case if bytes() are passed in to arrayDataElement
+ # to set a string
+ self._data[self._offset] = value
+ else:
+ self._data[self._offset] = string_straight_encode(value)
class bcdDataElement(DataElement):
@@ -580,7 +665,7 @@ class bcdDataElement(DataElement):
if isinstance(data, int):
self._data[self._offset] = data & 0xFF
elif isinstance(data, str):
- self._data[self._offset] = data[0]
+ self._data[self._offset] = string_straight_encode(data[0])
else:
raise TypeError("Unable to set bcdDataElement from type %s" %
type(data))
@@ -614,7 +699,7 @@ class bitDataElement(intDataElement):
def get_value(self):
data = self._subgen(self._data, self._offset).get_value()
mask = bits_between(self._shift-self._nbits, self._shift)
- val = (data & mask) >> (self._shift - self._nbits)
+ val = (data & mask) >> int(self._shift - self._nbits)
return val
def set_value(self, value):
@@ -623,7 +708,7 @@ class bitDataElement(intDataElement):
data = self._subgen(self._data, self._offset).get_value()
data &= ~mask
- value = ((int(value) << (self._shift-self._nbits)) & mask) | data
+ value = ((int(value) << int(self._shift-self._nbits)) & mask) | data
self._subgen(self._data, self._offset).set_value(value)
@@ -647,7 +732,7 @@ class structDataElement(DataElement):
self._generators = {}
self._keys = []
self._count = 1
- if "name" in kwargs.keys():
+ if "name" in list(kwargs.keys()):
self._name = kwargs["name"]
del kwargs["name"]
else:
@@ -657,7 +742,7 @@ class structDataElement(DataElement):
def _value(self, data, generators):
result = {}
- for name, gen in generators.items():
+ for name, gen in list(generators.items()):
result[name] = gen.get_value(data)
return result
@@ -695,7 +780,7 @@ class structDataElement(DataElement):
def size(self):
size = 0
- for name, gen in self._generators.items():
+ for name, gen in list(self._generators.items()):
if not isinstance(gen, list):
gen = [gen]
@@ -705,17 +790,23 @@ class structDataElement(DataElement):
size += el.size()
return size
- def get_raw(self):
- size = self.size() / 8
- return self._data[self._offset:self._offset+size]
+ def get_raw(self, asbytes=False):
+ size = self.size() // 8
+ raw = self._data[self._offset:self._offset+size]
+ if asbytes:
+ return bytes(raw)
+ else:
+ return string_straight_decode(raw)
def set_raw(self, buffer):
if len(buffer) != (self.size() / 8):
raise ValueError("Struct size mismatch during set_raw()")
+ if isinstance(buffer, str):
+ buffer = string_straight_encode(buffer)
self._data[self._offset] = buffer
def __iter__(self):
- for item in self._generators.values():
+ for item in list(self._generators.values()):
yield item
def items(self):
@@ -745,6 +836,10 @@ class Processor:
}
def __init__(self, data, offset):
+ if hasattr(data, 'get_byte_compatible'):
+ # bitwise uses the byte-compatible interface of MemoryMap,
+ # if that is what was passed in
+ data = data.get_byte_compatible()
self._data = data
self._offset = offset
self._obj = None
@@ -908,14 +1003,14 @@ struct {
data = "\xab\x7F\x81abc\x12\x34"
tree = parse(defn, data)
- print repr(tree)
+ print(repr(tree))
- print "Foo %i" % tree.mystruct.foo
- print "Highbit: %i SixZeros: %i: Lowbit: %i" % (tree.mystruct.highbit,
+ print("Foo %i" % tree.mystruct.foo)
+ print("Highbit: %i SixZeros: %i: Lowbit: %i" % (tree.mystruct.highbit,
tree.mystruct.sixzeros,
- tree.mystruct.lowbit)
- print "String: %s" % tree.mystruct.string
- print "Fourdigits: %i" % tree.mystruct.fourdigits
+ tree.mystruct.lowbit))
+ print("String: %s" % tree.mystruct.string)
+ print("Fourdigits: %i" % tree.mystruct.fourdigits)
import sys
sys.exit(0)
@@ -947,26 +1042,26 @@ struct {
# Mess with it a little
p = Processor(data, 0)
obj = p.parse(ast)
- print "Object: %s" % obj
- print obj["foo"][0]["bcdL"]
- print obj["tail"]
- print obj["foo"][0]["bar"]
+ print("Object: %s" % obj)
+ print(obj["foo"][0]["bcdL"])
+ print(obj["tail"])
+ print(obj["foo"][0]["bar"])
obj["foo"][0]["bar"].set_value(255 << 8)
obj["foo"][0]["twobit"].set_value(0)
obj["foo"][0]["onebit"].set_value(1)
- print "%i" % int(obj["foo"][0]["bar"])
+ print("%i" % int(obj["foo"][0]["bar"]))
for i in obj["foo"][0]["array"]:
- print int(i)
+ print(int(i))
obj["foo"][0]["array"][1].set_value(255)
for i in obj["foo"][0]["bcdL"]:
- print i.get_value()
+ print(i.get_value())
int_to_bcd(obj["foo"][0]["bcdL"], 1234)
- print bcd_to_int(obj["foo"][0]["bcdL"])
+ print(bcd_to_int(obj["foo"][0]["bcdL"]))
set_string(obj["foo"][0]["str"], "xyz")
- print get_string(obj["foo"][0]["str"])
+ print(get_string(obj["foo"][0]["str"]))
- print repr(data.get_packed())
+ print(repr(data.get_packed()))
diff --git a/chirp/bitwise_grammar.py b/chirp/bitwise_grammar.py
index b6eb20c..c61eda2 100644
--- a/chirp/bitwise_grammar.py
+++ b/chirp/bitwise_grammar.py
@@ -104,7 +104,7 @@ def parse(data):
if '//' in line:
lines[index] = line[:line.index('//')]
- class FakeFileInput:
+ class FakeFileInput(object):
"""Simulate line-by-line file reading from @data"""
line = -1
@@ -121,6 +121,9 @@ def parse(data):
return self
def next(self):
+ return self.__next__()
+
+ def __next__(self):
self.line += 1
try:
# Note, FileInput objects keep the newlines
diff --git a/chirp/chirp_common.py b/chirp/chirp_common.py
index 4f64865..dd3cf7a 100644
--- a/chirp/chirp_common.py
+++ b/chirp/chirp_common.py
@@ -13,11 +13,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from builtins import bytes
+from future import standard_library
+
import base64
import json
import logging
import math
import sys
+
from chirp import errors, memmap, CHIRP_VERSION
LOG = logging.getLogger(__name__)
@@ -194,7 +198,7 @@ class PowerLevel:
def __gt__(self, val):
return int(self) > int(val)
- def __nonzero__(self):
+ def __bool__(self):
return int(self) != 0
def __repr__(self):
@@ -315,14 +319,14 @@ class Memory:
def dupe(self):
"""Return a deep copy of @self"""
mem = self.__class__()
- for k, v in self.__dict__.items():
+ for k, v in list(self.__dict__.items()):
mem.__dict__[k] = v
return mem
def clone(self, source):
"""Absorb all of the properties of @source"""
- for k, v in source.__dict__.items():
+ for k, v in list(source.__dict__.items()):
self.__dict__[k] = v
CSV_FORMAT = ["Location", "Name", "Frequency",
@@ -744,7 +748,7 @@ class RadioFeatures:
if name.startswith("_"):
self.__dict__[name] = val
return
- elif name not in self._valid_map.keys():
+ elif name not in list(self._valid_map.keys()):
raise ValueError("No such attribute `%s'" % name)
if type(self._valid_map[name]) == tuple:
@@ -874,7 +878,7 @@ class RadioFeatures:
def is_a_feature(self, name):
"""Returns True if @name is a valid feature flag name"""
- return name in self._valid_map.keys()
+ return name in list(self._valid_map.keys())
def __getitem__(self, name):
return self.__dict__[name]
@@ -976,7 +980,7 @@ class RadioFeatures:
msg = ValidationError("Frequency requires %.2fkHz step" %
required_step(mem.freq))
msgs.append(msg)
- except errors.InvalidDataError, e:
+ except errors.InvalidDataError as e:
msgs.append(str(e))
if self.valid_characters:
@@ -1016,6 +1020,7 @@ class Radio(Alias):
BAUD_RATE = 9600
HARDWARE_FLOW = False
ALIASES = []
+ NEEDS_COMPAT_SERIAL = True
def status_fn(self, status):
"""Deliver @status to the UI"""
@@ -1115,7 +1120,7 @@ class Radio(Alias):
class FileBackedRadio(Radio):
"""A file-backed radio stores its data in a file"""
FILE_EXTENSION = "img"
- MAGIC = '\x00\xffchirp\xeeimg\x00\x01'
+ MAGIC = b'\x00\xffchirp\xeeimg\x00\x01'
def __init__(self, *args, **kwargs):
Radio.__init__(self, *args, **kwargs)
@@ -1146,7 +1151,7 @@ class FileBackedRadio(Radio):
raw_metadata = raw_data[idx + len(cls.MAGIC):]
metadata = {}
try:
- metadata = json.loads(base64.b64decode(raw_metadata))
+ metadata = json.loads(base64.b64decode(raw_metadata).decode())
except ValueError as e:
LOG.error('Failed to parse decoded metadata blob: %s' % e)
except TypeError as e:
@@ -1165,11 +1170,11 @@ class FileBackedRadio(Radio):
'model': cls.MODEL,
'variant': cls.VARIANT,
'chirp_version': CHIRP_VERSION,
- }))
+ }).encode())
def load_mmap(self, filename):
"""Load the radio's memory map from @filename"""
- mapfile = file(filename, "rb")
+ mapfile = open(filename, "rb")
data = mapfile.read()
if self.MAGIC in data:
data, self._metadata = self._strip_metadata(data)
@@ -1177,7 +1182,10 @@ class FileBackedRadio(Radio):
is_version_newer(self._metadata.get('chirp_version'))):
LOG.warning('Image is from version %s but we are %s' % (
self._metadata.get('chirp_version'), CHIRP_VERSION))
- self._mmap = memmap.MemoryMap(data)
+ if self.NEEDS_COMPAT_SERIAL:
+ self._mmap = memmap.MemoryMap(data)
+ else:
+ self._mmap = memmap.MemoryMapBytes(bytes(data))
mapfile.close()
self.process_mmap()
@@ -1187,8 +1195,8 @@ class FileBackedRadio(Radio):
If IOError raise a File Access Error Exception
"""
try:
- mapfile = file(filename, "wb")
- mapfile.write(self._mmap.get_packed())
+ mapfile = open(filename, "wb")
+ mapfile.write(self._mmap.get_byte_compatible().get_packed())
if filename.lower().endswith(".img"):
mapfile.write(self.MAGIC)
mapfile.write(self._make_metadata())
@@ -1316,7 +1324,7 @@ class Status:
def __str__(self):
try:
pct = (self.cur / float(self.max)) * 100
- nticks = int(pct) / 10
+ nticks = int(pct) // 10
ticks = "=" * nticks
except ValueError:
pct = 0.0
@@ -1455,17 +1463,17 @@ def to_kHz(val):
def from_GHz(val):
"""Convert @val in Hz to GHz"""
- return val / 100000000
+ return val // 100000000
def from_MHz(val):
"""Convert @val in Hz to MHz"""
- return val / 100000
+ return val // 100000
def from_kHz(val):
"""Convert @val in Hz to kHz"""
- return val / 100
+ return val // 100
def split_tone_decode(mem, txtone, rxtone):
@@ -1564,7 +1572,7 @@ def sanitize_string(astring, validcharset=CHARSET_ASCII, replacechar='*'):
myfilter = ''.join(
[
[replacechar, chr(x)][chr(x) in validcharset]
- for x in xrange(256)
+ for x in range(256)
])
return astring.translate(myfilter)
@@ -1605,3 +1613,19 @@ def http_user_agent():
CHIRP_VERSION,
ver.major, ver.minor, ver.micro,
sys.platform)
+
+
+def urlretrieve(url, fn):
+ """Grab an URL and save it in a specified file"""
+
+ standard_library.install_aliases()
+ import urllib.request
+ import urllib.error
+
+ headers = {
+ 'User-Agent': http_user_agent(),
+ }
+ req = urllib.request.Request(url, headers=headers)
+ resp = urllib.request.urlopen(req)
+ with open(fn, 'wb') as f:
+ f.write(resp.read())
diff --git a/chirp/detect.py b/chirp/detect.py
index 4298667..ffa9024 100644
--- a/chirp/detect.py
+++ b/chirp/detect.py
@@ -23,7 +23,7 @@ LOG = logging.getLogger(__name__)
def _icom_model_data_to_rclass(md):
- for _rtype, rclass in directory.DRV_TO_RADIO.items():
+ for _rtype, rclass in list(directory.DRV_TO_RADIO.items()):
if rclass.VENDOR != "Icom":
continue
if not hasattr(rclass, 'get_model') or not rclass.get_model():
@@ -42,7 +42,7 @@ def _detect_icom_radio(ser):
ser.baudrate = 9600
md = icf.get_model_data(ser)
return _icom_model_data_to_rclass(md)
- except errors.RadioError, e:
+ except errors.RadioError as e:
LOG.error("_detect_icom_radio: %s", e)
# ICOM IC-91/92 Live-mode radios @ 4800/38400 baud
@@ -93,11 +93,11 @@ def detect_kenwoodlive_radio(port):
ser.close()
models = {}
- for rclass in directory.DRV_TO_RADIO.values():
+ for rclass in list(directory.DRV_TO_RADIO.values()):
if rclass.VENDOR == "Kenwood":
models[rclass.MODEL] = rclass
- if r_id in models.keys():
+ if r_id in list(models.keys()):
return models[r_id]
else:
raise errors.RadioError("Unsupported model `%s'" % r_id)
diff --git a/chirp/directory.py b/chirp/directory.py
index 22f2d42..f79f23d 100644
--- a/chirp/directory.py
+++ b/chirp/directory.py
@@ -14,11 +14,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import glob
import os
import tempfile
import logging
+import sys
-from chirp.drivers import icf, rfinder
+import six
+
+from chirp.drivers import icf # , rfinder
from chirp import chirp_common, util, radioreference, errors
LOG = logging.getLogger(__name__)
@@ -53,7 +57,7 @@ def register(cls):
"""Register radio @cls with the directory"""
global DRV_TO_RADIO
ident = radio_class_id(cls)
- if ident in DRV_TO_RADIO.keys():
+ if ident in list(DRV_TO_RADIO.keys()):
if ALLOW_DUPS:
LOG.warn("Replacing existing driver id `%s'" % ident)
else:
@@ -93,7 +97,7 @@ def icf_to_image(icf_file, img_file):
mdata, mmap = icf.read_file(icf_file)
img_data = None
- for model in DRV_TO_RADIO.values():
+ for model in list(DRV_TO_RADIO.values()):
try:
if model._model == mdata:
img_data = mmap.get_packed()[:model._memsize]
@@ -118,7 +122,8 @@ def get_radio_by_image(image_file):
rr.set_params(zipcode, username, password)
return rr
- if image_file.startswith("rfinder://"):
+ # FIXME: Disable rfinder until the module is fixed
+ if image_file.startswith("rfinder://") and False:
_, _, email, passwd, lat, lon, miles = image_file.split("/")
rf = rfinder.RFinderRadio(None)
rf.set_params((float(lat), float(lon)), int(miles), email, passwd)
@@ -131,21 +136,47 @@ def get_radio_by_image(image_file):
image_file = tempf
if os.path.exists(image_file):
- f = file(image_file, "rb")
- filedata = f.read()
- f.close()
+ with open(image_file, "rb") as f:
+ filedata = f.read()
else:
- filedata = ""
+ filedata = b""
data, metadata = chirp_common.FileBackedRadio._strip_metadata(filedata)
- for rclass in DRV_TO_RADIO.values():
+ # NOTE: See warning below
+ if six.PY3:
+ filestring = ''.join(chr(c) for c in filedata)
+ else:
+ filestring = filedata
+
+ for rclass in list(DRV_TO_RADIO.values()):
if not issubclass(rclass, chirp_common.FileBackedRadio):
continue
- # If no metadata, we do the old thing
- if not metadata and rclass.match_model(filedata, image_file):
- return rclass(image_file)
+ if not metadata:
+ # If no metadata, we do the old thing
+ error = None
+ try:
+ if rclass.match_model(filedata, image_file):
+ return rclass(image_file)
+ except Exception as e:
+ error = e
+
+ # NOTE: For compatibility, try a straight up conversion to
+ # string and log a warning
+ if six.PY3:
+ try:
+ if rclass.match_model(filestring, image_file):
+ LOG.warning(('Radio driver %s needs py3 '
+ 'match_model conversion!') % (
+ rclass.__name__))
+ return rclass(image_file)
+ except Exception as e:
+ error = e
+
+ if error:
+ LOG.error('Radio class %s failed during detection: %s' % (
+ rclass.__name__, error))
# If metadata, then it has to match one of the aliases or the parent
for alias in rclass.ALIASES + [rclass]:
@@ -153,6 +184,7 @@ def get_radio_by_image(image_file):
alias.MODEL == metadata.get('model')):
class DynamicRadioAlias(rclass):
+ _orig_rclass = rclass
VENDOR = metadata.get('vendor')
MODEL = metadata.get('model')
VARIANT = metadata.get('variant')
@@ -166,3 +198,32 @@ def get_radio_by_image(image_file):
raise e
else:
raise errors.ImageDetectFailed("Unknown file format")
+
+
+def safe_import_drivers(limit=None):
+ if sys.platform == 'win32':
+ # Assume we are in a frozen win32 build, so we can not glob
+ # the driver files, but we do not need to anyway
+ import chirp.drivers
+ for module in chirp.drivers.__all__:
+ try:
+ __import__('chirp.drivers.%s' % module)
+ except Exception as e:
+ print('Failed to import %s: %s' % (module, e))
+ return
+
+ # Safe import of everything in chirp/drivers. We need to import them
+ # to get them to register, but should not abort if one import fails
+ chirp_module_base = os.path.dirname(os.path.abspath(__file__))
+ driver_files = glob.glob(os.path.join(chirp_module_base,
+ 'drivers',
+ '*.py'))
+ for driver_file in driver_files:
+ module, ext = os.path.splitext(driver_file)
+ driver_module = os.path.basename(module)
+ if limit and driver_module not in limit:
+ continue
+ try:
+ __import__('chirp.drivers.%s' % driver_module)
+ except Exception as e:
+ print('Failed to import %s: %s' % (module, e))
diff --git a/chirp/drivers/boblov_x3plus.py b/chirp/drivers/boblov_x3plus.py
index d170c4e..dd861e8 100644
--- a/chirp/drivers/boblov_x3plus.py
+++ b/chirp/drivers/boblov_x3plus.py
@@ -313,7 +313,7 @@ class BoblovX3Plus(chirp_common.CloneModeRadio,
rmem = self._memobj.memory[memory.number - 1]
if memory.empty:
- rmem.set_raw('\xFF' * (rmem.size() / 8))
+ rmem.set_raw('\xFF' * (rmem.size() // 8))
return
rmem.rxfreq = memory.freq / 10
diff --git a/chirp/drivers/btech.py b/chirp/drivers/btech.py
index 460c309..dca1560 100644
--- a/chirp/drivers/btech.py
+++ b/chirp/drivers/btech.py
@@ -15,8 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import time
+from builtins import bytes
+
import struct
+import time
import logging
from time import sleep
@@ -41,7 +43,7 @@ LOG = logging.getLogger(__name__)
MEM_SIZE = 0x4000
BLOCK_SIZE = 0x40
TX_BLOCK_SIZE = 0x10
-ACK_CMD = "\x06"
+ACK_CMD = b"\x06"
MODES = ["FM", "NFM"]
SKIP_VALUES = ["S", ""]
TONES = chirp_common.TONES
@@ -144,45 +146,45 @@ VALID_CHARS = chirp_common.CHARSET_ALPHANUMERIC + \
# #### ID strings #####################################################
# BTECH UV2501 pre-production units
-UV2501pp_fp = "M2C294"
+UV2501pp_fp = b"M2C294"
# BTECH UV2501 pre-production units 2 + and 1st Gen radios
-UV2501pp2_fp = "M29204"
+UV2501pp2_fp = b"M29204"
# B-TECH UV-2501 second generation (2G) radios
-UV2501G2_fp = "BTG214"
+UV2501G2_fp = b"BTG214"
# B-TECH UV-2501 third generation (3G) radios
-UV2501G3_fp = "BTG324"
+UV2501G3_fp = b"BTG324"
# B-TECH UV-2501+220 pre-production units
-UV2501_220pp_fp = "M3C281"
+UV2501_220pp_fp = b"M3C281"
# extra block read for the 2501+220 pre-production units
# the same for all of this radios so far
-UV2501_220pp_id = " 280528"
+UV2501_220pp_id = b" 280528"
# B-TECH UV-2501+220
-UV2501_220_fp = "M3G201"
+UV2501_220_fp = b"M3G201"
# new variant, let's call it Generation 2
-UV2501_220G2_fp = "BTG211"
+UV2501_220G2_fp = b"BTG211"
# B-TECH UV-2501+220 third generation (3G)
-UV2501_220G3_fp = "BTG311"
+UV2501_220G3_fp = b"BTG311"
# B-TECH UV-5001 pre-production units + 1st Gen radios
-UV5001pp_fp = "V19204"
+UV5001pp_fp = b"V19204"
# B-TECH UV-5001 alpha units
-UV5001alpha_fp = "V28204"
+UV5001alpha_fp = b"V28204"
# B-TECH UV-5001 second generation (2G) radios
-UV5001G2_fp = "BTG214"
+UV5001G2_fp = b"BTG214"
# B-TECH UV-5001 second generation (2G2)
-UV5001G22_fp = "V2G204"
+UV5001G22_fp = b"V2G204"
# B-TECH UV-5001 third generation (3G)
-UV5001G3_fp = "BTG304"
+UV5001G3_fp = b"BTG304"
# B-TECH UV-25X2
-UV25X2_fp = "UC2012"
+UV25X2_fp = b"UC2012"
# B-TECH UV-25X4
-UV25X4_fp = "UC4014"
+UV25X4_fp = b"UC4014"
# B-TECH UV-50X2
-UV50X2_fp = "UC2M12"
+UV50X2_fp = b"UC2M12"
# B-TECH GMRS-50X1
GMRS50X1_fp = "NC1802"
@@ -193,70 +195,70 @@ BTECH3 = [UV2501G3_fp, UV2501_220G3_fp, UV5001G3_fp]
# WACCOM Mini-8900
-MINI8900_fp = "M28854"
+MINI8900_fp = b"M28854"
# QYT KT-UV980
-KTUV980_fp = "H28854"
+KTUV980_fp = b"H28854"
# QYT KT8900
-KT8900_fp = "M29154"
+KT8900_fp = b"M29154"
# New generations KT8900
-KT8900_fp1 = "M2C234"
-KT8900_fp2 = "M2G1F4"
-KT8900_fp3 = "M2G2F4"
-KT8900_fp4 = "M2G304"
-KT8900_fp5 = "M2G314"
+KT8900_fp1 = b"M2C234"
+KT8900_fp2 = b"M2G1F4"
+KT8900_fp3 = b"M2G2F4"
+KT8900_fp4 = b"M2G304"
+KT8900_fp5 = b"M2G314"
# this radio has an extra ID
-KT8900_id = "303688"
+KT8900_id = b"303688"
# KT8900R
-KT8900R_fp = "M3G1F4"
+KT8900R_fp = b"M3G1F4"
# Second Generation
-KT8900R_fp1 = "M3G214"
+KT8900R_fp1 = b"M3G214"
# another model
-KT8900R_fp2 = "M3C234"
+KT8900R_fp2 = b"M3C234"
# another model G4?
-KT8900R_fp3 = "M39164"
+KT8900R_fp3 = b"M39164"
# another model
-KT8900R_fp4 = "M3G314"
+KT8900R_fp4 = b"M3G314"
# this radio has an extra ID
-KT8900R_id = "280528"
+KT8900R_id = b"280528"
# another extra ID in dec/2018
-KT8900R_id2 = "\x05\x58\x3d\xf0\x10"
+KT8900R_id2 = b"\x05\x58\x3d\xf0\x10"
# KT7900D (quad band)
-KT7900D_fp = "VC4004"
-KT7900D_fp1 = "VC4284"
-KT7900D_fp2 = "VC4264"
+KT7900D_fp = b"VC4004"
+KT7900D_fp1 = b"VC4284"
+KT7900D_fp2 = b"VC4264"
# QB25 (quad band) - a clone of KT7900D
-QB25_fp = "QB-25"
+QB25_fp = b"QB-25"
# KT8900D (dual band)
-KT8900D_fp = "VC2002"
-KT8900D_fp1 = "VC8632"
+KT8900D_fp = b"VC2002"
+KT8900D_fp1 = b"VC8632"
# LUITON LT-588UV
-LT588UV_fp = "V2G1F4"
+LT588UV_fp = b"V2G1F4"
# Added by rstrickoff gen 2 id
-LT588UV_fp1 = "V2G214"
+LT588UV_fp1 = b"V2G214"
# ### MAGICS
# for the Waccom Mini-8900
-MSTRING_MINI8900 = "\x55\xA5\xB5\x45\x55\x45\x4d\x02"
+MSTRING_MINI8900 = b"\x55\xA5\xB5\x45\x55\x45\x4d\x02"
# for the B-TECH UV-2501+220 (including pre production ones)
-MSTRING_220 = "\x55\x20\x15\x12\x12\x01\x4d\x02"
+MSTRING_220 = b"\x55\x20\x15\x12\x12\x01\x4d\x02"
# for the QYT KT8900 & R
-MSTRING_KT8900 = "\x55\x20\x15\x09\x16\x45\x4D\x02"
-MSTRING_KT8900R = "\x55\x20\x15\x09\x25\x01\x4D\x02"
+MSTRING_KT8900 = b"\x55\x20\x15\x09\x16\x45\x4D\x02"
+MSTRING_KT8900R = b"\x55\x20\x15\x09\x25\x01\x4D\x02"
# magic string for all other models
-MSTRING = "\x55\x20\x15\x09\x20\x45\x4d\x02"
+MSTRING = b"\x55\x20\x15\x09\x20\x45\x4d\x02"
# for the QYT KT7900D & KT8900D
-MSTRING_KT8900D = "\x55\x20\x16\x08\x01\xFF\xDC\x02"
+MSTRING_KT8900D = b"\x55\x20\x16\x08\x01\xFF\xDC\x02"
# for the BTECH UV-25X2 and UV-50X2
-MSTRING_UV25X2 = "\x55\x20\x16\x12\x28\xFF\xDC\x02"
+MSTRING_UV25X2 = b"\x55\x20\x16\x12\x28\xFF\xDC\x02"
# for the BTECH UV-25X4
MSTRING_UV25X4 = "\x55\x20\x16\x11\x18\xFF\xDC\x02"
# for the BTECH GMRS-50X1
@@ -270,7 +272,7 @@ def _clean_buffer(radio):
# touching the serial timeout to optimize the flushing
# restored at the end to the default value
radio.pipe.timeout = 0.1
- dump = "1"
+ dump = b"1"
datacount = 0
try:
@@ -293,7 +295,7 @@ def _clean_buffer(radio):
def _rawrecv(radio, amount):
"""Raw read from the radio device, less intensive way"""
- data = ""
+ data = b""
try:
data = radio.pipe.read(amount)
@@ -323,7 +325,7 @@ def _send(radio, data):
try:
for byte in data:
- radio.pipe.write(byte)
+ radio.pipe.write(bytes([byte]))
# Some OS (mainly Linux ones) are too fast on the serial and
# get the MCU inside the radio stuck in the early stages, this
# hits some models more than others.
@@ -346,7 +348,7 @@ def _send(radio, data):
def _make_frame(cmd, addr, length, data=""):
"""Pack the info in the headder format"""
- frame = "\x06" + struct.pack(">BHB", ord(cmd), addr, length)
+ frame = b"\x06" + struct.pack(">BHB", ord(cmd), addr, length)
# add the data if set
if len(data) != 0:
frame += data
@@ -368,7 +370,7 @@ def _recv(radio, addr):
raise errors.RadioError("Short read of the block 0x%04x" % addr)
# checking for the ack
- if block[0] != ACK_CMD:
+ if block[:1] != ACK_CMD:
raise errors.RadioError("Bad ack from radio in block 0x%04x" % addr)
# header validation
@@ -406,7 +408,7 @@ def _start_clone_mode(radio, status):
# Now you get a x06 of ACK if all goes well
ack = radio.pipe.read(1)
- if ack == "\x06":
+ if ack[:1] == ACK_CMD:
# DEBUG
LOG.info("Magic ACK received")
status.cur = status.max
@@ -418,7 +420,7 @@ def _start_clone_mode(radio, status):
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Error sending Magic to radio:\n%s" % e)
@@ -550,7 +552,7 @@ def _download(radio):
# cleaning the serial buffer
_clean_buffer(radio)
- data = ""
+ data = bytes(b"")
for addr in range(0, MEM_SIZE, BLOCK_SIZE):
# sending the read request
_send(radio, _make_frame("S", addr, BLOCK_SIZE))
@@ -583,7 +585,7 @@ def _upload(radio):
_do_ident(radio, status, True)
# get the data to upload to radio
- data = radio.get_mmap()
+ data = radio.get_mmap().get_byte_compatible()
# Reset the UI progress
status.max = MEM_SIZE / TX_BLOCK_SIZE
@@ -621,7 +623,7 @@ def _upload(radio):
if len(ack) != 1:
raise errors.RadioError("No ACK when writing block 0x%04x" % addr)
- if ack not in "\x06\x05":
+ if ack not in bytes(b"\x06\x05"):
raise errors.RadioError("Bad ACK writing block 0x%04x:" % addr)
# UI Update
@@ -676,6 +678,7 @@ class BTechMobileCommon(chirp_common.CloneModeRadio,
COLOR_LCD = False
COLOR_LCD2 = False
NAME_LENGTH = 6
+ NEEDS_COMPAT_SERIAL = False
UPLOAD_MEM_SIZE = 0X3100
_power_levels = [chirp_common.PowerLevel("High", watts=25),
chirp_common.PowerLevel("Low", watts=10)]
@@ -777,7 +780,7 @@ class BTechMobileCommon(chirp_common.CloneModeRadio,
def sync_in(self):
"""Download from radio"""
data = _download(self)
- self._mmap = memmap.MemoryMap(data)
+ self._mmap = memmap.MemoryMapBytes(data)
self.process_mmap()
def sync_out(self):
@@ -786,7 +789,7 @@ class BTechMobileCommon(chirp_common.CloneModeRadio,
_upload(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Error: %s" % e)
def get_raw_memory(self, number):
@@ -2913,7 +2916,7 @@ class BTechMobileCommon(chirp_common.CloneModeRadio,
elif element.value.get_mutable():
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/ft7800.py b/chirp/drivers/ft7800.py
index 1a95bb3..c9d706c 100644
--- a/chirp/drivers/ft7800.py
+++ b/chirp/drivers/ft7800.py
@@ -30,7 +30,7 @@ from collections import defaultdict
LOG = logging.getLogger(__name__)
-ACK = chr(0x06)
+ACK = 0x06
MEM_FORMAT = """
#seekto 0x002A;
@@ -164,7 +164,7 @@ DTMFCHARSET = list("0123456789ABCD*#")
def _send(ser, data):
for i in data:
- ser.write(i)
+ ser.write(bytes([i]))
time.sleep(0.002)
echo = ser.read(len(data))
if echo != data:
@@ -172,9 +172,9 @@ def _send(ser, data):
def _download(radio):
- data = ""
+ data = bytes(b"")
- chunk = ""
+ chunk = bytes(b"")
for i in range(0, 30):
chunk += radio.pipe.read(radio._block_lengths[0])
if chunk:
@@ -184,7 +184,7 @@ def _download(radio):
raise Exception("Failed to read header (%i)" % len(chunk))
data += chunk
- _send(radio.pipe, ACK)
+ _send(radio.pipe, bytes([ACK]))
for i in range(0, radio._block_lengths[1], radio._block_size):
chunk = radio.pipe.read(radio._block_size)
@@ -201,19 +201,20 @@ def _download(radio):
radio.status_fn(status)
data += radio.pipe.read(1)
- _send(radio.pipe, ACK)
+ _send(radio.pipe, bytes([ACK]))
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def _upload(radio):
cur = 0
+ mmap = radio.get_mmap().get_byte_compatible()
for block in radio._block_lengths:
for _i in range(0, block, radio._block_size):
length = min(radio._block_size, block)
# LOG.debug("i=%i length=%i range: %i-%i" %
# (i, length, cur, cur+length))
- _send(radio.pipe, radio.get_mmap()[cur:cur+length])
+ _send(radio.pipe, mmap[cur:cur+length])
if radio.pipe.read(1) != ACK:
raise errors.RadioError("Radio did not ack block at %i" % cur)
cur += length
@@ -257,6 +258,7 @@ class FTx800Radio(yaesu_clone.YaesuCloneModeRadio):
BAUD_RATE = 9600
VENDOR = "Yaesu"
MODES = list(MODES)
+ NEEDS_COMPAT_SERIAL = False
_block_size = 64
POWER_LEVELS_VHF = [chirp_common.PowerLevel("Hi", watts=50),
@@ -321,7 +323,7 @@ class FTx800Radio(yaesu_clone.YaesuCloneModeRadio):
self._mmap = _download(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
LOG.info("Download finished in %i seconds" % (time.time() - start))
self.check_checksums()
@@ -337,7 +339,7 @@ class FTx800Radio(yaesu_clone.YaesuCloneModeRadio):
_upload(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
LOG.info("Upload finished in %i seconds" % (time.time() - start))
@@ -480,7 +482,7 @@ class FT7800BankModel(chirp_common.BankModel):
index = memory.number - 1
_bitmap = self._radio._memobj.bank_channels[bank.index]
ishft = 31 - (index % 32)
- _bitmap.bitmap[index / 32] |= (1 << ishft)
+ _bitmap.bitmap[index // 32] |= (1 << ishft)
self.__m2b_cache[memory.number].append(bank.index)
self.__b2m_cache[bank.index].append(memory.number)
@@ -490,11 +492,11 @@ class FT7800BankModel(chirp_common.BankModel):
index = memory.number - 1
_bitmap = self._radio._memobj.bank_channels[bank.index]
ishft = 31 - (index % 32)
- if not (_bitmap.bitmap[index / 32] & (1 << ishft)):
+ if not (_bitmap.bitmap[index // 32] & (1 << ishft)):
raise Exception("Memory {num} is " +
"not in bank {bank}".format(num=memory.number,
bank=bank))
- _bitmap.bitmap[index / 32] &= ~(1 << ishft)
+ _bitmap.bitmap[index // 32] &= ~(1 << ishft)
self.__b2m_cache[bank.index].remove(memory.number)
self.__m2b_cache[memory.number].remove(bank.index)
@@ -503,7 +505,7 @@ class FT7800BankModel(chirp_common.BankModel):
upper = self._radio.get_features().memory_bounds[1]
c = self._radio._memobj.bank_channels[bank.index]
for i in range(0, upper):
- _bitmap = c.bitmap[i / 32]
+ _bitmap = c.bitmap[i // 32]
ishft = 31 - (i % 32)
if _bitmap & (1 << ishft):
memories.append(i + 1)
@@ -766,7 +768,7 @@ class FT7800Radio(FTx800Radio):
oldval = getattr(_settings, setting)
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval))
setattr(_settings, setting, newval)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
@@ -897,8 +899,8 @@ class FT8800Radio(FTx800Radio):
set_freq(mem.offset, _mem, "split")
return
- val = int(mem.offset / 10000) / 5
- for i in reversed(range(2, 6)):
+ val = int(mem.offset / 10000) // 5
+ for i in reversed(list(range(2, 6))):
_mem.name[i] = (_mem.name[i] & 0x3F) | ((val & 0x03) << 6)
val >>= 2
diff --git a/chirp/drivers/ft817.py b/chirp/drivers/ft817.py
index f34169f..39fb1b6 100644
--- a/chirp/drivers/ft817.py
+++ b/chirp/drivers/ft817.py
@@ -16,6 +16,7 @@
"""FT817 - FT817ND - FT817ND/US management module"""
+from builtins import bytes
from chirp.drivers import yaesu_clone
from chirp import chirp_common, util, memmap, errors, directory, bitwise
from chirp.settings import RadioSetting, RadioSettingGroup, \
@@ -37,6 +38,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
"""Yaesu FT-817"""
BAUD_RATE = 9600
MODEL = "FT-817"
+ NEEDS_COMPAT_SERIAL = False
_model = ""
_US_model = False
@@ -215,10 +217,11 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
#seekto 0x1979;
struct mem_struct sixtymeterchannels[5];
"""
- _CALLSIGN_CHARSET = [chr(x) for x in range(ord("0"), ord("9") + 1) +
- range(ord("A"), ord("Z") + 1) + [ord(" ")]]
- _CALLSIGN_CHARSET_REV = dict(zip(_CALLSIGN_CHARSET,
- range(0, len(_CALLSIGN_CHARSET))))
+ _CALLSIGN_CHARSET = [chr(x) for x in list(range(ord("0"), ord("9") + 1)) +
+ list(range(ord("A"), ord("Z") + 1)) + [ord(" ")]]
+ _CALLSIGN_CHARSET_REV = dict(
+ list(zip(_CALLSIGN_CHARSET,
+ list(range(0, len(_CALLSIGN_CHARSET))))))
# WARNING Index are hard wired in memory management code !!!
SPECIAL_MEMORIES = {
@@ -271,8 +274,8 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
SPECIAL_MEMORIES.update(SPECIAL_PMS)
- SPECIAL_MEMORIES_REV = dict(zip(SPECIAL_MEMORIES.values(),
- SPECIAL_MEMORIES.keys()))
+ SPECIAL_MEMORIES_REV = dict(list(zip(list(SPECIAL_MEMORIES.values()),
+ list(SPECIAL_MEMORIES.keys()))))
@classmethod
def get_prompts(cls):
@@ -304,7 +307,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
if data:
break
time.sleep(0.5)
- if len(data) == block + 2 and data[0] == chr(blocknum):
+ if len(data) == block + 2 and data[0] == blocknum:
checksum = yaesu_clone.YaesuChecksum(1, block)
if checksum.get_existing(data) != \
checksum.get_calculated(data):
@@ -333,7 +336,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
start = time.time()
- data = ""
+ data = bytes(b"")
blocks = 0
status = chirp_common.Status()
status.msg = _("Cloning from radio")
@@ -347,7 +350,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
repeat = 1
for _i in range(0, repeat):
data += self._read(block, blocks, blocks == nblocks - 1)
- self.pipe.write(chr(CMD_ACK))
+ self.pipe.write(bytes([CMD_ACK]))
blocks += 1
status.cur = blocks
self.status_fn(status)
@@ -365,7 +368,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
LOG.info("Clone completed in %i seconds" % (time.time() - start))
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def _clone_out(self):
delay = 0.5
@@ -376,6 +379,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
status = chirp_common.Status()
status.msg = _("Cloning to radio")
status.max = len(self._block_lengths) + 39
+ mmap = self.get_mmap().get_byte_compatible()
for block in self._block_lengths:
if blocks == 8:
# repeated read of 40 block same size (memory area)
@@ -389,16 +393,16 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
(blocks, pos, pos + block))
LOG.debug(util.hexprint(chr(blocks)))
LOG.debug(util.hexprint(self.get_mmap()[pos:pos + block]))
- LOG.debug(util.hexprint(chr(checksum.get_calculated(
- self.get_mmap()))))
- self.pipe.write(chr(blocks))
- self.pipe.write(self.get_mmap()[pos:pos + block])
- self.pipe.write(chr(checksum.get_calculated(self.get_mmap())))
+ LOG.debug(util.hexprint(chr(checksum.get_calculated(mmap))))
+ self.pipe.write(bytes([blocks]))
+ self.pipe.write(mmap[pos:pos + block])
+ self.pipe.write(bytes([checksum.get_calculated(
+ self.get_mmap())]))
buf = self.pipe.read(1)
- if not buf or buf[0] != chr(CMD_ACK):
+ if not buf or buf[0] != CMD_ACK:
time.sleep(delay)
buf = self.pipe.read(1)
- if not buf or buf[0] != chr(CMD_ACK):
+ if not buf or buf[0] != CMD_ACK:
LOG.debug(util.hexprint(buf))
raise Exception(_("Radio did not ack block %i") % blocks)
pos += block
@@ -413,7 +417,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
self._mmap = self._clone_in()
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
self.process_mmap()
@@ -422,7 +426,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
self._clone_out()
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
def process_mmap(self):
@@ -516,7 +520,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
_mem = self._memobj.qmb
immutable = ["number", "skip", "extd_number",
"name", "dtcs_polarity", "power", "comment"]
- elif mem.number in self.SPECIAL_PMS.values():
+ elif mem.number in list(self.SPECIAL_PMS.values()):
bitindex = -self.LAST_PMS_INDEX + mem.number
used = (self._memobj.pmsvisible >> bitindex) & 0x01
valid = (self._memobj.pmsfilled >> bitindex) & 0x01
@@ -539,7 +543,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
return mem
def _set_special(self, mem):
- if mem.empty and mem.number not in self.SPECIAL_PMS.values():
+ if mem.empty and mem.number not in list(self.SPECIAL_PMS.values()):
# can't delete special memories!
raise Exception("Sorry, special memory can't be deleted")
@@ -558,7 +562,7 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
_mem = self._memobj.home[5 + mem.number]
elif mem.number == -1:
_mem = self._memobj.qmb
- elif mem.number in self.SPECIAL_PMS.values():
+ elif mem.number in list(self.SPECIAL_PMS.values()):
# this case has to be last because 817 pms keys overlap with
# 857 derived class other special memories
bitindex = -self.LAST_PMS_INDEX + mem.number
@@ -618,17 +622,19 @@ class FT817Radio(yaesu_clone.YaesuCloneModeRadio):
# if you ulpoad an empty image you can brick your radio
raise Exception("Sorry, can't delete first memory")
if wasvalid and not wasused:
- self._memobj.filled[(mem.number - 1) / 8] &= \
+ self._memobj.filled[(mem.number - 1) // 8] &= \
~(1 << (mem.number - 1) % 8)
- _mem.set_raw("\xFF" * (_mem.size() / 8)) # clean up
- self._memobj.visible[(mem.number - 1) / 8] &= \
+ _mem.set_raw("\xFF" * (_mem.size() // 8)) # clean up
+ self._memobj.visible[(mem.number - 1) // 8] &= \
~(1 << (mem.number - 1) % 8)
return
if not wasvalid:
- _mem.set_raw("\x00" * (_mem.size() / 8)) # clean up
+ _mem.set_raw("\x00" * (_mem.size() // 8)) # clean up
- self._memobj.visible[(mem.number - 1) / 8] |= 1 << (mem.number - 1) % 8
- self._memobj.filled[(mem.number - 1) / 8] |= 1 << (mem.number - 1) % 8
+ self._memobj.visible[(mem.number - 1) // 8] |= (
+ 1 << (mem.number - 1) % 8)
+ self._memobj.filled[(mem.number - 1) // 8] |= (
+ 1 << (mem.number - 1) % 8)
self._set_memory(mem, _mem)
def _get_memory(self, mem, _mem):
@@ -1141,8 +1147,8 @@ class FT817NDUSRadio(FT817Radio):
SPECIAL_MEMORIES = dict(FT817Radio.SPECIAL_MEMORIES)
SPECIAL_MEMORIES.update(SPECIAL_60M)
- SPECIAL_MEMORIES_REV = dict(zip(SPECIAL_MEMORIES.values(),
- SPECIAL_MEMORIES.keys()))
+ SPECIAL_MEMORIES_REV = dict(list(zip(list(SPECIAL_MEMORIES.values()),
+ list(SPECIAL_MEMORIES.keys()))))
def _get_special_60m(self, number):
mem = chirp_common.Memory()
@@ -1181,10 +1187,11 @@ class FT817NDUSRadio(FT817Radio):
self._set_memory(mem, _mem)
def get_memory(self, number):
- if number in self.SPECIAL_60M.keys():
+ if number in list(self.SPECIAL_60M.keys()):
return self._get_special_60m(number)
- elif number < 0 and \
- self.SPECIAL_MEMORIES_REV[number] in self.SPECIAL_60M.keys():
+ elif (number < 0 and
+ self.SPECIAL_MEMORIES_REV[number] in
+ list(self.SPECIAL_60M.keys())):
# I can't stop delete operation from loosing extd_number but
# I know how to get it back
return self._get_special_60m(self.SPECIAL_MEMORIES_REV[number])
@@ -1192,7 +1199,7 @@ class FT817NDUSRadio(FT817Radio):
return FT817Radio.get_memory(self, number)
def set_memory(self, memory):
- if memory.number in self.SPECIAL_60M.values():
+ if memory.number in list(self.SPECIAL_60M.values()):
return self._set_special_60m(memory)
else:
return FT817Radio.set_memory(self, memory)
diff --git a/chirp/drivers/ft857.py b/chirp/drivers/ft857.py
index 5a8fe32..a58c52b 100644
--- a/chirp/drivers/ft857.py
+++ b/chirp/drivers/ft857.py
@@ -44,7 +44,7 @@ class FT857Radio(ft817.FT817Radio):
0xff: "Cross",
0x00: "",
}
- TMODES_REV = dict(zip(TMODES.values(), TMODES.keys()))
+ TMODES_REV = dict(list(zip(list(TMODES.values()), list(TMODES.keys()))))
CROSS_MODES = {
0x01: "->Tone",
@@ -56,7 +56,8 @@ class FT857Radio(ft817.FT817Radio):
0x09: "DTCS->Tone",
0x0a: "DTCS->DTCS",
}
- CROSS_MODES_REV = dict(zip(CROSS_MODES.values(), CROSS_MODES.keys()))
+ CROSS_MODES_REV = dict(list(zip(list(CROSS_MODES.values()),
+ list(CROSS_MODES.keys()))))
_memsize = 7341
# block 9 (140 Bytes long) is to be repeted 40 times
@@ -314,13 +315,13 @@ class FT857Radio(ft817.FT817Radio):
"""
- _CALLSIGN_CHARSET = [chr(x) for x in range(ord("0"), ord("9") + 1) +
- range(ord("A"), ord("Z") + 1)] + [" ", "/"]
- _CALLSIGN_CHARSET_REV = dict(zip(_CALLSIGN_CHARSET,
- range(0, len(_CALLSIGN_CHARSET))))
+ _CALLSIGN_CHARSET = [chr(x) for x in list(range(ord("0"), ord("9") + 1)) +
+ list(range(ord("A"), ord("Z") + 1))] + [" ", "/"]
+ _CALLSIGN_CHARSET_REV = dict(list(zip(_CALLSIGN_CHARSET,
+ list(range(0, len(_CALLSIGN_CHARSET))))))
_BEACON_CHARSET = _CALLSIGN_CHARSET + ["+", "."]
- _BEACON_CHARSET_REV = dict(zip(_BEACON_CHARSET,
- range(0, len(_BEACON_CHARSET))))
+ _BEACON_CHARSET_REV = dict(list(zip(_BEACON_CHARSET,
+ list(range(0, len(_BEACON_CHARSET))))))
# WARNING Index are hard wired in memory management code !!!
SPECIAL_MEMORIES = {
@@ -383,8 +384,8 @@ class FT857Radio(ft817.FT817Radio):
SPECIAL_MEMORIES.update(SPECIAL_PMS)
- SPECIAL_MEMORIES_REV = dict(zip(SPECIAL_MEMORIES.values(),
- SPECIAL_MEMORIES.keys()))
+ SPECIAL_MEMORIES_REV = dict(list(zip(list(SPECIAL_MEMORIES.values()),
+ list(SPECIAL_MEMORIES.keys()))))
FILTERS = ["CFIL", "FIL1", "FIL2"]
PROGRAMMABLEOPTIONS = [
@@ -461,8 +462,8 @@ class FT857Radio(ft817.FT817Radio):
rf.has_cross = True
rf.has_ctone = True
rf.has_rx_dtcs = True
- rf.valid_tmodes = self.TMODES_REV.keys()
- rf.valid_cross_modes = self.CROSS_MODES_REV.keys()
+ rf.valid_tmodes = list(self.TMODES_REV.keys())
+ rf.valid_cross_modes = list(self.CROSS_MODES_REV.keys())
return rf
def _get_duplex(self, mem, _mem):
@@ -1132,8 +1133,8 @@ class FT857USRadio(FT857Radio):
SPECIAL_MEMORIES = dict(FT857Radio.SPECIAL_MEMORIES)
SPECIAL_MEMORIES.update(SPECIAL_60M)
- SPECIAL_MEMORIES_REV = dict(zip(SPECIAL_MEMORIES.values(),
- SPECIAL_MEMORIES.keys()))
+ SPECIAL_MEMORIES_REV = dict(list(zip(list(SPECIAL_MEMORIES.values()),
+ list(SPECIAL_MEMORIES.keys()))))
# this is identical to the one in FT817ND_US_Radio but we inherit from 857
def _get_special_60m(self, number):
@@ -1174,10 +1175,11 @@ class FT857USRadio(FT857Radio):
self._set_memory(mem, _mem)
def get_memory(self, number):
- if number in self.SPECIAL_60M.keys():
+ if number in list(self.SPECIAL_60M.keys()):
return self._get_special_60m(number)
- elif number < 0 and \
- self.SPECIAL_MEMORIES_REV[number] in self.SPECIAL_60M.keys():
+ elif number < 0 and (
+ self.SPECIAL_MEMORIES_REV[number] in
+ list(self.SPECIAL_60M.keys())):
# I can't stop delete operation from loosing extd_number but
# I know how to get it back
return self._get_special_60m(self.SPECIAL_MEMORIES_REV[number])
@@ -1185,7 +1187,7 @@ class FT857USRadio(FT857Radio):
return FT857Radio.get_memory(self, number)
def set_memory(self, memory):
- if memory.number in self.SPECIAL_60M.values():
+ if memory.number in list(self.SPECIAL_60M.values()):
return self._set_special_60m(memory)
else:
return FT857Radio.set_memory(self, memory)
diff --git a/chirp/drivers/generic_csv.py b/chirp/drivers/generic_csv.py
index e7c3c93..0c60108 100644
--- a/chirp/drivers/generic_csv.py
+++ b/chirp/drivers/generic_csv.py
@@ -103,6 +103,7 @@ class CSVRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
rf.has_infinite_number = True
rf.has_nostep_tuning = True
rf.has_comment = True
+ rf.can_odd_split = True
rf.valid_modes = list(chirp_common.MODES)
rf.valid_tmodes = list(chirp_common.TONE_MODES)
@@ -160,9 +161,9 @@ class CSVRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
val = typ(val)
if hasattr(mem, attr):
setattr(mem, attr, val)
- except OmittedHeaderError, e:
+ except OmittedHeaderError as e:
pass
- except Exception, e:
+ except Exception as e:
raise Exception("[%s] %s" % (attr, e))
return self._clean(headers, line, mem)
@@ -176,10 +177,12 @@ class CSVRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
self._blank()
- f = file(self._filename, "rU")
- header = f.readline().strip()
+ with open(self._filename, "rU") as f:
+ header = f.readline().strip()
+ f.seek(0, 0)
+ return self._load(f)
- f.seek(0, 0)
+ def _load(self, f):
reader = csv.reader(f, delimiter=chirp_common.SEPCHAR, quotechar='"')
good = 0
@@ -203,7 +206,7 @@ class CSVRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
mem = self._parse_csv_data_line(header, line)
if mem.number is None:
raise Exception("Invalid Location field" % lineno)
- except Exception, e:
+ except Exception as e:
LOG.error("Line %i: %s", lineno, e)
self.errors.append("Line %i: %s" % (lineno, e))
continue
@@ -223,14 +226,12 @@ class CSVRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
if filename:
self._filename = filename
- f = file(self._filename, "wb")
- writer = csv.writer(f, delimiter=chirp_common.SEPCHAR)
- writer.writerow(chirp_common.Memory.CSV_FORMAT)
+ with open(self._filename, "w") as f:
+ writer = csv.writer(f, delimiter=chirp_common.SEPCHAR)
+ writer.writerow(chirp_common.Memory.CSV_FORMAT)
- for mem in self.memories:
- write_memory(writer, mem)
-
- f.close()
+ for mem in self.memories:
+ write_memory(writer, mem)
# MMAP compatibility
def save_mmap(self, filename):
@@ -279,6 +280,11 @@ class CSVRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
@classmethod
def match_model(cls, filedata, filename):
"""Match files ending in .CSV"""
+ try:
+ filedata = filedata.decode()
+ except UnicodeDecodeError:
+ # CSV files are text
+ return False
return filename.lower().endswith("." + cls.FILE_EXTENSION) and \
(filedata.startswith("Location,") or filedata == "")
@@ -453,6 +459,11 @@ class RTCSVRadio(CSVRadio):
# RT Systems provides a different set of columns for each radio.
# We attempt to match only the first few columns, hoping they are
# consistent across radio models.
+ try:
+ filedata = filedata.decode()
+ except UnicodeDecodeError:
+ # CSV files are text
+ return False
return filename.lower().endswith("." + cls.FILE_EXTENSION) and \
filedata.startswith("Channel Number,Receive Frequency,"
"Transmit Frequency,Offset Frequency,"
diff --git a/chirp/drivers/generic_tpe.py b/chirp/drivers/generic_tpe.py
index 1d24492..dced1c5 100644
--- a/chirp/drivers/generic_tpe.py
+++ b/chirp/drivers/generic_tpe.py
@@ -13,7 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import UserDict
+try:
+ import UserDict
+except ImportError:
+ from collections import UserDict
from chirp import chirp_common, directory
from chirp.drivers import generic_csv
diff --git a/chirp/drivers/generic_xml.py b/chirp/drivers/generic_xml.py
deleted file mode 100644
index adb993d..0000000
--- a/chirp/drivers/generic_xml.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright 2008 Dan Smith <dsmith@danplanet.com>
-#
-# 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-import os
-import libxml2
-import logging
-
-from chirp import chirp_common, errors, xml_ll, platform, directory
-
-LOG = logging.getLogger(__name__)
-
-
-def validate_doc(doc):
- """Validate the document"""
- path = platform.get_platform().find_resource("chirp.xsd")
-
- try:
- ctx = libxml2.schemaNewParserCtxt(path)
- schema = ctx.schemaParse()
- except libxml2.parserError, e:
- LOG.error("Unable to load schema: %s" % e)
- LOG.error("Path: %s" % path)
- raise errors.RadioError("Unable to load schema")
-
- del ctx
-
- errs = []
- warnings = []
-
- def _err(msg, *_args):
- errs.append("ERROR: %s" % msg)
-
- def _wrn(msg, *_args):
- warnings.append("WARNING: %s" % msg)
-
- validctx = schema.schemaNewValidCtxt()
- validctx.setValidityErrorHandler(_err, _wrn)
- err = validctx.schemaValidateDoc(doc)
- for w in warnings:
- LOG.warn(w)
- if err:
- for l in ["--- DOC ---",
- doc.serialize(format=1).split("\n"),
- "-----------",
- errs]:
- LOG.error(l)
- raise errors.RadioError("Schema error")
-
-
-def default_banks():
- """Return an empty set of banks"""
- banks = []
-
- for i in range(0, 26):
- banks.append("Bank-%s" % (chr(ord("A") + i)))
-
- return banks
-
-
-@directory.register
-class XMLRadio(chirp_common.FileBackedRadio, chirp_common.IcomDstarSupport):
- """Generic XML driver"""
- VENDOR = "Generic"
- MODEL = "XML"
- FILE_EXTENSION = "chirp"
-
- def __init__(self, pipe):
- chirp_common.FileBackedRadio.__init__(self, None)
- self._filename = pipe
- if self._filename and os.path.exists(self._filename):
- self.doc = libxml2.parseFile(self._filename)
- validate_doc(self.doc)
- else:
- self.doc = libxml2.newDoc("1.0")
- radio = self.doc.newChild(None, "radio", None)
- radio.newChild(None, "memories", None)
- radio.newChild(None, "banks", None)
- radio.newProp("version", "0.1.1")
-
- def get_features(self):
- rf = chirp_common.RadioFeatures()
- rf.has_bank = False
- # rf.has_bank_index = True
- rf.requires_call_lists = False
- rf.has_implicit_calls = False
- rf.memory_bounds = (0, 1000)
- rf.valid_characters = chirp_common.CHARSET_ASCII
- rf.valid_name_length = 999
- rf.valid_tmodes = ["", "Tone", "TSQL", "DTCS"]
- return rf
-
- def load(self, filename=None):
- if not self._filename and not filename:
- raise errors.RadioError("Need a location to load from")
-
- if filename:
- self._filename = filename
-
- self.doc = libxml2.parseFile(self._filename)
- validate_doc(self.doc)
-
- def save(self, filename=None):
- if not self._filename and not filename:
- raise errors.RadioError("Need a location to save to")
-
- if filename:
- self._filename = filename
-
- f = file(self._filename, "w")
- f.write(self.doc.serialize(format=1))
- f.close()
-
- def get_memories(self, lo=0, hi=999):
- mems = []
- for i in range(lo, hi):
- try:
- mems.append(xml_ll.get_memory(self.doc, i))
- except errors.InvalidMemoryLocation:
- pass
-
- return mems
-
- def get_memory(self, number):
- mem = xml_ll.get_memory(self.doc, number)
-
- return mem
-
- def set_memory(self, mem):
- xml_ll.set_memory(self.doc, mem)
-
- def erase_memory(self, number):
- xml_ll.del_memory(self.doc, number)
-
- @classmethod
- def match_model(cls, _filedata, filename):
- """Match this driver if the extension matches"""
- return filename.lower().endswith("." + cls.FILE_EXTENSION)
diff --git a/chirp/drivers/h777.py b/chirp/drivers/h777.py
index 35ad1aa..f3353be 100644
--- a/chirp/drivers/h777.py
+++ b/chirp/drivers/h777.py
@@ -72,11 +72,11 @@ struct {
} settings2;
"""
-CMD_ACK = "\x06"
+CMD_ACK = b"\x06"
BLOCK_SIZE = 0x08
-UPLOAD_BLOCKS = [range(0x0000, 0x0110, 8),
- range(0x02b0, 0x02c0, 8),
- range(0x0380, 0x03e0, 8)]
+UPLOAD_BLOCKS = [list(range(0x0000, 0x0110, 8)),
+ list(range(0x02b0, 0x02c0, 8)),
+ list(range(0x0380, 0x03e0, 8))]
# TODO: Is it 1 watt?
H777_POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=1.00),
@@ -97,9 +97,9 @@ def _h777_enter_programming_mode(radio):
serial = radio.pipe
try:
- serial.write("\x02")
+ serial.write(b"\x02")
time.sleep(0.1)
- serial.write("PROGRAM")
+ serial.write(b"PROGRAM")
ack = serial.read(1)
except:
raise errors.RadioError("Error communicating with radio")
@@ -111,7 +111,7 @@ def _h777_enter_programming_mode(radio):
original_timeout = serial.timeout
try:
- serial.write("\x02")
+ serial.write(b"\x02")
# At least one version of the Baofeng BF-888S has a consistent
# ~0.33s delay between sending the first five bytes of the
# version data and the last three bytes. We need to raise the
@@ -123,7 +123,7 @@ def _h777_enter_programming_mode(radio):
finally:
serial.timeout = original_timeout
- if not ident.startswith("P3107"):
+ if not ident.startswith(b"P3107"):
LOG.debug(util.hexprint(ident))
raise errors.RadioError("Radio returned unknown identification string")
@@ -140,7 +140,7 @@ def _h777_enter_programming_mode(radio):
def _h777_exit_programming_mode(radio):
serial = radio.pipe
try:
- serial.write("E")
+ serial.write(b"E")
except:
raise errors.RadioError("Radio refused to exit programming mode")
@@ -148,8 +148,8 @@ def _h777_exit_programming_mode(radio):
def _h777_read_block(radio, block_addr, block_size):
serial = radio.pipe
- cmd = struct.pack(">cHb", 'R', block_addr, BLOCK_SIZE)
- expectedresponse = "W" + cmd[1:]
+ cmd = struct.pack(">cHb", b'R', block_addr, BLOCK_SIZE)
+ expectedresponse = b"W" + cmd[1:]
LOG.debug("Reading block %04x..." % (block_addr))
try:
@@ -174,8 +174,8 @@ def _h777_read_block(radio, block_addr, block_size):
def _h777_write_block(radio, block_addr, block_size):
serial = radio.pipe
- cmd = struct.pack(">cHb", 'W', block_addr, BLOCK_SIZE)
- data = radio.get_mmap()[block_addr:block_addr + 8]
+ cmd = struct.pack(">cHb", b'W', block_addr, BLOCK_SIZE)
+ data = radio.get_mmap().get_byte_compatible()[block_addr:block_addr + 8]
LOG.debug("Writing Data:")
LOG.debug(util.hexprint(cmd + data))
@@ -200,7 +200,7 @@ def do_download(radio):
LOG.debug("download")
_h777_enter_programming_mode(radio)
- data = ""
+ data = b""
status = chirp_common.Status()
status.msg = "Cloning from radio"
@@ -220,7 +220,7 @@ def do_download(radio):
_h777_exit_programming_mode(radio)
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def do_upload(radio):
@@ -279,6 +279,7 @@ class H777Radio(chirp_common.CloneModeRadio):
VENDOR = "Baofeng"
MODEL = "BF-888"
BAUD_RATE = 9600
+ NEEDS_COMPAT_SERIAL = False
ALIASES = [ArcshellAR5, ArcshellAR6, GV8SAlias, GV9SAlias, A8SAlias,
TenwayTW325Alias]
@@ -422,7 +423,7 @@ class H777Radio(chirp_common.CloneModeRadio):
_mem = self._memobj.memory[mem.number - 1]
if mem.empty:
- _mem.set_raw("\xFF" * (_mem.size() / 8))
+ _mem.set_raw("\xFF" * (_mem.size() // 8))
return
_mem.rxfreq = mem.freq / 10
@@ -575,7 +576,7 @@ class H777Radio(chirp_common.CloneModeRadio):
else:
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/ic208.py b/chirp/drivers/ic208.py
index b327371..e972503 100644
--- a/chirp/drivers/ic208.py
+++ b/chirp/drivers/ic208.py
@@ -75,11 +75,13 @@ for i in range(1, 6):
IC208_SPECIAL.append("%iA" % i)
IC208_SPECIAL.append("%iB" % i)
-CHARSET = dict(zip([0x00, 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0f], " ()*+-/") +
- zip(range(0x10, 0x1a), "0123456789") +
+CHARSET = dict(list(zip([0x00, 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0f],
+ " ()*+-/")) +
+ list(zip(list(range(0x10, 0x1a)), "0123456789")) +
[(0x1c, '|'), (0x1d, '=')] +
- zip(range(0x21, 0x3b), "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
-CHARSET_REV = dict(zip(CHARSET.values(), CHARSET.keys()))
+ list(zip(list(range(0x21, 0x3b)),
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
+CHARSET_REV = dict(list(zip(list(CHARSET.values()), list(CHARSET.keys()))))
def get_name(_mem):
@@ -150,7 +152,7 @@ class IC208Radio(icf.IcomCloneModeRadio):
(230000000, 550000000),
(810000000, 999995000)]
rf.valid_special_chans = ["C1", "C2"] + sorted(IC208_SPECIAL)
- rf.valid_characters = "".join(CHARSET.values())
+ rf.valid_characters = "".join(list(CHARSET.values()))
return rf
def get_raw_memory(self, number):
diff --git a/chirp/drivers/ic2200.py b/chirp/drivers/ic2200.py
index cb5d66e..3d42148 100644
--- a/chirp/drivers/ic2200.py
+++ b/chirp/drivers/ic2200.py
@@ -97,7 +97,7 @@ def _get_special():
def _wipe_memory(mem, char):
- mem.set_raw(char * (mem.size() / 8))
+ mem.set_raw(char * (mem.size() // 8))
@directory.register
diff --git a/chirp/drivers/ic2300.py b/chirp/drivers/ic2300.py
index 358d454..b563e60 100644
--- a/chirp/drivers/ic2300.py
+++ b/chirp/drivers/ic2300.py
@@ -113,7 +113,7 @@ POWER_LEVELS = [chirp_common.PowerLevel("High", watts=65),
def _wipe_memory(mem, char):
- mem.set_raw(char * (mem.size() / 8))
+ mem.set_raw(char * (mem.size() // 8))
@directory.register
diff --git a/chirp/drivers/ic2730.py b/chirp/drivers/ic2730.py
index 84d5e63..3f981e6 100644
--- a/chirp/drivers/ic2730.py
+++ b/chirp/drivers/ic2730.py
@@ -260,7 +260,7 @@ def _resolve_memory_number(number):
def _wipe_memory(mem, char):
- mem.set_raw(char * (mem.size() / 8))
+ mem.set_raw(char * (mem.size() // 8))
@directory.register
@@ -1286,6 +1286,6 @@ class IC2730Radio(icf.IcomRawCloneModeRadio):
elif element.value.get_mutable():
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/ic2820.py b/chirp/drivers/ic2820.py
index 37b996d..315436b 100644
--- a/chirp/drivers/ic2820.py
+++ b/chirp/drivers/ic2820.py
@@ -117,7 +117,7 @@ def _resolve_memory_number(number):
def _wipe_memory(mem, char):
- mem.set_raw(char * (mem.size() / 8))
+ mem.set_raw(char * (mem.size() // 8))
@directory.register
diff --git a/chirp/drivers/ic9x.py b/chirp/drivers/ic9x.py
index 37568eb..fc52560 100644
--- a/chirp/drivers/ic9x.py
+++ b/chirp/drivers/ic9x.py
@@ -181,7 +181,7 @@ class IC9xRadio(icf.IcomLiveRadio):
LOG.debug("Done: %s" % mem)
except errors.InvalidMemoryLocation:
pass
- except errors.InvalidDataError, e:
+ except errors.InvalidDataError as e:
LOG.error("Error talking to radio: %s" % e)
break
@@ -223,7 +223,7 @@ class IC9xRadio(icf.IcomLiveRadio):
self.__memcache[memory.number] = memory
def _ic9x_get_banks(self):
- if len(self.__bankcache.keys()) == 26:
+ if len(list(self.__bankcache.keys())) == 26:
return [self.__bankcache[k] for k in
sorted(self.__bankcache.keys())]
@@ -246,10 +246,10 @@ class IC9xRadio(icf.IcomLiveRadio):
def _ic9x_set_banks(self, banks):
- if len(banks) != len(self.__bankcache.keys()):
+ if len(banks) != len(list(self.__bankcache.keys())):
raise errors.InvalidDataError("Invalid bank list length (%i:%i)" %
(len(banks),
- len(self.__bankcache.keys())))
+ len(list(self.__bankcache.keys()))))
cached_names = [str(self.__bankcache[x])
for x in sorted(self.__bankcache.keys())]
@@ -279,7 +279,7 @@ class IC9xRadio(icf.IcomLiveRadio):
def get_features(self):
rf = chirp_common.RadioFeatures()
rf.has_sub_devices = True
- rf.valid_special_chans = IC9X_SPECIAL[self.vfo].keys()
+ rf.valid_special_chans = list(IC9X_SPECIAL[self.vfo].keys())
return rf
@@ -417,8 +417,8 @@ def _test():
import serial
ser = IC9xRadioB(serial.Serial(port="/dev/ttyUSB1",
baudrate=38400, timeout=0.1))
- print ser.get_urcall_list()
- print "-- FOO --"
+ print(ser.get_urcall_list())
+ print("-- FOO --")
ser.set_urcall_list(["K7TAY", "FOOBAR", "BAZ"])
diff --git a/chirp/drivers/ic9x_ll.py b/chirp/drivers/ic9x_ll.py
index a6a2e14..d645ecf 100644
--- a/chirp/drivers/ic9x_ll.py
+++ b/chirp/drivers/ic9x_ll.py
@@ -60,7 +60,7 @@ def _ic9x_parse_frames(buf):
try:
start = buf.index("\xfe\xfe")
end = buf[start:].index("\xfd") + start + 1
- except Exception, e:
+ except Exception as e:
LOG.error("No trailing bit")
break
@@ -71,7 +71,7 @@ def _ic9x_parse_frames(buf):
frame = IC92Frame()
frame.from_raw(framedata[2:-1])
frames.append(frame)
- except errors.InvalidDataError, e:
+ except errors.InvalidDataError as e:
LOG.error("Broken frame: %s" % e)
# LOG.debug("Parsed %i frames" % len(frames))
diff --git a/chirp/drivers/icf.py b/chirp/drivers/icf.py
index 816771a..6d702db 100644
--- a/chirp/drivers/icf.py
+++ b/chirp/drivers/icf.py
@@ -13,11 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import struct
+from builtins import bytes
+
import re
import time
import logging
+import struct
+from chirp import bitwise
from chirp import chirp_common, errors, util, memmap
from chirp.settings import RadioSetting, RadioSettingGroup, \
RadioSettingValueBoolean, RadioSettings
@@ -63,13 +66,16 @@ def parse_frame_generic(data):
"""Parse an ICF frame of unknown type from the beginning of @data"""
frame = IcfFrame()
- frame.src = ord(data[2])
- frame.dst = ord(data[3])
- frame.cmd = ord(data[4])
+ assert isinstance(data, bytes), ('parse_frame_generic() expected bytes, '
+ 'but got %s' % data.__class__)
+
+ frame.src = data[2]
+ frame.dst = data[3]
+ frame.cmd = data[4]
try:
- end = data.index("\xFD")
- except ValueError:
+ end = data.index(0xFD)
+ except ValueError as e:
return None, data
frame.payload = data[5:end]
@@ -81,10 +87,10 @@ class RadioStream:
"""A class to make reading a stream of IcfFrames easier"""
def __init__(self, pipe):
self.pipe = pipe
- self.data = ""
+ self.data = bytes()
def _process_frames(self):
- if not self.data.startswith("\xFE\xFE"):
+ if not self.data.startswith(b"\xFE\xFE"):
LOG.error("Out of sync with radio:\n%s" % util.hexprint(self.data))
raise errors.InvalidDataError("Out of sync with radio")
elif len(self.data) < 5:
@@ -94,7 +100,7 @@ class RadioStream:
while self.data:
try:
- cmd = ord(self.data[4])
+ cmd = self.data[4]
except IndexError:
break # Out of data
@@ -108,8 +114,8 @@ class RadioStream:
else:
frames.append(frame)
- self.data = rest
- except errors.InvalidDataError, e:
+ self.data = bytes(rest)
+ except errors.InvalidDataError as e:
LOG.error("Failed to parse frame (cmd=%i): %s" % (cmd, e))
return []
@@ -124,7 +130,7 @@ class RadioStream:
else:
self.data += _data
- if not nolimit and len(self.data) > 128 and "\xFD" in self.data:
+ if not nolimit and len(self.data) > 128 and 0xFD in self.data:
break # Give us a chance to do some status
if len(self.data) > 1024:
break # Avoid an endless loop of chewing garbage
@@ -135,7 +141,7 @@ class RadioStream:
return self._process_frames()
-def get_model_data(radio, mdata="\x00\x00\x00\x00"):
+def get_model_data(radio, mdata=bytes(b"\x00\x00\x00\x00")):
"""Query the @radio for its model data"""
send_clone_frame(radio, 0xe0, mdata, raw=True)
@@ -171,9 +177,12 @@ def get_clone_resp(pipe, length=None, max_count=None):
def send_clone_frame(radio, cmd, data, raw=False, checksum=False):
"""Send a clone frame with @cmd and @data to the @radio"""
- payload = radio.get_payload(data, raw, checksum)
+ payload = radio.get_payload(bytes(data), raw, checksum)
- frame = "\xfe\xfe\xee\xef%s%s\xfd" % (chr(cmd), payload)
+ frame = (bytes(b"\xfe\xfe\xee\xef") +
+ bytes([cmd]) +
+ payload +
+ bytes(b"\xfd"))
if SAVE_PIPE:
LOG.debug("Saving data...")
@@ -197,29 +206,35 @@ def send_clone_frame(radio, cmd, data, raw=False, checksum=False):
def process_data_frame(radio, frame, _mmap):
"""Process a data frame, adding the payload to @_mmap"""
_data = radio.process_frame_payload(frame.payload)
+
+ # NOTE: On the _data[N:N+1] below. Because:
+ # - on py2 bytes[N] is a bytes
+ # - on py3 bytes[N] is an int
+ # - on both bytes[N:M] is a bytes
+ # So we do a slice so we get consistent behavior
# Checksum logic added by Rick DeWitt, 9/2019, issue # 7075
if len(_mmap) >= 0x10000: # This map size not tested for checksum
saddr, = struct.unpack(">I", _data[0:4])
- length, = struct.unpack("B", _data[4])
+ length, = struct.unpack("B", _data[4:5])
data = _data[5:5+length]
- sumc, = struct.unpack("B", _data[5+length])
- addr1, = struct.unpack("B", _data[0])
- addr2, = struct.unpack("B", _data[1])
- addr3, = struct.unpack("B", _data[2])
- addr4, = struct.unpack("B", _data[3])
+ sumc, = struct.unpack("B", _data[5+length:])
+ addr1, = struct.unpack("B", _data[0:1])
+ addr2, = struct.unpack("B", _data[1:2])
+ addr3, = struct.unpack("B", _data[2:3])
+ addr4, = struct.unpack("B", _data[3:4])
else: # But this one has been tested for raw mode radio (IC-2730)
saddr, = struct.unpack(">H", _data[0:2])
- length, = struct.unpack("B", _data[2])
+ length, = struct.unpack("B", _data[2:3])
data = _data[3:3+length]
- sumc, = struct.unpack("B", _data[3+length])
- addr1, = struct.unpack("B", _data[0])
- addr2, = struct.unpack("B", _data[1])
+ sumc, = struct.unpack("B", _data[3+length:])
+ addr1, = struct.unpack("B", _data[0:1])
+ addr2, = struct.unpack("B", _data[1:2])
addr3 = 0
addr4 = 0
cs = addr1 + addr2 + addr3 + addr4 + length
for byte in data:
- cs += ord(byte)
+ cs += byte
vx = ((cs ^ 0xFFFF) + 1) & 0xFF
if sumc != vx:
LOG.error("Bad checksum in address %04X frame: %02x "
@@ -231,16 +246,16 @@ def process_data_frame(radio, frame, _mmap):
_mmap[saddr] = data
except IndexError:
LOG.error("Error trying to set %i bytes at %05x (max %05x)" %
- (bytes, saddr, len(_mmap)))
+ (length, saddr, len(_mmap)))
return saddr, saddr + length
def start_hispeed_clone(radio, cmd):
"""Send the magic incantation to the radio to go fast"""
- buf = ("\xFE" * 20) + \
- "\xEE\xEF\xE8" + \
- radio.get_model() + \
- "\x00\x00\x02\x01\xFD"
+ buf = ((bytes(b"\xFE") * 20) +
+ bytes(b"\xEE\xEF\xE8") +
+ radio.get_model() +
+ bytes(b"\x00\x00\x02\x01\xFD"))
LOG.debug("Starting HiSpeed:\n%s" % util.hexprint(buf))
radio.pipe.write(buf)
radio.pipe.flush()
@@ -250,11 +265,11 @@ def start_hispeed_clone(radio, cmd):
LOG.info("Switching to 38400 baud")
radio.pipe.baudrate = 38400
- buf = ("\xFE" * 14) + \
- "\xEE\xEF" + \
- chr(cmd) + \
- radio.get_model()[:3] + \
- "\x00\xFD"
+ buf = ((bytes(b"\xFE") * 14) +
+ bytes(b"\xEE\xEF") +
+ bytes([cmd]) +
+ radio.get_model()[:3] +
+ bytes(b"\x00\xFD"))
LOG.debug("Starting HiSpeed Clone:\n%s" % util.hexprint(buf))
radio.pipe.write(buf)
radio.pipe.flush()
@@ -271,14 +286,16 @@ def _clone_from_radio(radio):
if radio.is_hispeed():
start_hispeed_clone(radio, CMD_CLONE_OUT)
else:
- send_clone_frame(radio, CMD_CLONE_OUT, radio.get_model(), raw=True)
+ send_clone_frame(radio, CMD_CLONE_OUT,
+ radio.get_model(),
+ raw=True)
LOG.debug("Sent clone frame")
stream = RadioStream(radio.pipe)
addr = 0
- _mmap = memmap.MemoryMap(chr(0x00) * radio.get_memsize())
+ _mmap = memmap.MemoryMapBytes(bytes(b'\x00') * radio.get_memsize())
last_size = 0
while True:
frames = stream.get_frames()
@@ -314,13 +331,13 @@ def clone_from_radio(radio):
"""Do a full clone out of the radio's memory"""
try:
return _clone_from_radio(radio)
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with the radio: %s" % e)
def send_mem_chunk(radio, start, stop, bs=32):
"""Send a single chunk of the radio's memory from @start-@stop"""
- _mmap = radio.get_mmap()
+ _mmap = radio.get_mmap().get_byte_compatible()
status = chirp_common.Status()
status.msg = "Cloning to radio"
@@ -372,7 +389,9 @@ def _clone_to_radio(radio):
if radio.is_hispeed():
start_hispeed_clone(radio, CMD_CLONE_IN)
else:
- send_clone_frame(radio, CMD_CLONE_IN, radio.get_model(), raw=True)
+ send_clone_frame(radio, CMD_CLONE_IN,
+ radio.get_model(),
+ raw=True)
frames = []
@@ -381,7 +400,9 @@ def _clone_to_radio(radio):
break
frames += stream.get_frames()
- send_clone_frame(radio, CMD_CLONE_END, radio.get_endframe(), raw=True)
+ send_clone_frame(radio, CMD_CLONE_END,
+ radio.get_endframe(),
+ raw=True)
if SAVE_PIPE:
SAVE_PIPE.close()
@@ -398,14 +419,14 @@ def _clone_to_radio(radio):
if len(frames) == 0:
raise errors.RadioError("Did not get clone result from radio")
- return result.payload[0] == '\x00'
+ return result.payload[0] == bytes(b'\x00')
def clone_to_radio(radio):
"""Initiate a full memory clone out to @radio"""
try:
return _clone_to_radio(radio)
- except Exception, e:
+ except Exception as e:
logging.exception("Failed to communicate with the radio")
raise errors.RadioError("Failed to communicate with the radio: %s" % e)
@@ -444,7 +465,7 @@ def convert_data_line(line):
val = int("%s%s" % (data[i], data[i+1]), 16)
i += 2
_mmap += struct.pack("B", val)
- except ValueError, e:
+ except ValueError as e:
LOG.debug("Failed to parse byte: %s" % e)
break
@@ -470,19 +491,25 @@ def read_file(filename):
def is_9x_icf(filename):
"""Returns True if @filename is an IC9x ICF file"""
- f = file(filename)
- mdata = f.read(8)
- f.close()
+ try:
+ with open(filename) as f:
+ mdata = f.read(8)
+ except UnicodeDecodeError:
+ # ICF files are ASCII, so any unicode failure means no.
+ return False
return mdata in ["30660000", "28880000"]
def is_icf_file(filename):
"""Returns True if @filename is an ICF file"""
- f = file(filename)
- data = f.readline()
- data += f.readline()
- f.close()
+ try:
+ with open(filename) as f:
+ data = f.readline()
+ data += f.readline()
+ except UnicodeDecodeError:
+ # ICF files are ASCII, so any unicode failure means no.
+ return False
data = data.replace("\n", "").replace("\r", "")
@@ -560,7 +587,7 @@ class IcomIndexedBankModel(IcomBankModel,
raise Exception("Memory %i is not in bank %s" % (memory.number,
bank))
- if index not in range(*self._radio._bank_index_bounds):
+ if index not in list(range(*self._radio._bank_index_bounds)):
raise Exception("Invalid index")
self._radio._set_bank_index(memory.number, index)
@@ -580,7 +607,7 @@ class IcomIndexedBankModel(IcomBankModel,
def compute_checksum(data):
cs = 0
for byte in data:
- cs += ord(byte)
+ cs += byte
return ((cs ^ 0xFFFF) + 1) & 0xFF
@@ -588,6 +615,7 @@ class IcomCloneModeRadio(chirp_common.CloneModeRadio):
"""Base class for Icom clone-mode radios"""
VENDOR = "Icom"
BAUDRATE = 9600
+ NEEDS_COMPAT_SERIAL = False
# Ideally, the driver should read clone response after each clone frame
# is sent, but for some reason it hasn't behaved this way for years.
# So not to break the existing tested drivers the MUNCH_CLONE_RESP flag
@@ -614,12 +642,12 @@ class IcomCloneModeRadio(chirp_common.CloneModeRadio):
@classmethod
def get_model(cls):
"""Returns the Icom model data for this radio"""
- return cls._model
+ return bytes([ord(x) for x in cls._model])
@classmethod
def get_endframe(cls):
"""Returns the magic clone end frame for this radio"""
- return cls._endframe
+ return bytes([ord(x) for x in cls._endframe])
@classmethod
def get_ranges(cls):
@@ -629,15 +657,17 @@ class IcomCloneModeRadio(chirp_common.CloneModeRadio):
def process_frame_payload(self, payload):
"""Convert BCD-encoded data to raw"""
bcddata = payload
- data = ""
+ data = bytes()
i = 0
while i+1 < len(bcddata):
try:
- val = int("%s%s" % (bcddata[i], bcddata[i+1]), 16)
+ val = int("%s%s" % (chr(bcddata[i]), chr(bcddata[i+1])), 16)
i += 2
data += struct.pack("B", val)
- except ValueError, e:
- LOG.error("Failed to parse byte: %s" % e)
+ except (ValueError, TypeError) as e:
+ LOG.error("Failed to parse byte %i (%r): %s" % (i,
+ bcddata[i:i+2],
+ e))
break
return data
@@ -646,11 +676,11 @@ class IcomCloneModeRadio(chirp_common.CloneModeRadio):
"""Returns the data with optional checksum BCD-encoded for the radio"""
if raw:
return data
- payload = ""
+ payload = bytes()
for byte in data:
- payload += "%02X" % ord(byte)
+ payload += bytes(b"%02X" % byte)
if checksum:
- payload += "%02X" % compute_checksum(data)
+ payload += bytes(b"%02X" % compute_checksum(data))
return payload
def sync_in(self):
@@ -696,45 +726,42 @@ def escape_raw_byte(byte):
# Certain bytes are used as control characters to the radio, so if one of
# these bytes is present in the stream to the radio, it gets escaped as
# 0xff followed by (byte & 0x0f)
- if ord(byte) > 0xf9:
- return "\xff%s" % (chr(ord(byte) & 0xf))
- return byte
+ if byte > 0xf9:
+ return bytes([0xff, byte & 0xf])
+ return bytes([byte])
def unescape_raw_bytes(escaped_data):
"""Unescapes raw bytes from the radio."""
- data = ""
+ data = b""
i = 0
while i < len(escaped_data):
byte = escaped_data[i]
- if byte == '\xff':
+ if byte == 0xff:
if i + 1 >= len(escaped_data):
raise errors.InvalidDataError(
"Unexpected escape character at end of data")
i += 1
- byte = chr(0xf0 | ord(escaped_data[i]))
- data += byte
+ byte = 0xf0 | escaped_data[i]
+ data += bytes([byte])
i += 1
return data
class IcomRawCloneModeRadio(IcomCloneModeRadio):
"""Subclass for Icom clone-mode radios using the raw data protocol."""
-
def process_frame_payload(self, payload):
"""Payloads from a raw-clone-mode radio are already in raw format."""
return unescape_raw_bytes(payload)
def get_payload(self, data, raw, checksum):
"""Returns the data with optional checksum in raw format."""
+ payload = data
if checksum:
- cs = chr(compute_checksum(data))
- else:
- cs = ""
- payload = "%s%s" % (data, cs)
+ payload += bytes([compute_checksum(data)])
# Escape control characters.
- escaped_payload = [escape_raw_byte(b) for b in payload]
- return "".join(escaped_payload)
+ escaped_payload = b''.join([escape_raw_byte(b) for b in payload])
+ return escaped_payload
def sync_in(self):
# The radio returns all the bytes with the high-order bit flipped.
diff --git a/chirp/drivers/icp7.py b/chirp/drivers/icp7.py
index 04db27e..c9a2459 100644
--- a/chirp/drivers/icp7.py
+++ b/chirp/drivers/icp7.py
@@ -161,8 +161,8 @@ class ICP7Radio(icf.IcomCloneModeRadio):
mem.empty = True
return mem
- mem.freq = _mem.freq / 3
- mem.offset = _mem.offset / 3
+ mem.freq = _mem.freq // 3
+ mem.offset = _mem.offset // 3
mem.tmode = TMODES[_mem.tmode]
mem.duplex = DUPLEX[_mem.duplex]
mem.tuning_step = TUNING_STEPS[_mem.tuning_step]
diff --git a/chirp/drivers/icq7.py b/chirp/drivers/icq7.py
index 45bd122..7a081b9 100644
--- a/chirp/drivers/icq7.py
+++ b/chirp/drivers/icq7.py
@@ -190,7 +190,7 @@ class ICQ7Radio(icf.IcomCloneModeRadio):
_mem.set_raw("\x00" * 8)
if mem.freq > to_GHz(1):
- _mem.freq = (mem.freq / 1000) - to_GHz(1)
+ _mem.freq = (mem.freq // 1000) - to_GHz(1)
upper = from_GHz(mem.freq) << 4
_mem.freq[0].clr_bits(0xF0)
_mem.freq[0].set_bits(upper)
@@ -344,6 +344,6 @@ class ICQ7Radio(icf.IcomCloneModeRadio):
else:
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/ict70.py b/chirp/drivers/ict70.py
index 4066c69..f05eb21 100644
--- a/chirp/drivers/ict70.py
+++ b/chirp/drivers/ict70.py
@@ -185,7 +185,7 @@ class ICT70Radio(icf.IcomCloneModeRadio):
_skp = self._memobj.skips[byte]
_psk = self._memobj.pskips[byte]
- _mem.set_raw("\x00" * (_mem.size() / 8))
+ _mem.set_raw("\x00" * (_mem.size() // 8))
if mem.empty:
_usd |= bit
@@ -194,10 +194,10 @@ class ICT70Radio(icf.IcomCloneModeRadio):
_usd &= ~bit
if chirp_common.is_12_5(mem.freq):
- _mem.freq = (mem.freq / 6250) | 0x800000
+ _mem.freq = (mem.freq // 6250) | 0x800000
else:
- _mem.freq = mem.freq / 5000
- _mem.offset = mem.offset / 5000
+ _mem.freq = mem.freq // 5000
+ _mem.offset = mem.offset // 5000
_mem.name = mem.name.ljust(6)[:6]
_mem.rtone = chirp_common.TONES.index(mem.rtone)
_mem.ctone = chirp_common.TONES.index(mem.ctone)
diff --git a/chirp/drivers/ict7h.py b/chirp/drivers/ict7h.py
index 5648261..9a28646 100644
--- a/chirp/drivers/ict7h.py
+++ b/chirp/drivers/ict7h.py
@@ -89,7 +89,7 @@ class ICT7HRadio(icf.IcomCloneModeRadio):
mem.freq = int(_mem.freq) * 100000
mem.freq += _mem.lastfreq * 10000
- mem.freq += int((_mem.fraction / 2.0) * 1000)
+ mem.freq += int(_mem.fraction / 2.0 * 1000)
mem.offset = int(_mem.offset) * 10000
mem.rtone = chirp_common.TONES[_mem.rtone - 1]
@@ -111,7 +111,7 @@ class ICT7HRadio(icf.IcomCloneModeRadio):
lastfreq = int((mem.freq - topfreq) / 10000)
_mem.lastfreq = lastfreq
midfreq = (mem.freq - topfreq - lastfreq * 10000)
- _mem.fraction = midfreq / 500
+ _mem.fraction = midfreq // 500
_mem.offset = mem.offset / 10000
_mem.rtone = chirp_common.TONES.index(mem.rtone) + 1
diff --git a/chirp/drivers/ict8.py b/chirp/drivers/ict8.py
index 168c657..299333a 100644
--- a/chirp/drivers/ict8.py
+++ b/chirp/drivers/ict8.py
@@ -55,7 +55,7 @@ def _get_freq(bcd_array):
def _set_freq(bcd_array, freq):
bitwise.int_to_bcd(bcd_array, freq / 1000)
- bcd_array[2].set_raw(bcd_array[2].get_bits(0xF0) + freq % 10000 / 500)
+ bcd_array[2].set_raw(bcd_array[2].get_bits(0xF0) + freq % 10000 // 500)
@directory.register
diff --git a/chirp/drivers/icw32.py b/chirp/drivers/icw32.py
index fd11bd7..0276a0c 100644
--- a/chirp/drivers/icw32.py
+++ b/chirp/drivers/icw32.py
@@ -191,7 +191,7 @@ class ICW32ARadio(icf.IcomCloneModeRadio):
def match_model(cls, filedata, filename):
if not len(filedata) == cls._memsize:
return False
- return filedata[-16:] == "IcomCloneFormat3"
+ return filedata[-16:] == b"IcomCloneFormat3"
class ICW32ARadioVHF(ICW32ARadio):
@@ -231,8 +231,8 @@ class ICW32ERadio(ICW32ARadio):
def match_model(cls, filedata, filename):
if not len(filedata) == cls._memsize:
return False
- return filedata[-16 - 1: -1] == "IcomCloneFormat3" and \
- filedata[-1] == chr(0x00)
+ return filedata[-16 - 1: -1] == b"IcomCloneFormat3" and \
+ filedata[-1] in [0, '\x00']
# this is the very same as ICW32ARadioVHF but have ICW32ERadio as parent class
diff --git a/chirp/drivers/icx8x.py b/chirp/drivers/icx8x.py
index 9958ec1..b8f1533 100644
--- a/chirp/drivers/icx8x.py
+++ b/chirp/drivers/icx8x.py
@@ -24,7 +24,7 @@ LOG = logging.getLogger(__name__)
def _isuhf(radio):
try:
md = icf.get_model_data(radio)
- val = ord(md[20])
+ val = md[20]
uhf = val & 0x10
except:
raise errors.RadioError("Unable to probe radio band")
@@ -39,6 +39,7 @@ class ICx8xRadio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
"""Icom IC-V/U82"""
VENDOR = "Icom"
MODEL = "IC-V82/U82"
+ NEEDS_COMPAT_SERIAL = True
_model = "\x28\x26\x00\x01"
_memsize = 6464
diff --git a/chirp/drivers/icx8x_ll.py b/chirp/drivers/icx8x_ll.py
index ffbfa12..ea380a2 100644
--- a/chirp/drivers/icx8x_ll.py
+++ b/chirp/drivers/icx8x_ll.py
@@ -18,6 +18,7 @@ import struct
from chirp import chirp_common, errors
from chirp.memmap import MemoryMap
from chirp.chirp_common import to_MHz
+from chirp.util import StringStruct as struct
POS_FREQ_START = 0
POS_FREQ_END = 2
@@ -82,7 +83,7 @@ def set_freq(mmap, freq, base):
else:
mult = 5000
- value = (freq - to_MHz(base)) / mult
+ value = (freq - to_MHz(base)) // mult
mmap[POS_MULT_FLAG] = tflag
mmap[POS_FREQ_START] = struct.pack("<H", value)
@@ -155,7 +156,7 @@ def get_dup_offset(mmap):
def set_dup_offset(mmap, offset):
- val = struct.pack("<H", offset / 5000)
+ val = struct.pack("<H", offset // 5000)
mmap[POS_OFFSET] = val
@@ -367,7 +368,7 @@ def get_bank(mmap, number):
def set_bank(mmap, number, bank):
- if bank > 9:
+ if bank is not None and bank > 9:
raise errors.InvalidDataError("Invalid bank number %i" % bank)
if bank is None:
diff --git a/chirp/drivers/id31.py b/chirp/drivers/id31.py
index 9883682..97d1c4b 100644
--- a/chirp/drivers/id31.py
+++ b/chirp/drivers/id31.py
@@ -143,8 +143,8 @@ def _set_freq(_mem, freq, offset):
mult = 5000
flag = 0x00000000
- _mem.freq = (freq / mult) | flag
- _mem.offset = (offset / mult)
+ _mem.freq = (freq // mult) | flag
+ _mem.offset = (offset // mult)
class ID31Bank(icf.IcomBank):
@@ -206,7 +206,7 @@ class ID31Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
rf.has_bank_names = True
rf.valid_tmodes = list(TMODES)
rf.valid_tuning_steps = sorted(list(TUNING_STEPS))
- rf.valid_modes = self.MODES.values()
+ rf.valid_modes = list(self.MODES.values())
rf.valid_skips = ["", "S", "P"]
rf.valid_characters = chirp_common.CHARSET_ASCII
rf.valid_name_length = 16
@@ -283,7 +283,7 @@ class ID31Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
_mem.dtcs = chirp_common.DTCS_CODES.index(memory.dtcs)
_mem.dtcs_polarity = DTCS_POLARITY.index(memory.dtcs_polarity)
_mem.tune_step = TUNING_STEPS.index(memory.tuning_step)
- _mem.mode = next(i for i, mode in self.MODES.items()
+ _mem.mode = next(i for i, mode in list(self.MODES.items())
if mode == memory.mode)
if isinstance(memory, chirp_common.DVMemory):
@@ -332,6 +332,6 @@ class ID31Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
return calls
if __name__ == "__main__":
- print repr(_decode_call(_encode_call("KD7REX B")))
- print repr(_decode_call(_encode_call(" B")))
- print repr(_decode_call(_encode_call(" ")))
+ print(repr(_decode_call(_encode_call("KD7REX B"))))
+ print(repr(_decode_call(_encode_call(" B"))))
+ print(repr(_decode_call(_encode_call(" "))))
diff --git a/chirp/drivers/id51.py b/chirp/drivers/id51.py
index 058f120..c914230 100644
--- a/chirp/drivers/id51.py
+++ b/chirp/drivers/id51.py
@@ -12,6 +12,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from builtins import bytes
+
import logging
from chirp.drivers import id31
@@ -114,11 +116,11 @@ class ID51Radio(id31.ID31Radio):
if len(filedata) == cls._memsize:
LOG.debug('File has correct memory size, '
'checking 20 bytes at offset 0x1AF40')
- snip = filedata[0x1AF40:0x1AF60]
- if snip == ('\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
- '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
- '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
- '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'):
+ snip = bytes(filedata[0x1AF40:0x1AF60])
+ if snip == bytes(b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
+ b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
+ b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
+ b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'):
LOG.debug('bytes matched ID-51 Signature')
return True
else:
diff --git a/chirp/drivers/id51plus.py b/chirp/drivers/id51plus.py
index 7157be9..fc4812f 100644
--- a/chirp/drivers/id51plus.py
+++ b/chirp/drivers/id51plus.py
@@ -12,6 +12,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from builtins import bytes
+
import logging
from chirp.drivers import id31
@@ -125,11 +127,11 @@ class ID51PLUSRadio(id31.ID31Radio):
if len(filedata) == cls._memsize:
LOG.debug('File has correct memory size, '
'checking 20 bytes at offset 0x1AF40')
- snip = filedata[0x1AF40:0x1AF60]
- if snip != ('\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
- '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
- '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
- '\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'):
+ snip = bytes(filedata[0x1AF40:0x1AF60])
+ if snip != bytes(b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
+ b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
+ b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
+ b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'):
LOG.debug('bytes matched ID-51 Plus Signature')
return True
else:
diff --git a/chirp/drivers/id880.py b/chirp/drivers/id880.py
index 5236f82..19c2c00 100644
--- a/chirp/drivers/id880.py
+++ b/chirp/drivers/id880.py
@@ -151,7 +151,7 @@ def _encode_freq(freq):
def _wipe_memory(mem, char):
- mem.set_raw(char * (mem.size() / 8))
+ mem.set_raw(char * (mem.size() // 8))
class ID880Bank(icf.IcomNamedBank):
diff --git a/chirp/drivers/kenwood_hmk.py b/chirp/drivers/kenwood_hmk.py
index bf3d5db..65a9ccc 100644
--- a/chirp/drivers/kenwood_hmk.py
+++ b/chirp/drivers/kenwood_hmk.py
@@ -79,7 +79,7 @@ class HMKRadio(generic_csv.CSVRadio):
self._blank()
- f = file(self._filename, "r")
+ f = open(self._filename, "r")
for line in f:
if line.strip() == "// Memory Channels":
break
@@ -114,7 +114,7 @@ class HMKRadio(generic_csv.CSVRadio):
mem = self._parse_csv_data_line(header, line)
if mem.number is None:
raise Exception("Invalid Location field" % lineno)
- except Exception, e:
+ except Exception as e:
LOG.error("Line %i: %s" % (lineno, e))
self.errors.append("Line %i: %s" % (lineno, e))
continue
diff --git a/chirp/drivers/kenwood_itm.py b/chirp/drivers/kenwood_itm.py
index ef5caff..dd7fc24 100644
--- a/chirp/drivers/kenwood_itm.py
+++ b/chirp/drivers/kenwood_itm.py
@@ -118,7 +118,7 @@ class ITMRadio(generic_csv.CSVRadio):
mem = self._parse_csv_data_line(header, line)
if mem.number is None:
raise Exception("Invalid Location field" % lineno)
- except Exception, e:
+ except Exception as e:
LOG.error("Line %i: %s" % (lineno, e))
self.errors.append("Line %i: %s" % (lineno, e))
continue
diff --git a/chirp/drivers/kenwood_live.py b/chirp/drivers/kenwood_live.py
index 6117fd7..33981d5 100644
--- a/chirp/drivers/kenwood_live.py
+++ b/chirp/drivers/kenwood_live.py
@@ -79,12 +79,12 @@ def command(ser, cmd, *args):
cmd += LAST_DELIMITER[1] + LAST_DELIMITER[1].join(args)
cmd += LAST_DELIMITER[0]
- LOG.debug("PC->RADIO: %r" % cmd.strip())
- ser.write(cmd)
+ LOG.debug("PC->RADIO: %s" % cmd.strip())
+ ser.write(cmd.encode())
result = ""
while not result.endswith(LAST_DELIMITER[0]):
- result += ser.read(COMMAND_RESP_BUFSIZE)
+ result += ser.read(COMMAND_RESP_BUFSIZE).decode()
if (time.time() - start) > 0.5:
LOG.error("Timeout waiting for data")
break
@@ -119,7 +119,7 @@ def get_id(ser):
LOG.info("Trying ID at baud %i with delimiter \"%s\"" %
(i, repr(delimiter)))
ser.baudrate = i
- ser.write(LAST_DELIMITER[0])
+ ser.write(LAST_DELIMITER[0].encode())
ser.read(25)
resp = command(ser, "ID")
@@ -139,7 +139,7 @@ def get_id(ser):
return resp.split(" ")[1]
# Kenwood radios that return ID numbers
- if resp in RADIO_IDS.keys():
+ if resp in list(RADIO_IDS.keys()):
return RADIO_IDS[resp]
raise errors.RadioError("No response from radio")
@@ -167,6 +167,7 @@ class KenwoodLiveRadio(chirp_common.LiveRadio):
BAUD_RATE = 9600
VENDOR = "Kenwood"
MODEL = ""
+ NEEDS_COMPAT_SERIAL = False
_vfo = 0
_upper = 200
@@ -426,7 +427,7 @@ class THD7Radio(KenwoodOldLiveRadio):
rf.has_tuning_step = False
rf.can_odd_split = True
rf.valid_duplexes = ["", "-", "+", "split"]
- rf.valid_modes = MODES.values()
+ rf.valid_modes = list(MODES.values())
rf.valid_tmodes = ["", "Tone", "TSQL"]
rf.valid_characters = \
chirp_common.CHARSET_ALPHANUMERIC + "/.-+*)('&%$#! ~}|{"
@@ -887,7 +888,7 @@ class THF6ARadio(KenwoodLiveRadio):
rf.valid_tuning_steps = list(THF6A_STEPS)
rf.valid_bands = [(1000, 1300000000)]
rf.valid_skips = ["", "S"]
- rf.valid_duplexes = THF6A_DUPLEX.values()
+ rf.valid_duplexes = list(THF6A_DUPLEX.values())
rf.valid_characters = chirp_common.CHARSET_ASCII
rf.valid_name_length = 8
rf.memory_bounds = (0, self._upper)
diff --git a/chirp/drivers/repeaterbook.py b/chirp/drivers/repeaterbook.py
index 26a34fd..3b68660 100644
--- a/chirp/drivers/repeaterbook.py
+++ b/chirp/drivers/repeaterbook.py
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import six
+
from chirp import chirp_common
from chirp.drivers import generic_csv
@@ -23,10 +25,12 @@ class RBRadio(generic_csv.CSVRadio, chirp_common.NetworkSourceRadio):
def _clean_comment(self, headers, line, mem):
"Converts iso-8859-1 encoded comments to unicode for pyGTK."
- mem.comment = unicode(mem.comment, 'iso-8859-1')
+ if six.PY2:
+ mem.comment = six.text_type(mem.comment, 'iso-8859-1')
return mem
def _clean_name(self, headers, line, mem):
"Converts iso-8859-1 encoded names to unicode for pyGTK."
- mem.name = unicode(mem.name, 'iso-8859-1')
+ if six.PY2:
+ mem.name = six.text_type(mem.name, 'iso-8859-1')
return mem
diff --git a/chirp/drivers/th350.py b/chirp/drivers/th350.py
index 3994f28..39475db 100644
--- a/chirp/drivers/th350.py
+++ b/chirp/drivers/th350.py
@@ -14,11 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import division
+
import struct
import logging
from math import floor
from chirp import chirp_common, directory, bitwise, memmap, errors, util
-from uvb5 import BaofengUVB5
+from .uvb5 import BaofengUVB5
LOG = logging.getLogger(__name__)
@@ -176,21 +178,21 @@ struct {
def do_ident(radio):
radio.pipe.timeout = 3
- radio.pipe.write("\x05TROGRAM")
- for x in xrange(10):
+ radio.pipe.write(b"\x05TROGRAM")
+ for x in range(10):
ack = radio.pipe.read(1)
- if ack == '\x06':
+ if ack == b'\x06':
break
else:
raise errors.RadioError("Radio did not ack programming mode")
- radio.pipe.write("\x02")
+ radio.pipe.write(b"\x02")
ident = radio.pipe.read(8)
LOG.debug(util.hexprint(ident))
- if not ident.startswith('HKT511'):
+ if not ident.startswith(b'HKT511'):
raise errors.RadioError("Unsupported model")
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
raise errors.RadioError("Radio did not ack ident")
@@ -204,11 +206,11 @@ def do_status(radio, direction, addr):
def do_download(radio):
do_ident(radio)
- data = "TH350 Radio Program data v1.08\x00\x00"
- data += ("\x00" * 16)
+ data = b"TRI350 Radio Program data v1.08\x00"
+ data += (b"\x00" * 16)
firstack = None
for i in range(0, 0x1000, 16):
- frame = struct.pack(">cHB", "R", i, 16)
+ frame = struct.pack(">cHB", b"R", i, 16)
radio.pipe.write(frame)
result = radio.pipe.read(20)
if frame[1:4] != result[1:4]:
@@ -217,19 +219,19 @@ def do_download(radio):
data += result[4:]
do_status(radio, "from", i)
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def do_upload(radio):
do_ident(radio)
- data = radio._mmap[0x0030:]
+ data = radio._mmap.get_byte_compatible()[0x0030:]
for i in range(0, 0x1000, 16):
- frame = struct.pack(">cHB", "W", i, 16)
+ frame = struct.pack(">cHB", b"W", i, 16)
frame += data[i:i + 16]
radio.pipe.write(frame)
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
# UV-B5/UV-B6 radios with 27 menus do not support service settings
# and will stop ACKing when the upload reaches 0x0F10
if i == 0x0F10:
@@ -255,6 +257,7 @@ class Th350Radio(BaofengUVB5):
VENDOR = "TYT"
MODEL = "TH-350"
BAUD_RATE = 9600
+ NEEDS_COMPAT_SERIAL = False
SPECIALS = {
"VFO1": -3,
"VFO2": -2,
@@ -290,7 +293,7 @@ class Th350Radio(BaofengUVB5):
(220000000, 269000000),
(400000000, 520000000)]
rf.valid_modes = ["FM", "NFM"]
- rf.valid_special_chans = self.SPECIALS.keys()
+ rf.valid_special_chans = list(self.SPECIALS.keys())
rf.valid_power_levels = POWER_LEVELS
rf.has_ctone = True
rf.has_bank = False
@@ -303,7 +306,7 @@ class Th350Radio(BaofengUVB5):
self._mmap = do_download(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
self.process_mmap()
@@ -312,7 +315,7 @@ class Th350Radio(BaofengUVB5):
do_upload(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
def process_mmap(self):
@@ -320,7 +323,7 @@ class Th350Radio(BaofengUVB5):
def _decode_tone(self, _mem, which):
def _get(field):
- return getattr(_mem, "%s%s" % (which, field))
+ return int(getattr(_mem, "%s%s" % (which, field)))
tonea, toneb = _get('tonea'), _get('toneb')
@@ -332,24 +335,24 @@ class Th350Radio(BaofengUVB5):
# D754I -> 0xc7 0x54
# Yes. Decimal digits as hex. You're seeing that right.
# No idea why TYT engineers would do something like that.
- pold = tonea / 16
+ pold = tonea // 16
if pold not in [0x8, 0xc]:
LOG.warn("Bug: tone is %04x %04x" % (tonea, toneb))
mode = val = pol = None
else:
mode = 'DTCS'
- val = (tonea % 16) * 100 + \
- toneb / 16 * 10 + \
- (toneb % 16)
+ val = ((tonea % 16) * 100 +
+ toneb // 16 * 10 +
+ (toneb % 16))
pol = 'N' if pold == 8 else 'R'
else:
# Tone
# 107.2 -> 0x10 0x72. Seriously.
mode = 'Tone'
- val = tonea / 16 * 100 + \
- (tonea % 16) * 10 + \
- toneb / 16 + \
- float(toneb % 16) / 10
+ val = (tonea // 16 * 100 +
+ (tonea % 16) * 10 +
+ toneb // 16 +
+ toneb % 16 / 10)
pol = None
return mode, val, pol
@@ -360,8 +363,8 @@ class Th350Radio(BaofengUVB5):
if mode == "Tone":
tonea = int(
- floor(val / 100) * 16 +
- floor(val / 10) % 10
+ val // 100 * 16 +
+ val // 10 % 10
)
toneb = int(
floor(val % 10) * 16 +
@@ -369,8 +372,8 @@ class Th350Radio(BaofengUVB5):
)
elif mode == "DTCS":
tonea = (0x80 if pol == 'N' else 0xc0) + \
- val / 100
- toneb = (val / 10) % 10 * 16 + \
+ val // 100
+ toneb = (val // 10) % 10 * 16 + \
val % 10
else:
tonea = toneb = 0xff
@@ -382,7 +385,7 @@ class Th350Radio(BaofengUVB5):
if isinstance(number, str):
return (getattr(self._memobj, number.lower()), None)
elif number < 0:
- for k, v in self.SPECIALS.items():
+ for k, v in list(self.SPECIALS.items()):
if number == v:
return (getattr(self._memobj, k.lower()), None)
else:
@@ -391,5 +394,5 @@ class Th350Radio(BaofengUVB5):
@classmethod
def match_model(cls, filedata, filename):
- return (filedata.startswith("TH350 Radio Program data") and
+ return (filedata.startswith(b"TRI350 Radio Program data") and
len(filedata) == (cls._memsize + 0x30))
diff --git a/chirp/drivers/tk8102.py b/chirp/drivers/tk8102.py
index cd4a84c..f28a219 100644
--- a/chirp/drivers/tk8102.py
+++ b/chirp/drivers/tk8102.py
@@ -13,9 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import struct
+from builtins import bytes
import os
import logging
+import struct
from chirp import chirp_common, directory, memmap, errors, util
from chirp import bitwise
@@ -59,8 +60,8 @@ PTTID = ["", "BOT", "EOT", "Both"]
SIGNAL = ["", "DTMF"]
-def make_frame(cmd, addr, length, data=""):
- return struct.pack(">BHB", ord(cmd), addr, length) + data
+def make_frame(cmd, addr, length, data=b""):
+ return struct.pack(">BHB", ord(cmd), addr, length) + bytes(data)
def send(radio, frame):
@@ -78,23 +79,28 @@ def recv(radio, readdata=True):
raise errors.RadioError("Radio sent %i bytes (expected %i)" % (
len(data), length))
else:
- data = ""
- radio.pipe.write("\x06")
+ data = bytes(b"")
+ radio.pipe.write(b"\x06")
return addr, data
def do_ident(radio):
- send(radio, "PROGRAM")
+ send(radio, b"PROGRAM")
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != bytes(b"\x06"):
raise errors.RadioError("Radio refused program mode")
- radio.pipe.write("\x02")
+ radio.pipe.write(b"\x02")
ident = radio.pipe.read(8)
- if ident[1:5] != radio.MODEL.split("-")[1]:
+ try:
+ modelstr = ident[1:5].decode()
+ except UnicodeDecodeError:
+ LOG.debug('Model string was %r' % ident)
+ modelstr = '?'
+ if modelstr != radio.MODEL.split("-")[1]:
raise errors.RadioError("Incorrect model: TK-%s, expected %s" % (
- ident[1:5], radio.MODEL))
+ modelstr, radio.MODEL))
LOG.info("Model: %s" % util.hexprint(ident))
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
ack = radio.pipe.read(1)
@@ -103,16 +109,16 @@ def do_download(radio):
radio.pipe.timeout = 1
do_ident(radio)
- data = ""
+ data = bytes(b"")
for addr in range(0, 0x0400, 8):
- send(radio, make_frame("R", addr, 8))
+ send(radio, make_frame(bytes(b"R"), addr, 8))
_addr, _data = recv(radio)
if _addr != addr:
raise errors.RadioError("Radio sent unexpected address")
data += _data
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != bytes(b"\x06"):
raise errors.RadioError("Radio refused block at %04x" % addr)
status = chirp_common.Status()
@@ -121,11 +127,11 @@ def do_download(radio):
status.msg = "Cloning to radio"
radio.status_fn(status)
- radio.pipe.write("\x45")
+ radio.pipe.write(b"\x45")
- data = ("\x45\x58\x33\x34\x30\x32\xff\xff" + ("\xff" * 8) +
+ data = (b"\x45\x58\x33\x34\x30\x32\xff\xff" + (b"\xff" * 8) +
data)
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def do_upload(radio):
@@ -133,13 +139,14 @@ def do_upload(radio):
radio.pipe.timeout = 1
do_ident(radio)
+ mmap = radio._mmap.get_byte_compatible()
for addr in range(0, 0x0400, 8):
eaddr = addr + 16
- send(radio, make_frame("W", addr, 8, radio._mmap[eaddr:eaddr + 8]))
+ send(radio, make_frame(b"W", addr, 8, mmap[eaddr:eaddr + 8]))
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != bytes(b"\x06"):
raise errors.RadioError("Radio refused block at %04x" % addr)
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
status = chirp_common.Status()
status.cur = addr
@@ -147,7 +154,7 @@ def do_upload(radio):
status.msg = "Cloning to radio"
radio.status_fn(status)
- radio.pipe.write("\x45")
+ radio.pipe.write(b"\x45")
class KenwoodTKx102Radio(chirp_common.CloneModeRadio):
@@ -155,6 +162,7 @@ class KenwoodTKx102Radio(chirp_common.CloneModeRadio):
VENDOR = "Kenwood"
MODEL = "TK-x102"
BAUD_RATE = 9600
+ NEEDS_COMPAT_SERIAL = False
_memsize = 0x410
@@ -186,9 +194,9 @@ class KenwoodTKx102Radio(chirp_common.CloneModeRadio):
try:
self._mmap = do_download(self)
except errors.RadioError:
- self.pipe.write("\x45")
+ self.pipe.write(b"\x45")
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to download from radio: %s" % e)
self.process_mmap()
@@ -199,9 +207,9 @@ class KenwoodTKx102Radio(chirp_common.CloneModeRadio):
try:
do_upload(self)
except errors.RadioError:
- self.pipe.write("\x45")
+ self.pipe.write(b"\x45")
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to upload to radio: %s" % e)
def get_raw_memory(self, number):
diff --git a/chirp/drivers/uv5r.py b/chirp/drivers/uv5r.py
index 1e2b5cc..ea40d02 100644
--- a/chirp/drivers/uv5r.py
+++ b/chirp/drivers/uv5r.py
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from builtins import bytes
+
import struct
import time
import os
@@ -278,17 +280,18 @@ struct {
# 0x1EC0 - 0x2000
-vhf_220_radio = "\x02"
-
-BASETYPE_UV5R = ["BFS", "BFB", "N5R-2", "N5R2", "N5RV", "BTS", "D5R2", "B5R2"]
-BASETYPE_F11 = ["USA"]
-BASETYPE_UV82 = ["US2S2", "B82S", "BF82", "N82-2", "N822"]
-BASETYPE_BJ55 = ["BJ55"] # needed for for the Baojie UV-55 in bjuv55.py
-BASETYPE_UV6 = ["BF1", "UV6"]
-BASETYPE_KT980HP = ["BFP3V3 B"]
-BASETYPE_F8HP = ["BFP3V3 F", "N5R-3", "N5R3", "F5R3", "BFT"]
-BASETYPE_UV82HP = ["N82-3", "N823", "N5R2"]
-BASETYPE_UV82X3 = ["HN5RV01"]
+vhf_220_radio = bytes(b"\x02")
+
+BASETYPE_UV5R = [b"BFS", b"BFB", b"N5R-2", b"N5R2", b"N5RV", b"BTS", b"D5R2",
+ b"B5R2"]
+BASETYPE_F11 = [b"USA"]
+BASETYPE_UV82 = [b"US2S2", b"B82S", b"BF82", b"N82-2", b"N822"]
+BASETYPE_BJ55 = [b"BJ55"] # needed for for the Baojie UV-55 in bjuv55.py
+BASETYPE_UV6 = [b"BF1", b"UV6"]
+BASETYPE_KT980HP = [b"BFP3V3 B"]
+BASETYPE_F8HP = [b"BFP3V3 F", b"N5R-3", b"N5R3", b"F5R3", b"BFT"]
+BASETYPE_UV82HP = [b"N82-3", b"N823", b"N5R2"]
+BASETYPE_UV82X3 = [b"HN5RV01"]
BASETYPE_LIST = BASETYPE_UV5R + BASETYPE_F11 + BASETYPE_UV82 + \
BASETYPE_BJ55 + BASETYPE_UV6 + BASETYPE_KT980HP + \
BASETYPE_F8HP + BASETYPE_UV82HP + BASETYPE_UV82X3
@@ -366,13 +369,13 @@ def _do_status(radio, block):
status.max = radio.get_memsize()
radio.status_fn(status)
-UV5R_MODEL_ORIG = "\x50\xBB\xFF\x01\x25\x98\x4D"
-UV5R_MODEL_291 = "\x50\xBB\xFF\x20\x12\x07\x25"
-UV5R_MODEL_F11 = "\x50\xBB\xFF\x13\xA1\x11\xDD"
-UV5R_MODEL_UV82 = "\x50\xBB\xFF\x20\x13\x01\x05"
-UV5R_MODEL_UV6 = "\x50\xBB\xFF\x20\x12\x08\x23"
-UV5R_MODEL_UV6_ORIG = "\x50\xBB\xFF\x12\x03\x98\x4D"
-UV5R_MODEL_A58 = "\x50\xBB\xFF\x20\x14\x04\x13"
+UV5R_MODEL_ORIG = bytes(b"\x50\xBB\xFF\x01\x25\x98\x4D")
+UV5R_MODEL_291 = bytes(b"\x50\xBB\xFF\x20\x12\x07\x25")
+UV5R_MODEL_F11 = bytes(b"\x50\xBB\xFF\x13\xA1\x11\xDD")
+UV5R_MODEL_UV82 = bytes(b"\x50\xBB\xFF\x20\x13\x01\x05")
+UV5R_MODEL_UV6 = bytes(b"\x50\xBB\xFF\x20\x12\x08\x23")
+UV5R_MODEL_UV6_ORIG = bytes(b"\x50\xBB\xFF\x12\x03\x98\x4D")
+UV5R_MODEL_A58 = bytes(b"\x50\xBB\xFF\x20\x14\x04\x13")
def _upper_band_from_data(data):
@@ -389,9 +392,10 @@ def _firmware_version_from_data(data, version_start, version_stop):
def _firmware_version_from_image(radio):
- version = _firmware_version_from_data(radio.get_mmap(),
- radio._fw_ver_file_start,
- radio._fw_ver_file_stop)
+ version = _firmware_version_from_data(
+ radio.get_mmap().get_byte_compatible(),
+ radio._fw_ver_file_start,
+ radio._fw_ver_file_stop)
LOG.debug("_firmware_version_from_image: " + util.hexprint(version))
return version
@@ -402,16 +406,16 @@ def _do_ident(radio, magic, secondack=True):
LOG.info("Sending Magic: %s" % util.hexprint(magic))
for byte in magic:
- serial.write(byte)
+ serial.write(bytes([byte]))
time.sleep(0.01)
ack = serial.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
if ack:
LOG.debug(repr(ack))
raise errors.RadioError("Radio did not respond")
- serial.write("\x02")
+ serial.write(bytes(b"\x02"))
# Until recently, the "ident" returned by the radios supported by this
# driver have always been 8 bytes long. The image sturcture is the 8 byte
@@ -425,12 +429,12 @@ def _do_ident(radio, magic, secondack=True):
# image data aligned with the existing settings structures.
# Ok, get the response
- response = ""
+ response = bytes(b"")
for i in range(1, 13):
byte = serial.read(1)
response += byte
# stop reading once the last byte ("\xdd") is encountered
- if byte == "\xdd":
+ if byte == b"\xDD":
break
# check if response is OK
@@ -439,7 +443,8 @@ def _do_ident(radio, magic, secondack=True):
LOG.info("Valid response, got this:")
LOG.debug(util.hexprint(response))
if len(response) == 12:
- ident = response[0] + response[3] + response[5] + response[7:]
+ ident = (bytes([response[0], response[3], response[5]]) +
+ response[7:])
else:
ident = response
else:
@@ -450,9 +455,9 @@ def _do_ident(radio, magic, secondack=True):
raise errors.RadioError("Unexpected response from radio.")
if secondack:
- serial.write("\x06")
+ serial.write(b"\x06")
ack = serial.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
raise errors.RadioError("Radio refused clone")
return ident
@@ -464,7 +469,7 @@ def _read_block(radio, start, size, first_command=False):
if first_command is False:
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
raise errors.RadioError(
"Radio refused to send second block 0x%04x" % start)
@@ -485,7 +490,7 @@ def _read_block(radio, start, size, first_command=False):
LOG.error("Chunk length was 0x%04i" % len(chunk))
raise errors.RadioError("Radio sent incomplete block 0x%04x" % start)
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
time.sleep(0.05)
return chunk
@@ -504,7 +509,7 @@ def _get_radio_firmware_version(radio):
IDENT_BLACKLIST = {
- "\x50\x0D\x0C\x20\x16\x03\x28": "Radio identifies as BTECH UV-5X3",
+ b"\x50\x0D\x0C\x20\x16\x03\x28": "Radio identifies as BTECH UV-5X3",
}
@@ -514,12 +519,12 @@ def _ident_radio(radio):
try:
data = _do_ident(radio, magic)
return data
- except errors.RadioError, e:
+ except errors.RadioError as e:
LOG.error("uv5r._ident_radio: %s", e)
error = e
time.sleep(2)
- for magic, reason in IDENT_BLACKLIST.items():
+ for magic, reason in list(IDENT_BLACKLIST.items()):
try:
_do_ident(radio, magic, secondack=False)
except errors.RadioError as e:
@@ -545,7 +550,7 @@ def _do_download(radio):
radio_version = _get_radio_firmware_version(radio)
LOG.info("Radio Version is %s" % repr(radio_version))
- if "HN5RV" in radio_version:
+ if b"HN5RV" in radio_version:
# A radio with HN5RV firmware has been detected. It could be a
# UV-5R style radio with HIGH/LOW power levels or it could be a
# BF-F8HP style radio with HIGH/MID/LOW power levels.
@@ -553,7 +558,7 @@ def _do_download(radio):
# then append that model type to the end of the image so it can
# be properly detected when loaded.
append_model = True
- elif "\xFF" * 7 in radio_version:
+ elif b"\xFF" * 7 in radio_version:
# A radio UV-5R style radio that reports no firmware version has
# been detected.
# We are going to count on the user to make the right choice and
@@ -585,7 +590,7 @@ def _do_download(radio):
data += radio.MODEL.ljust(8)
LOG.debug("done.")
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def _send_block(radio, addr, data):
@@ -594,7 +599,7 @@ def _send_block(radio, addr, data):
time.sleep(0.05)
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
raise errors.RadioError("Radio refused to accept block 0x%04x" % addr)
@@ -631,7 +636,7 @@ def _do_upload(radio):
if image_version == radio_version:
image_matched_radio = True
- if image_version.startswith("HN5RV"):
+ if image_version.startswith(b"HN5RV"):
ranges_main = _ranges_main_default
ranges_aux = _ranges_aux_default + _ranges_aux_extra
elif image_version == 0xFF * 7:
@@ -651,13 +656,14 @@ def _do_upload(radio):
raise errors.RadioError(msg % (image_version, radio_version))
# Main block
+ mmap = radio.get_mmap().get_byte_compatible()
for start_addr, end_addr in ranges_main:
for i in range(start_addr, end_addr, 0x10):
- _send_block(radio, i - 0x08, radio.get_mmap()[i:i + 0x10])
+ _send_block(radio, i - 0x08, mmap[i:i + 0x10])
_do_status(radio, i)
_do_status(radio, radio.get_memsize())
- if len(radio.get_mmap().get_packed()) == 0x1808:
+ if len(mmap.get_packed()) == 0x1808:
LOG.info("Old image, not writing aux block")
return # Old image, no aux block
@@ -665,7 +671,7 @@ def _do_upload(radio):
for start_addr, end_addr in ranges_aux:
for i in range(start_addr, end_addr, 0x10):
addr = 0x1808 + (i - 0x1EC0)
- _send_block(radio, i, radio.get_mmap()[addr:addr + 0x10])
+ _send_block(radio, i, mmap[addr:addr + 0x10])
if not image_matched_radio:
msg = ("Upload finished, but the 'Other Settings' "
@@ -708,6 +714,7 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
VENDOR = "Baofeng"
MODEL = "UV-5R"
BAUD_RATE = 9600
+ NEEDS_COMPAT_SERIAL = False
_memsize = 0x1808
_basetype = BASETYPE_UV5R
@@ -809,7 +816,7 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
self._mmap = _do_download(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
self.process_mmap()
@@ -818,7 +825,7 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
_do_upload(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
def get_raw_memory(self, number):
@@ -1059,8 +1066,8 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
version_tag = _firmware_version_from_image(self)
LOG.debug("@_is_orig, version_tag: %s", util.hexprint(version_tag))
try:
- if 'BFB' in version_tag:
- idx = version_tag.index("BFB") + 3
+ if b'BFB' in version_tag:
+ idx = version_tag.index(b"BFB") + 3
version = int(version_tag[idx:idx + 3])
return version < 291
return False
@@ -1071,8 +1078,8 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
def _my_version(self):
version_tag = _firmware_version_from_image(self)
- if 'BFB' in version_tag:
- idx = version_tag.index("BFB") + 3
+ if b'BFB' in version_tag:
+ idx = version_tag.index(b"BFB") + 3
return int(version_tag[idx:idx + 3])
raise Exception("Unrecognized firmware version string")
@@ -1707,7 +1714,7 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
elif element.value.get_mutable():
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
@@ -1721,7 +1728,7 @@ class BaofengUV5R(chirp_common.CloneModeRadio,
value = int(val.get_value() * 10)
LOG.debug("Setting fm_presets = %s" % (value))
self._memobj.fm_presets = value
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/uvb5.py b/chirp/drivers/uvb5.py
index e4d53ba..a748cc3 100644
--- a/chirp/drivers/uvb5.py
+++ b/chirp/drivers/uvb5.py
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import division
+
import struct
import logging
from chirp import chirp_common, directory, bitwise, memmap, errors, util
@@ -175,21 +177,21 @@ struct {
def do_ident(radio):
radio.pipe.timeout = 3
- radio.pipe.write("\x05PROGRAM")
- for x in xrange(10):
+ radio.pipe.write(b"\x05PROGRAM")
+ for x in range(10):
ack = radio.pipe.read(1)
- if ack == '\x06':
+ if ack == b'\x06':
break
else:
raise errors.RadioError("Radio did not ack programming mode")
- radio.pipe.write("\x02")
+ radio.pipe.write(b"\x02")
ident = radio.pipe.read(8)
LOG.debug(util.hexprint(ident))
- if not ident.startswith('HKT511'):
+ if not ident.startswith(b'HKT511'):
raise errors.RadioError("Unsupported model")
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
raise errors.RadioError("Radio did not ack ident")
@@ -203,8 +205,8 @@ def do_status(radio, direction, addr):
def do_download(radio):
do_ident(radio)
- data = "KT511 Radio Program data v1.08\x00\x00"
- data += ("\x00" * 16)
+ data = b"KT511 Radio Program data v1.08\x00\x00"
+ data += (b"\x00" * 16)
firstack = None
for i in range(0, 0x1000, 16):
frame = struct.pack(">cHB", "R", i, 16)
@@ -213,7 +215,7 @@ def do_download(radio):
if frame[1:4] != result[1:4]:
LOG.debug(util.hexprint(result))
raise errors.RadioError("Invalid response for address 0x%04x" % i)
- radio.pipe.write("\x06")
+ radio.pipe.write(b"\x06")
ack = radio.pipe.read(1)
if not firstack:
firstack = ack
@@ -225,19 +227,19 @@ def do_download(radio):
data += result[4:]
do_status(radio, "from", i)
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def do_upload(radio):
do_ident(radio)
- data = radio._mmap[0x0030:]
+ data = radio._mmap.get_byte_compatible()[0x0030:]
for i in range(0, 0x1000, 16):
- frame = struct.pack(">cHB", "W", i, 16)
+ frame = struct.pack(">cHB", b"W", i, 16)
frame += data[i:i + 16]
radio.pipe.write(frame)
ack = radio.pipe.read(1)
- if ack != "\x06":
+ if ack != b"\x06":
# UV-B5/UV-B6 radios with 27 menus do not support service settings
# and will stop ACKing when the upload reaches 0x0F10
if i == 0x0F10:
@@ -264,6 +266,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
VENDOR = "Baofeng"
MODEL = "UV-B5"
BAUD_RATE = 9600
+ NEEDS_COMPAT_SERIAL = False
SPECIALS = {
"VFO1": -2,
"VFO2": -1,
@@ -315,7 +318,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
(220000000, 269000000),
(400000000, 520000000)]
rf.valid_modes = ["FM", "NFM"]
- rf.valid_special_chans = self.SPECIALS.keys()
+ rf.valid_special_chans = list(self.SPECIALS.keys())
rf.valid_power_levels = POWER_LEVELS
rf.has_ctone = True
rf.has_bank = False
@@ -328,7 +331,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
self._mmap = do_download(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
self.process_mmap()
@@ -337,7 +340,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
do_upload(self)
except errors.RadioError:
raise
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with radio: %s" % e)
def process_mmap(self):
@@ -385,7 +388,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
if isinstance(number, str):
return (getattr(self._memobj, number.lower()), None)
elif number < 0:
- for k, v in SPECIALS.items():
+ for k, v in list(SPECIALS.items()):
if number == v:
return (getattr(self._memobj, k.lower()), None)
else:
@@ -401,7 +404,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
else:
mem.number = number
- if _mem.freq.get_raw()[0] == "\xFF":
+ if _mem.freq.get_raw(asbytes=True)[0] == 0xff:
mem.empty = True
return mem
@@ -631,7 +634,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
RadioSettingValueBoolean(not _settings.ste_disabled))
basic.append(rs)
- _limit = int(self._memobj.limits.lower_vhf) / 10
+ _limit = int(self._memobj.limits.lower_vhf) // 10
rs = RadioSetting("limits.lower_vhf", "VHF Lower Limit (MHz)",
RadioSettingValueInteger(128, 270, _limit))
@@ -641,7 +644,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
rs.set_apply_callback(apply_limit, self._memobj.limits)
basic.append(rs)
- _limit = int(self._memobj.limits.upper_vhf) / 10
+ _limit = int(self._memobj.limits.upper_vhf) // 10
rs = RadioSetting("limits.upper_vhf", "VHF Upper Limit (MHz)",
RadioSettingValueInteger(128, 270, _limit))
@@ -651,7 +654,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
rs.set_apply_callback(apply_limit, self._memobj.limits)
basic.append(rs)
- _limit = int(self._memobj.limits.lower_uhf) / 10
+ _limit = int(self._memobj.limits.lower_uhf) // 10
rs = RadioSetting("limits.lower_uhf", "UHF Lower Limit (MHz)",
RadioSettingValueInteger(400, 520, _limit))
@@ -661,7 +664,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
rs.set_apply_callback(apply_limit, self._memobj.limits)
basic.append(rs)
- _limit = int(self._memobj.limits.upper_uhf) / 10
+ _limit = int(self._memobj.limits.upper_uhf) // 10
rs = RadioSetting("limits.upper_uhf", "UHF Upper Limit (MHz)",
RadioSettingValueInteger(400, 520, _limit))
@@ -770,7 +773,7 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
else:
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
@@ -779,14 +782,14 @@ class BaofengUVB5(chirp_common.CloneModeRadio,
try:
index = (int(element.get_name().split("_")[-1]))
val = element.value
- if val[0].get_value():
- value = int(val[1].get_value() * 10 - 650)
+ if list(val)[0].get_value():
+ value = int(list(val)[1].get_value() * 10 - 650)
else:
value = 0x01AF
LOG.debug("Setting fm_presets[%1i] = %s" % (index, value))
setting = self._memobj.fm_presets
setting[index] = value
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/vx2.py b/chirp/drivers/vx2.py
index dfec883..91867b6 100644
--- a/chirp/drivers/vx2.py
+++ b/chirp/drivers/vx2.py
@@ -268,7 +268,7 @@ class VX2BankModel(chirp_common.BankModel):
def _wipe_memory(mem):
- mem.set_raw("\x00" * (mem.size() / 8))
+ mem.set_raw("\x00" * (mem.size() // 8))
@directory.register
@@ -491,7 +491,7 @@ class VX2Radio(yaesu_clone.YaesuCloneModeRadio):
RadioSettingValueBoolean(_settings.dcsrev))
basic.append(rs)
- options = map(str, range(0, 12+1))
+ options = list(map(str, list(range(0, 12+1))))
rs = RadioSetting(
"dimmer", "Dimmer",
RadioSettingValueList(options, options[_settings.dimmer]))
@@ -572,13 +572,13 @@ class VX2Radio(yaesu_clone.YaesuCloneModeRadio):
RadioSettingValueList(options, options[_settings.mwmode]))
basic.append(rs)
- options = map(str, range(0, 15+1))
+ options = list(map(str, list(range(0, 15+1))))
rs = RadioSetting(
"nfm_sql", "NFM Sql",
RadioSettingValueList(options, options[_settings.nfm_sql]))
basic.append(rs)
- options = map(str, range(0, 8+1))
+ options = list(map(str, list(range(0, 8+1))))
rs = RadioSetting(
"wfm_sql", "WFM Sql",
RadioSettingValueList(options, options[_settings.wfm_sql]))
@@ -602,7 +602,7 @@ class VX2Radio(yaesu_clone.YaesuCloneModeRadio):
RadioSettingValueList(options, options[_settings.resume]))
basic.append(rs)
- options = ["off"] + map(str, range(1, 9+1))
+ options = ["off"] + list(map(str, list(range(1, 9+1))))
rs = RadioSetting(
"rfsql", "RF Sql",
RadioSettingValueList(options, options[_settings.rfsql]))
@@ -746,6 +746,6 @@ class VX2Radio(yaesu_clone.YaesuCloneModeRadio):
newval = self._encode_chars(newval, 6)
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval))
setattr(_settings, setting, newval)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/vx3.py b/chirp/drivers/vx3.py
index 31cd991..0eba272 100644
--- a/chirp/drivers/vx3.py
+++ b/chirp/drivers/vx3.py
@@ -345,7 +345,7 @@ class VX3BankModel(chirp_common.BankModel):
def _wipe_memory(mem):
- mem.set_raw("\x00" * (mem.size() / 8))
+ mem.set_raw("\x00" * (mem.size() // 8))
# the following settings are set to match the defaults
# on the radio, some of these fields are unknown
mem.name = [0xFF for _i in range(0, 6)]
@@ -792,7 +792,7 @@ class VX3Radio(yaesu_clone.YaesuCloneModeRadio):
_volumes = self._memobj.volumes
- opts = map(str, range(0, 33))
+ opts = list(map(str, list(range(0, 33))))
sound.append(RadioSetting(
"speaker_vol", "Speaker volume",
RadioSettingValueList(opts, opts[_volumes.speaker])))
@@ -812,22 +812,22 @@ class VX3Radio(yaesu_clone.YaesuCloneModeRadio):
RadioSettingValueList(
opts, opts[_settings.fm_broadcast_mode])))
- opts = map(str, range(16))
+ opts = list(map(str, list(range(16))))
sound.append(RadioSetting(
"sql_fm", "Squelch level (FM)",
RadioSettingValueList(opts, opts[_settings.sql_fm])))
- opts = map(str, range(9))
+ opts = list(map(str, list(range(9))))
sound.append(RadioSetting(
"sql_wfm", "Squelch level (WFM)",
RadioSettingValueList(opts, opts[_settings.sql_wfm])))
- opts = map(str, range(16))
+ opts = list(map(str, list(range(16))))
sound.append(RadioSetting(
"radio_am_sql", "Squelch level (Broadcast Radio AM)",
RadioSettingValueList(opts, opts[_settings.radio_am_sql])))
- opts = map(str, range(9))
+ opts = list(map(str, list(range(9))))
sound.append(RadioSetting(
"radio_fm_sql", "Squelch level (Broadcast Radio FM)",
RadioSettingValueList(opts, opts[_settings.radio_fm_sql])))
@@ -849,7 +849,7 @@ class VX3Radio(yaesu_clone.YaesuCloneModeRadio):
"dtmf_speed", "DTMF speed (ms)",
RadioSettingValueList(opts, opts[_settings.dtmf_speed])))
- opts = map(str, range(10))
+ opts = list(map(str, list(range(10))))
dtmf.append(RadioSetting(
"dtmf_chan_active", "DTMF active",
RadioSettingValueList(
@@ -973,6 +973,6 @@ class VX3Radio(yaesu_clone.YaesuCloneModeRadio):
newval = self._encode_chars(newval, 6)
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval))
setattr(_settings, setting, newval)
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/vx7.py b/chirp/drivers/vx7.py
index ee5d383..1dedfaf 100644
--- a/chirp/drivers/vx7.py
+++ b/chirp/drivers/vx7.py
@@ -170,7 +170,7 @@ class VX7BankModel(chirp_common.BankModel):
def _wipe_memory(mem):
- mem.set_raw("\x00" * (mem.size() / 8))
+ mem.set_raw("\x00" * (mem.size() // 8))
mem.unknown1 = 0x05
mem.ones = 0x03
diff --git a/chirp/drivers/vx8.py b/chirp/drivers/vx8.py
index 56620a1..550d1ca 100644
--- a/chirp/drivers/vx8.py
+++ b/chirp/drivers/vx8.py
@@ -500,10 +500,7 @@ class VX8BankModel(chirp_common.BankModel):
def _wipe_memory(mem):
- mem.set_raw("\x00" * (mem.size() / 8))
- mem.pr_frequency = 0x1d # default PR frequency of 1600 Hz
- mem.unknown8b = 1 # This bit must be 1, but its meaning is unknown
- mem.rx_mode_auto = 1 # rx auto mode bit defaults to 1
+ mem.set_raw("\x00" * (mem.size() // 8))
@directory.register
@@ -1439,7 +1436,7 @@ class VX8Radio(yaesu_clone.YaesuCloneModeRadio):
except AttributeError as e:
LOG.error("Setting %s is not in the memory map: %s" %
(element.get_name(), e))
- except Exception, e:
+ except Exception as e:
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/yaesu_clone.py b/chirp/drivers/yaesu_clone.py
index 6efa003..2fbad4d 100644
--- a/chirp/drivers/yaesu_clone.py
+++ b/chirp/drivers/yaesu_clone.py
@@ -13,11 +13,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from builtins import bytes
import time
import os
import logging
from textwrap import dedent
+from chirp import bitwise
from chirp import chirp_common, util, memmap, errors
LOG = logging.getLogger(__name__)
@@ -26,13 +28,13 @@ CMD_ACK = 0x06
def _safe_read(pipe, count):
- buf = ""
+ buf = bytes(b"")
first = True
for _i in range(0, 60):
buf += pipe.read(count - len(buf))
# LOG.debug("safe_read: %i/%i\n" % (len(buf), count))
if buf:
- if first and buf[0] == chr(CMD_ACK):
+ if first and buf[0] == CMD_ACK:
# LOG.debug("Chewed an ack")
buf = buf[1:] # Chew an echo'd ack if using a 2-pin cable
first = False
@@ -45,7 +47,7 @@ def _safe_read(pipe, count):
def _chunk_read(pipe, count, status_fn):
timer = time.time()
block = 32
- data = ""
+ data = bytes(b"")
while len(data) < count:
# Don't read past the end of our block if we're not on a 32-byte
# boundary
@@ -54,7 +56,7 @@ def _chunk_read(pipe, count, status_fn):
if chunk:
timer = time.time()
data += chunk
- if data[0] == chr(CMD_ACK):
+ if data[0] == CMD_ACK:
data = data[1:] # Chew an echo'd ack if using a 2-pin cable
# LOG.debug("Chewed an ack")
if time.time() - timer > 2:
@@ -79,7 +81,7 @@ def __clone_in(radio):
start = time.time()
- data = ""
+ data = bytes(b"")
blocks = 0
for block in radio._block_lengths:
blocks += 1
@@ -87,7 +89,7 @@ def __clone_in(radio):
chunk = _chunk_read(pipe, block, radio.status_fn)
else:
chunk = _safe_read(pipe, block)
- pipe.write(chr(CMD_ACK))
+ pipe.write(bytes([CMD_ACK]))
if not chunk:
raise errors.RadioError("No response from radio")
if radio.status_fn:
@@ -100,13 +102,13 @@ def __clone_in(radio):
LOG.debug("Clone completed in %i seconds" % (time.time() - start))
- return memmap.MemoryMap(data)
+ return memmap.MemoryMapBytes(data)
def _clone_in(radio):
try:
return __clone_in(radio)
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with the radio: %s" % e)
@@ -143,18 +145,19 @@ def __clone_out(radio):
blocks = 0
pos = 0
+ mmap = radio.get_mmap().get_byte_compatible()
for block in radio._block_lengths:
blocks += 1
if blocks != len(radio._block_lengths):
LOG.debug("Sending %i-%i" % (pos, pos+block))
- pipe.write(radio.get_mmap()[pos:pos+block])
+ pipe.write(mmap[pos:pos+block])
buf = pipe.read(1)
- if buf and buf[0] != chr(CMD_ACK):
+ if buf and buf[0] != CMD_ACK:
buf = pipe.read(block)
- if not buf or buf[-1] != chr(CMD_ACK):
+ if not buf or buf[-1] != CMD_ACK:
raise Exception("Radio did not ack block %i" % blocks)
else:
- _chunk_write(pipe, radio.get_mmap()[pos:],
+ _chunk_write(pipe, mmap[pos:],
radio.status_fn, radio._block_size)
pos += block
@@ -166,7 +169,7 @@ def __clone_out(radio):
def _clone_out(radio):
try:
return __clone_out(radio)
- except Exception, e:
+ except Exception as e:
raise errors.RadioError("Failed to communicate with the radio: %s" % e)
@@ -180,19 +183,40 @@ class YaesuChecksum:
else:
self._address = stop + 1
+ @staticmethod
+ def _asbytes(mmap):
+ if hasattr(mmap, 'get_byte_compatible'):
+ return mmap.get_byte_compatible()
+ elif isinstance(mmap, bytes):
+ # NOTE: this won't work for update(), but nothing should be calling
+ # this with a literal expecting that to work
+ return memmap.MemoryMapBytes(bytes(mmap))
+ elif isinstance(mmap, str):
+ # NOTE: this won't work for update(), but nothing should be calling
+ # this with a literal expecting that to work
+ return memmap.MemoryMap(
+ bitwise.string_straight_encode(mmap)).get_byte_compatible()
+ else:
+ raise TypeError('Unable to convert %s to bytes' % (
+ type(mmap).__name__))
+
def get_existing(self, mmap):
"""Return the existing checksum in mmap"""
- return ord(mmap[self._address])
+ return self._asbytes(mmap)[self._address][0]
def get_calculated(self, mmap):
"""Return the calculated value of the checksum"""
+ mmap = self._asbytes(mmap)
cs = 0
for i in range(self._start, self._stop+1):
- cs += ord(mmap[i])
+ # NOTE: mmap[i] returns a slice'd bytes, not an int like a
+ # bytes does
+ cs += mmap[i][0]
return cs % 256
def update(self, mmap):
"""Update the checksum with the data in @mmap"""
+ mmap = self._asbytes(mmap)
mmap[self._address] = self.get_calculated(mmap)
def __str__(self):
@@ -207,6 +231,7 @@ class YaesuCloneModeRadio(chirp_common.CloneModeRadio):
_block_size = 8
VENDOR = "Yaesu"
+ NEEDS_COMPAT_SERIAL = False
_model = "ABCDE"
@classmethod
diff --git a/chirp/logger.py b/chirp/logger.py
index 6eee8a8..619927a 100644
--- a/chirp/logger.py
+++ b/chirp/logger.py
@@ -25,7 +25,7 @@ import os
import sys
import logging
import argparse
-import platform
+from . import platform
from chirp import CHIRP_VERSION
@@ -38,7 +38,7 @@ def version_string():
class VersionAction(argparse.Action):
def __call__(self, parser, namespace, value, option_string=None):
- print version_string()
+ print(version_string())
sys.exit(1)
@@ -90,7 +90,7 @@ class Logger(object):
hasattr(sys, "frozen") or not os.isatty(0) or
os.getenv("CHIRP_DEBUG_LOG")):
p = platform.get_platform()
- log = file(p.config_file("debug.log"), "w", 0)
+ log = open(p.config_file("debug.log"), "w")
sys.stdout = log
sys.stderr = log
console_stream = log
@@ -121,7 +121,7 @@ class Logger(object):
if self.logfile is None:
self.logname = name
# always truncate the log file
- with file(name, "w") as fh:
+ with open(name, "w") as fh:
pass
self.logfile = logging.FileHandler(name)
format_str = self.log_format
diff --git a/chirp/memmap.py b/chirp/memmap.py
index be83a1e..9a16ee2 100644
--- a/chirp/memmap.py
+++ b/chirp/memmap.py
@@ -13,15 +13,22 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from builtins import bytes
+
+import six
+
from chirp import util
-class MemoryMap:
+class MemoryMapBytes(object):
"""
- A pythonic memory map interface
+ This is the proper way for MemoryMap to work, which is
+ in terms of bytes always.
"""
def __init__(self, data):
+ assert isinstance(data, bytes)
+
self._data = list(data)
def printable(self, start=None, end=None):
@@ -38,18 +45,29 @@ class MemoryMap:
def get(self, start, length=1):
"""Return a chunk of memory of @length bytes from @start"""
- if start == -1:
- return "".join(self._data[start:])
+ if length == -1:
+ return bytes(self._data[start:])
else:
- return "".join(self._data[start:start+length])
+ end = start + length
+ d = self._data[start:end]
+ return bytes(d)
def set(self, pos, value):
"""Set a chunk of memory at @pos to @value"""
+
+ pos = int(pos)
+
if isinstance(value, int):
- self._data[pos] = chr(value)
+ self._data[pos] = value & 0xFF
+ elif isinstance(value, bytes):
+ for byte in bytes(value):
+ self._data[pos] = byte
+ pos += 1
elif isinstance(value, str):
+ if six.PY3:
+ value = value.encode()
for byte in value:
- self._data[pos] = byte
+ self._data[pos] = ord(byte)
pos += 1
else:
raise ValueError("Unsupported type %s for value" %
@@ -57,7 +75,7 @@ class MemoryMap:
def get_packed(self):
"""Return the entire memory map as raw data"""
- return "".join(self._data)
+ return bytes(self._data)
def __len__(self):
return len(self._data)
@@ -66,7 +84,13 @@ class MemoryMap:
return self.get(start, end-start)
def __getitem__(self, pos):
- return self.get(pos)
+ if isinstance(pos, slice):
+ if pos.stop is None:
+ return self.get(pos.start, -1)
+
+ return self.get(pos.start, pos.stop - pos.start)
+ else:
+ return self.get(pos)
def __setitem__(self, pos, value):
"""
@@ -85,9 +109,45 @@ class MemoryMap:
"""Truncate the memory map to @size"""
self._data = self._data[:size]
+ def get_byte_compatible(self):
+ return self
+
-# Py3 branch compatibility
-class MemoryMapBytes(MemoryMap):
+class MemoryMap(MemoryMapBytes):
+ """Compatibility version of MemoryMapBytes
+
+ This deals in strings for compatibility with drivers that do.
+ """
def __init__(self, data):
- # Expects data is a newbytes
- MemoryMap.__init__(self, ''.join(chr(b) for b in data))
+ # Fix circular dependency
+ from chirp import bitwise
+ self._bitwise = bitwise
+
+ if six.PY3 and isinstance(data, bytes):
+ # Be graceful if py3-enabled code uses this,
+ # just don't encode it
+ encode = lambda d: d
+ else:
+ encode = self._bitwise.string_straight_encode
+ super(MemoryMap, self).__init__(encode(data))
+
+ def get(self, pos, length=1):
+ return self._bitwise.string_straight_decode(
+ super(MemoryMap, self).get(pos, length=length))
+
+ def set(self, pos, value):
+ if isinstance(value, int):
+ # Apparently this is a thing that drivers do, so
+ # be compatible here
+ value = chr(value)
+ super(MemoryMap, self).set(
+ pos, self._bitwise.string_straight_encode(value))
+
+ def get_packed(self):
+ return self._bitwise.string_straight_decode(
+ super(MemoryMap, self).get_packed())
+
+ def get_byte_compatible(self):
+ mmb = MemoryMapBytes(bytes(self._data))
+ self._data = mmb._data
+ return mmb
diff --git a/chirp/platform.py b/chirp/platform.py
index 9b2922b..1fd928b 100644
--- a/chirp/platform.py
+++ b/chirp/platform.py
@@ -20,6 +20,8 @@ import re
import logging
from subprocess import Popen
+import six
+
LOG = logging.getLogger(__name__)
@@ -45,7 +47,7 @@ def win32_comports_bruteforce():
ports.append((portname, "Unknown", "Serial"))
win32file.CloseHandle(port)
port = None
- except Exception, e:
+ except Exception as e:
pass
return ports
@@ -236,8 +238,8 @@ class Platform:
if we_are_frozen():
# Win32, find the directory of the executable
- return os.path.dirname(unicode(sys.executable,
- sys.getfilesystemencoding()))
+ return os.path.dirname(six.text_type(sys.executable,
+ sys.getfilesystemencoding()))
else:
# UNIX: Find the parent directory of this module
return os.path.dirname(os.path.abspath(os.path.join(_find_me(),
@@ -374,7 +376,7 @@ class Win32Platform(Platform):
def list_serial_ports(self):
try:
ports = list(comports())
- except Exception, e:
+ except Exception as e:
if comports != win32_comports_bruteforce:
LOG.error("Failed to detect win32 serial ports: %s" % e)
ports = win32_comports_bruteforce()
@@ -391,7 +393,7 @@ class Win32Platform(Platform):
try:
fname, _, _ = win32gui.GetOpenFileNameW(Filter=typestrs)
- except Exception, e:
+ except Exception as e:
LOG.error("Failed to get filename: %s" % e)
return None
@@ -422,7 +424,7 @@ class Win32Platform(Platform):
CustomFilter=custom,
DefExt=def_ext,
Filter=typestrs)
- except Exception, e:
+ except Exception as e:
LOG.error("Failed to get filename: %s" % e)
return None
@@ -434,7 +436,7 @@ class Win32Platform(Platform):
try:
pidl, _, _ = shell.SHBrowseForFolder()
fname = shell.SHGetPathFromIDList(pidl)
- except Exception, e:
+ except Exception as e:
LOG.error("Failed to get directory: %s" % e)
return None
@@ -476,16 +478,16 @@ def get_platform(basepath=None):
def _do_test():
__pform = get_platform()
- print "Config dir: %s" % __pform.config_dir()
- print "Default dir: %s" % __pform.default_dir()
- print "Log file (foo): %s" % __pform.log_file("foo")
- print "Serial ports: %s" % __pform.list_serial_ports()
- print "OS Version: %s" % __pform.os_version_string()
+ print("Config dir: %s" % __pform.config_dir())
+ print("Default dir: %s" % __pform.default_dir())
+ print("Log file (foo): %s" % __pform.log_file("foo"))
+ print("Serial ports: %s" % __pform.list_serial_ports())
+ print("OS Version: %s" % __pform.os_version_string())
# __pform.open_text_file("d-rats.py")
# print "Open file: %s" % __pform.gui_open_file()
# print "Save file: %s" % __pform.gui_save_file(default_name="Foo.txt")
- print "Open folder: %s" % __pform.gui_select_dir("/tmp")
+ print("Open folder: %s" % __pform.gui_select_dir("/tmp"))
if __name__ == "__main__":
_do_test()
diff --git a/chirp/pyPEG.py b/chirp/pyPEG.py
index 68d8b74..ce04502 100644
--- a/chirp/pyPEG.py
+++ b/chirp/pyPEG.py
@@ -5,14 +5,16 @@
import re
import sys
import codecs
-import exceptions
+import collections
+import six
-class keyword(unicode):
+
+class keyword(str):
pass
-class code(unicode):
+class code(str):
pass
@@ -30,10 +32,10 @@ class _not(_and):
pass
-class Name(unicode):
+class Name(str):
def __init__(self, *args):
self.line = 0
- self.file = u""
+ self.file = ""
class Symbol(list):
@@ -47,28 +49,29 @@ class Symbol(list):
return self.what
def __unicode__(self):
- return u'Symbol(' + repr(self.__name__) + ', ' + repr(self.what) + u')'
+ return 'Symbol(' + repr(self.__name__) + ', ' + repr(self.what) + ')'
def __repr__(self):
- return unicode(self)
+ return str(self)
-word_regex = re.compile(ur"\w+")
-rest_regex = re.compile(ur".*")
+word_regex = re.compile(r"\w+")
+rest_regex = re.compile(r".*")
print_trace = False
def u(text):
+ return six.text_type(text)
if isinstance(text, exceptions.BaseException):
text = text.args[0]
- if type(text) is unicode:
+ if type(text) is str:
return text
if isinstance(text, str):
if sys.stdin.encoding:
return codecs.decode(text, sys.stdin.encoding)
else:
return codecs.decode(text, "utf-8")
- return unicode(text)
+ return str(text)
def skip(skipper, text, skipWS, skipComments):
@@ -126,8 +129,8 @@ class parser(object):
if print_trace:
try:
if _pattern.__name__ != "comment":
- sys.stderr.write(u"match: " +
- _pattern.__name__ + u"\n")
+ sys.stderr.write("match: " +
+ _pattern.__name__ + "\n")
except:
pass
@@ -166,14 +169,14 @@ class parser(object):
except:
pass
- if callable(pattern):
+ if isinstance(pattern, collections.Callable):
if __debug__:
if print_trace:
try:
if pattern.__name__ != "comment":
- sys.stderr.write(u"testing with " +
- pattern.__name__ + u": " +
- textline[:40] + u"\n")
+ sys.stderr.write("testing with " +
+ pattern.__name__ + ": " +
+ textline[:40] + "\n")
except:
pass
@@ -181,14 +184,14 @@ class parser(object):
name = Name(pattern.__name__)
pattern = pattern()
- if callable(pattern):
+ if isinstance(pattern, collections.Callable):
pattern = (pattern,)
text = skip(self.skipper, textline, skipWS, skipComments)
pattern_type = type(pattern)
- if pattern_type is str or pattern_type is unicode:
+ if pattern_type is str or pattern_type is str:
if text[:len(pattern)] == pattern:
text = skip(self.skipper, text[len(pattern):],
skipWS, skipComments)
@@ -287,13 +290,13 @@ class parser(object):
syntaxError()
else:
- raise SyntaxError(u"illegal type in grammar: " + u(pattern_type))
+ raise SyntaxError("illegal type in grammar: " + u(pattern_type))
def lineNo(self):
if not(self.lines):
- return u""
+ return ""
if self.restlen == -1:
- return u""
+ return ""
parsed = self.textlen - self.restlen
left, right = 0, len(self.lines)
@@ -305,21 +308,21 @@ class parser(object):
if self.lines[mid + 1][0] >= parsed:
try:
return u(self.lines[mid + 1][1]) + \
- u":" + u(self.lines[mid + 1][2])
+ ":" + u(self.lines[mid + 1][2])
except:
- return u""
+ return ""
else:
left = mid + 1
except:
try:
return u(self.lines[mid + 1][1]) + \
- u":" + u(self.lines[mid + 1][2])
+ ":" + u(self.lines[mid + 1][2])
except:
- return u""
+ return ""
else:
right = mid - 1
if left > right:
- return u""
+ return ""
# plain module APIs
@@ -350,10 +353,10 @@ def parse(language, lineSource, skipWS=True, skipComments=None,
packrat=False, lineCount=True):
lines, lineNo = [], 0
- while callable(language):
+ while isinstance(language, collections.Callable):
language = language()
- orig, ld = u"", 0
+ orig, ld = "", 0
for line in lineSource:
if lineSource.isfirstline():
ld = 1
@@ -377,10 +380,10 @@ def parse(language, lineSource, skipWS=True, skipComments=None,
if text:
raise SyntaxError()
- except SyntaxError, msg:
+ except SyntaxError as msg:
parsed = textlen - p.restlen
textlen = 0
- nn, lineNo, file = 0, 0, u""
+ nn, lineNo, file = 0, 0, ""
for n, ld, l in lines:
if n >= parsed:
break
@@ -392,7 +395,7 @@ def parse(language, lineSource, skipWS=True, skipComments=None,
lineNo += 1
nn -= 1
lineCont = orig.splitlines()[nn]
- raise SyntaxError(u"syntax error in " + u(file) + u":" +
- u(lineNo) + u": " + lineCont)
+ raise SyntaxError("syntax error in " + u(file) + ":" +
+ u(lineNo) + ": " + lineCont)
return result
diff --git a/chirp/radioreference.py b/chirp/radioreference.py
index 515e96f..262e592 100644
--- a/chirp/radioreference.py
+++ b/chirp/radioreference.py
@@ -72,7 +72,7 @@ class RadioReferenceRadio(chirp_common.NetworkSourceRadio):
service = self._client.service
zipcode = service.getZipcodeInfo(self._zip, self._auth)
county = service.getCountyInfo(zipcode.ctid, self._auth)
- except WebFault, err:
+ except WebFault as err:
raise errors.RadioError(err)
status = chirp_common.Status()
@@ -185,8 +185,8 @@ def main():
username=sys.argv[2],
password=sys.argv[3])
rrr.do_fetch()
- print rrr.get_raw_memory(0)
- print rrr.get_memory(0)
+ print(rrr.get_raw_memory(0))
+ print(rrr.get_memory(0))
if __name__ == "__main__":
main()
diff --git a/chirp/settings.py b/chirp/settings.py
index 3133903..7438425 100644
--- a/chirp/settings.py
+++ b/chirp/settings.py
@@ -219,6 +219,12 @@ class RadioSettingValueString(RadioSettingValue):
def __str__(self):
return self._current
+ def __len__(self):
+ return len(self._current)
+
+ def __getitem__(self, i):
+ return self._current[i]
+
class RadioSettingValueMap(RadioSettingValueList):
@@ -354,6 +360,9 @@ class RadioSettingGroup(object):
return self
def next(self):
+ return self.__next__()
+
+ def __next__(self):
"""Next Iterator Interface"""
if self.__i >= len(self.__rsg.keys()):
raise StopIteration()
@@ -388,6 +397,9 @@ class RadioSettingGroup(object):
"""Returns the list of elements"""
return [self._elements[name] for name in self._element_order]
+ def __lt__(self, other):
+ return self._name < other._name
+
class RadioSetting(RadioSettingGroup):
diff --git a/chirp/ui/bankedit.py b/chirp/ui/bankedit.py
index 48d4b4f..339a42c 100644
--- a/chirp/ui/bankedit.py
+++ b/chirp/ui/bankedit.py
@@ -348,7 +348,7 @@ class MappingMembershipEditor(common.Editor):
self._store.set(iter,
self.C_FILLED, False,
self.C_LOC, i,
- self.C_FREQ, 0,
+ self.C_FREQ, "",
self.C_NAME, "",
self.C_INDEX, 0)
diff --git a/chirp/ui/clone.py b/chirp/ui/clone.py
index 7245537..e659a8a 100644
--- a/chirp/ui/clone.py
+++ b/chirp/ui/clone.py
@@ -72,9 +72,9 @@ class CloneSettingsDialog(gtk.Dialog):
def __make_model(self):
return miscwidgets.make_choice([], False)
- def __make_vendor(self, model):
+ def __make_vendor(self, modelbox):
vendors = collections.defaultdict(list)
- for rclass in sorted(directory.DRV_TO_RADIO.values()):
+ for name, rclass in sorted(directory.DRV_TO_RADIO.items()):
if not issubclass(rclass, chirp_common.CloneModeRadio) and \
not issubclass(rclass, chirp_common.LiveRadio):
continue
@@ -90,34 +90,36 @@ class CloneSettingsDialog(gtk.Dialog):
conf.set("last_vendor", sorted(vendors.keys())[0])
last_vendor = conf.get("last_vendor")
- if last_vendor not in vendors.keys():
- last_vendor = vendors.keys()[0]
+ if last_vendor not in list(vendors.keys()):
+ last_vendor = list(vendors.keys())[0]
v = miscwidgets.make_choice(sorted(vendors.keys()), False, last_vendor)
- def _changed(box, vendors, model):
- models = vendors[box.get_active_text()]
+ def _changed(box, vendors, boxes):
+ (vendorbox, modelbox) = boxes
+ models = vendors[vendorbox.value]
added_models = []
- model.get_model().clear()
+ model_store = modelbox.get_model()
+ model_store.clear()
for rclass in sorted(models, key=lambda c: c.__name__):
if rclass.MODEL not in added_models:
- model.append_text(rclass.MODEL)
+ model_store.append([rclass.MODEL])
added_models.append(rclass.MODEL)
- if box.get_active_text() in detect.DETECT_FUNCTIONS:
- model.insert_text(0, _("Detect"))
+ if vendorbox.value in detect.DETECT_FUNCTIONS:
+ model_store.append([_("Detect")])
added_models.insert(0, _("Detect"))
model_names = [x.MODEL for x in models]
if conf.get("last_model") in model_names:
- model.set_active(added_models.index(conf.get("last_model")))
- else:
- model.set_active(0)
+ modelbox.value = conf.get("last_model")
+ elif added_models:
+ modelbox.value = added_models[0]
- v.connect("changed", _changed, vendors, model)
- _changed(v, vendors, model)
+ v.widget.connect("changed", _changed, vendors, (v, modelbox))
+ _changed(v, vendors, (v, modelbox))
return v
@@ -131,17 +133,15 @@ class CloneSettingsDialog(gtk.Dialog):
self.__modl = self.__make_model()
self.__vend = self.__make_vendor(self.__modl)
- self.__make_field(_("Port"), self.__port)
- self.__make_field(_("Vendor"), self.__vend)
- self.__make_field(_("Model"), self.__modl)
+ self.__make_field(_("Port"), self.__port.widget)
+ self.__make_field(_("Vendor"), self.__vend.widget)
+ self.__make_field(_("Model"), self.__modl.widget)
if settings and settings.radio_class:
- common.combo_select(self.__vend, settings.radio_class.VENDOR)
- self.__modl.get_model().clear()
- self.__modl.append_text(settings.radio_class.MODEL)
- common.combo_select(self.__modl, settings.radio_class.MODEL)
- self.__vend.set_sensitive(False)
- self.__modl.set_sensitive(False)
+ self.__vend.value = settings.radio_class.VENDOR
+ self.__modl.value = settings.radio_class.MODEL
+ self.__vend.widget.set_sensitive(False)
+ self.__modl.widget.set_sensitive(False)
self.__table.show()
self.vbox.pack_start(self.__table, 1, 1, 1)
@@ -165,11 +165,11 @@ class CloneSettingsDialog(gtk.Dialog):
if r != gtk.RESPONSE_OK:
return None
- vendor = self.__vend.get_active_text()
- model = self.__modl.get_active_text()
+ vendor = self.__vend.value
+ model = self.__modl.value
cs = CloneSettings()
- cs.port = self.__port.get_active_text()
+ cs.port = self.__port.value
if model == _("Detect"):
try:
cs.radio_class = detect.DETECT_FUNCTIONS[vendor](cs.port)
@@ -177,13 +177,13 @@ class CloneSettingsDialog(gtk.Dialog):
raise Exception(
_("Unable to detect radio on {port}").format(
port=cs.port))
- except Exception, e:
+ except Exception as e:
d = inputdialog.ExceptionDialog(e)
d.run()
d.destroy()
return None
else:
- for rclass in directory.DRV_TO_RADIO.values():
+ for rclass in list(directory.DRV_TO_RADIO.values()):
if rclass.MODEL == model:
cs.radio_class = rclass
break
@@ -256,7 +256,7 @@ class CloneThread(threading.Thread):
self.__radio.sync_in()
emsg = None
- except Exception, e:
+ except Exception as e:
common.log_exception()
LOG.error(_("Clone failed: {error}").format(error=e))
emsg = e
@@ -275,4 +275,4 @@ class CloneThread(threading.Thread):
if __name__ == "__main__":
d = CloneSettingsDialog("/dev/ttyUSB0")
r = d.run()
- print r
+ print(r)
diff --git a/chirp/ui/common.py b/chirp/ui/common.py
index dc611b3..a6b90ee 100644
--- a/chirp/ui/common.py
+++ b/chirp/ui/common.py
@@ -114,9 +114,9 @@ class RadioJob:
str(self.kwargs)))
DBG(self.desc)
result = func(*self.args, **self.kwargs)
- except errors.InvalidMemoryLocation, e:
+ except errors.InvalidMemoryLocation as e:
result = e
- except Exception, e:
+ except Exception as e:
LOG.error("Exception running RadioJob: %s" % e)
log_exception()
LOG.error("Job Args: %s" % str(self.args))
@@ -134,7 +134,7 @@ class RadioJob:
try:
func = getattr(self.target, self.func)
- except AttributeError, e:
+ except AttributeError as e:
LOG.error("No such radio function `%s' in %s" %
(self.func, self.target))
return
diff --git a/chirp/ui/compat.py b/chirp/ui/compat.py
new file mode 100644
index 0000000..b4ac7d2
--- /dev/null
+++ b/chirp/ui/compat.py
@@ -0,0 +1,82 @@
+import contextlib
+import logging
+import serial as base_serial
+import six
+
+try:
+ import gtk
+except ImportError:
+ # FIXME
+ # For chirpc
+ gtk = None
+
+from chirp import bitwise
+
+LOG = logging.getLogger('uicompat')
+
+
+@contextlib.contextmanager
+def py3safe(quiet=False):
+ try:
+ yield
+ except Exception as e:
+ if not quiet:
+ LOG.exception('FIXMEPY3: %s' % e)
+
+
+def SpinButton(adj):
+ try:
+ return gtk.SpinButton(adj)
+ except TypeError:
+ sb = gtk.SpinButton()
+ sb.configure(adj, 1.0, 0)
+ return sb
+
+def Frame(label):
+ try:
+ return gtk.Frame(label)
+ except TypeError:
+ f = gtk.Frame()
+ f.set_label(label)
+ return f
+
+
+class CompatSerial(base_serial.Serial):
+ """A PY2-compatible Serial class
+
+ This wraps serial.Serial to provide translation between
+ hex-char-having unicode strings in radios and the bytes-wanting
+ serial channel. See bitwise.string_straigth_encode() and
+ bitwise.string_straight_decode() for more details.
+
+ This should only be used as a bridge for older drivers until
+ they can be rewritten.
+ """
+ def write(self, data):
+ data = bitwise.string_straight_encode(data)
+ return super(CompatSerial, self).write(data)
+
+ def read(self, count):
+ data = super(CompatSerial, self).read(count)
+ return bitwise.string_straight_decode(data)
+
+ @classmethod
+ def get(cls, needs_compat, *args, **kwargs):
+ if six.PY3 and needs_compat:
+ return cls(*args, **kwargs)
+ else:
+ return base_serial.Serial(*args, **kwargs)
+
+
+class CompatTooltips(object):
+ def __init__(self):
+ try:
+ self.tips = gtk.Tooltips()
+ except AttributeError:
+ self.tips = None
+
+ def set_tip(self, widget, tip):
+ if self.tips:
+ self.tips.set_tip(widget, tip)
+ else:
+ widget.set_tooltip_text(tip)
diff --git a/chirp/ui/config.py b/chirp/ui/config.py
index 29a4bf2..3867d4a 100644
--- a/chirp/ui/config.py
+++ b/chirp/ui/config.py
@@ -14,7 +14,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from chirp import platform
-from ConfigParser import ConfigParser
+try:
+ from ConfigParser import ConfigParser
+except ImportError:
+ from configparser import ConfigParser
import os
@@ -33,9 +36,8 @@ class ChirpConfig:
def save(self):
cfg = os.path.join(self.__basepath, self.__name)
- cfg_file = file(cfg, "w")
- self.__config.write(cfg_file)
- cfg_file.close()
+ with open(cfg, "w") as cfg_file:
+ self.__config.write(cfg_file)
def get(self, key, section, raw=False):
if not self.__config.has_section(section):
diff --git a/chirp/ui/dstaredit.py b/chirp/ui/dstaredit.py
index 3409ef4..4d122f2 100644
--- a/chirp/ui/dstaredit.py
+++ b/chirp/ui/dstaredit.py
@@ -18,6 +18,7 @@ import gobject
import logging
from chirp.ui import common, miscwidgets
+from chirp.ui import compat
LOG = logging.getLogger(__name__)
@@ -50,9 +51,10 @@ class CallsignEditor(gtk.HBox):
self.listw.set_editable(1, True)
self.listw.connect("item-set", self._cs_changed)
- rend = self.listw.get_renderer(1)
- rend.set_property("family", "Monospace")
- rend.set_property("width-chars", width)
+ with compat.py3safe():
+ rend = self.listw.get_renderer(1)
+ rend.set_property("family", "Monospace")
+ rend.set_property("width-chars", width)
sw = gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
@@ -126,7 +128,7 @@ class DStarEditor(common.Editor):
fixed = self.rthread.radio.get_features().has_implicit_calls
- frame = gtk.Frame(_("Your callsign"))
+ frame = compat.Frame(_("Your callsign"))
self.editor_ucall = CallsignEditor(first_fixed=fixed)
self.editor_ucall.set_size_request(-1, 200)
self.editor_ucall.show()
@@ -134,7 +136,7 @@ class DStarEditor(common.Editor):
frame.show()
box.pack_start(frame, 1, 1, 0)
- frame = gtk.Frame(_("Repeater callsign"))
+ frame = compat.Frame(_("Repeater callsign"))
self.editor_rcall = CallsignEditor(first_fixed=fixed)
self.editor_rcall.set_size_request(-1, 200)
self.editor_rcall.show()
@@ -142,7 +144,7 @@ class DStarEditor(common.Editor):
frame.show()
box.pack_start(frame, 1, 1, 0)
- frame = gtk.Frame(_("My callsign"))
+ frame = compat.Frame(_("My callsign"))
self.editor_mcall = CallsignEditor()
self.editor_mcall.set_size_request(-1, 200)
self.editor_mcall.show()
diff --git a/chirp/ui/editorset.py b/chirp/ui/editorset.py
index 2866dc9..697f5ef 100644
--- a/chirp/ui/editorset.py
+++ b/chirp/ui/editorset.py
@@ -19,7 +19,7 @@ import gobject
import logging
from chirp import chirp_common, directory
-from chirp.drivers import generic_csv, generic_xml
+from chirp.drivers import generic_csv
from chirp.ui import memedit, dstaredit, bankedit, common, importdialog
from chirp.ui import inputdialog, reporting, settingsedit, radiobrowser, config
@@ -229,7 +229,7 @@ class EditorSet(gtk.VBox):
if not isinstance(self.radio, chirp_common.LiveRadio):
self.modified = True
self.update_tab()
- for editor in self.editors.values():
+ for editor in list(self.editors.values()):
if editor != target_editor:
editor.other_editor_changed(target_editor)
@@ -296,7 +296,7 @@ class EditorSet(gtk.VBox):
common.show_error("Memory editor must be selected before import")
try:
src_radio = directory.get_radio_by_image(filen)
- except Exception, e:
+ except Exception as e:
common.show_error(e)
return
@@ -310,7 +310,7 @@ class EditorSet(gtk.VBox):
try:
src_radio.status_fn = status
src_radio.do_fetch()
- except Exception, e:
+ except Exception as e:
common.show_error(e)
ww.hide()
return
@@ -319,7 +319,7 @@ class EditorSet(gtk.VBox):
try:
if src_radio.get_features().has_sub_devices:
src_radio = self.choose_sub_device(src_radio)
- except Exception, e:
+ except Exception as e:
common.show_error(e)
return
@@ -335,7 +335,7 @@ class EditorSet(gtk.VBox):
src_radio,
self.rthread)
reporting.report_model_usage(src_radio, "importsrc", True)
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error(_("There was an error during "
"import: {error}").format(error=e))
@@ -344,11 +344,9 @@ class EditorSet(gtk.VBox):
try:
if filen.lower().endswith(".csv"):
dst_radio = generic_csv.CSVRadio(filen)
- elif filen.lower().endswith(".chirp"):
- dst_radio = generic_xml.XMLRadio(filen)
else:
raise Exception(_("Unsupported file type"))
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error(e)
return
@@ -361,7 +359,7 @@ class EditorSet(gtk.VBox):
count = self._do_import_locked(importdialog.ExportDialog,
self.rthread.radio,
dst_rthread)
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error(_("There was an error during "
"export: {error}").format(error=e),
@@ -376,7 +374,7 @@ class EditorSet(gtk.VBox):
try:
dst_radio.save(filename=filen)
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error(_("There was an error during "
"export: {error}").format(error=e),
@@ -397,7 +395,7 @@ class EditorSet(gtk.VBox):
def tab_selected(self, notebook, foo, pagenum):
widget = notebook.get_nth_page(pagenum)
- for k, v in self.editors.items():
+ for k, v in list(self.editors.items()):
if v and v.root == widget:
v.focus()
self.emit("editor-selected", k)
@@ -405,19 +403,19 @@ class EditorSet(gtk.VBox):
v.unfocus()
def set_read_only(self, read_only=True):
- for editor in self.editors.values():
+ for editor in list(self.editors.values()):
editor and editor.set_read_only(read_only)
def get_read_only(self):
return self.editors["memedit0"].get_read_only()
def prepare_close(self):
- for editor in self.editors.values():
+ for editor in list(self.editors.values()):
editor and editor.prepare_close()
def get_current_editor(self):
tabs = self.tabs
- for lab, e in self.editors.items():
+ for lab, e in list(self.editors.items()):
if e and tabs.page_num(e.root) == tabs.get_current_page():
return e
raise Exception("No editor selected?")
diff --git a/chirp/ui/importdialog.py b/chirp/ui/importdialog.py
index b854c40..7a52852 100644
--- a/chirp/ui/importdialog.py
+++ b/chirp/ui/importdialog.py
@@ -19,7 +19,6 @@ import pango
import logging
from chirp import errors, chirp_common, import_logic
-from chirp.drivers import generic_xml
from chirp.ui import common
LOG = logging.getLogger(__name__)
@@ -238,8 +237,7 @@ class ImportDialog(gtk.Dialog):
LOG.error("One or more of the radios doesn't support banks")
return
- if not isinstance(self.dst_radio, generic_xml.XMLRadio) and \
- len(dst_banks) != len(src_banks):
+ if not len(dst_banks) != len(src_banks):
LOG.warn("Source and destination radios have "
"a different number of banks")
else:
@@ -265,7 +263,7 @@ class ImportDialog(gtk.Dialog):
{"number": new,
"name": name,
"comment": comm})
- except import_logic.ImportError, e:
+ except import_logic.ImportError as e:
LOG.error("Import error: %s", e)
error_messages[new] = str(e)
continue
@@ -279,9 +277,9 @@ class ImportDialog(gtk.Dialog):
job.set_desc(_("Importing bank information"))
dst_rthread._qsubmit(job, 0)
- if error_messages.keys():
+ if list(error_messages.keys()):
msg = _("Error importing memories:") + "\r\n"
- for num, msgs in error_messages.items():
+ for num, msgs in list(error_messages.items()):
msg += "%s: %s" % (num, ",".join(msgs))
common.show_error(msg)
@@ -303,7 +301,7 @@ class ImportDialog(gtk.Dialog):
tips = gtk.Tooltips()
- for k in self.caps.keys():
+ for k in list(self.caps.keys()):
t = self.types[k]
if t == gobject.TYPE_BOOLEAN:
@@ -325,7 +323,7 @@ class ImportDialog(gtk.Dialog):
if k == self.col_nloc:
column.set_cell_data_func(rend, self._render, k)
- if k in self.tips.keys():
+ if k in list(self.tips.keys()):
LOG.debug("Doing %s" % k)
lab = gtk.Label(self.caps[k])
column.set_widget(lab)
@@ -518,7 +516,7 @@ class ImportDialog(gtk.Dialog):
except errors.InvalidMemoryLocation:
LOG.error("Location %i empty or at limit of destination radio" %
number)
- except errors.InvalidDataError, e:
+ except errors.InvalidDataError as e:
LOG.error("Got error from radio, assuming %i beyond limits: %s" %
(number, e))
@@ -529,9 +527,9 @@ class ImportDialog(gtk.Dialog):
self.ww.set(float(i) / end)
try:
mem = self.src_radio.get_memory(i)
- except errors.InvalidMemoryLocation, e:
+ except errors.InvalidMemoryLocation as e:
continue
- except Exception, e:
+ except Exception as e:
self.__store.append(row=(False,
i,
i,
@@ -651,4 +649,4 @@ if __name__ == "__main__":
d = ImportDialog(radio)
d.run()
- print d.get_import_list()
+ print(d.get_import_list())
diff --git a/chirp/ui/inputdialog.py b/chirp/ui/inputdialog.py
index 96531d0..29a2971 100644
--- a/chirp/ui/inputdialog.py
+++ b/chirp/ui/inputdialog.py
@@ -16,7 +16,7 @@
import gtk
import logging
-from miscwidgets import make_choice
+from chirp.ui.miscwidgets import make_choice
from chirp.ui import reporting
LOG = logging.getLogger(__name__)
diff --git a/chirp/ui/mainapp.py b/chirp/ui/mainapp.py
index f527227..5ac2156 100644
--- a/chirp/ui/mainapp.py
+++ b/chirp/ui/mainapp.py
@@ -17,7 +17,6 @@
from datetime import datetime
import os
import tempfile
-import urllib
import webbrowser
from glob import glob
import shutil
@@ -28,8 +27,9 @@ import gobject
import sys
from chirp.ui import inputdialog, common
+from chirp.ui import compat
from chirp import platform, directory, util
-from chirp.drivers import generic_xml, generic_csv, repeaterbook
+from chirp.drivers import generic_csv, repeaterbook
from chirp.drivers import ic9x, kenwood_live, idrp, vx7, vx5, vx6
from chirp.drivers import icf, ic9x_icf
from chirp import CHIRP_VERSION, chirp_common, detect, errors
@@ -45,7 +45,7 @@ if __name__ == "__main__":
try:
import serial
-except ImportError, e:
+except ImportError as e:
common.log_exception()
common.show_error("\nThe Pyserial module is not installed!")
@@ -374,7 +374,7 @@ of file.
if not radio:
return
LOG.debug("Manually selected %s" % radio)
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error(os.path.basename(fname) + ": " + str(e))
return
@@ -384,7 +384,7 @@ of file.
eset = editorset.EditorSet(radio, self,
filename=fname,
tempname=tempname)
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error(
_("There was an error opening {fname}: {error}").format(
@@ -491,7 +491,7 @@ of file.
try:
eset.save(fname)
- except Exception, e:
+ except Exception as e:
d = inputdialog.ExceptionDialog(e)
d.run()
d.destroy()
@@ -502,7 +502,7 @@ of file.
if not emsg:
self.do_open_live(radio, tempname="(" + _("Untitled") + ")")
else:
- d = inputdialog.ExceptionDialog(emsg)
+ d = inputdialog.ExceptionDialog(emsg, parent=self)
d.run()
d.destroy()
@@ -574,7 +574,7 @@ of file.
try:
shutil.copy(fn, stock_dir)
LOG.debug("Copying %s -> %s" % (fn, stock_dir))
- except Exception, e:
+ except Exception as e:
LOG.error("Unable to copy %s to %s: %s" % (fn, stock_dir, e))
return False
return True
@@ -584,7 +584,7 @@ of file.
if not os.path.isdir(stock_dir):
try:
os.mkdir(stock_dir)
- except Exception, e:
+ except Exception as e:
LOG.error("Unable to create directory: %s" % stock_dir)
return
if not self.copy_shipped_stock_configs(stock_dir):
@@ -725,13 +725,14 @@ of file.
(rclass.VENDOR, rclass.MODEL, settings.port))
try:
- ser = serial.Serial(port=settings.port,
- baudrate=rclass.BAUD_RATE,
- rtscts=rclass.HARDWARE_FLOW,
- timeout=0.25)
+ ser = compat.CompatSerial.get(rclass.NEEDS_COMPAT_SERIAL,
+ port=settings.port,
+ baudrate=rclass.BAUD_RATE,
+ rtscts=rclass.HARDWARE_FLOW,
+ timeout=0.25)
ser.flushInput()
- except serial.SerialException, e:
- d = inputdialog.ExceptionDialog(e)
+ except serial.SerialException as e:
+ d = inputdialog.ExceptionDialog(e, parent=self)
d.run()
d.destroy()
return
@@ -771,12 +772,13 @@ of file.
return
try:
- ser = serial.Serial(port=settings.port,
- baudrate=radio.BAUD_RATE,
- rtscts=radio.HARDWARE_FLOW,
- timeout=0.25)
+ ser = compat.CompatSerial.get(radio.NEEDS_COMPAT_SERIAL,
+ port=settings.port,
+ baudrate=radio.BAUD_RATE,
+ rtscts=radio.HARDWARE_FLOW,
+ timeout=0.25)
ser.flushInput()
- except serial.SerialException, e:
+ except serial.SerialException as e:
d = inputdialog.ExceptionDialog(e)
d.run()
d.destroy()
@@ -910,7 +912,7 @@ of file.
radio = dmrmarc.DMRMARCRadio(None)
radio.set_params(city, state, country)
self.do_open_live(radio, read_only=True)
- except errors.RadioError, e:
+ except errors.RadioError as e:
common.show_error(e)
self.window.set_cursor(None)
@@ -963,28 +965,31 @@ of file.
band = miscwidgets.make_choice(sorted(RB_BANDS.keys(), key=key_bands),
False, default_band)
- def _changed(box, county):
- state = fips.FIPS_STATES[box.get_active_text()]
+ def _changed(box, state, county):
+ state = fips.FIPS_STATES[state.get_active_text()]
county.get_model().clear()
for fips_county in sorted(fips.FIPS_COUNTIES[state].keys()):
county.append_text(fips_county)
- county.set_active(0)
+ county.value = list(sorted(fips.FIPS_COUNTIES[state].keys()))[0]
- state.connect("changed", _changed, county)
+ state.widget.connect("changed", _changed, state, county)
d = inputdialog.FieldDialog(title=_("RepeaterBook Query"), parent=self)
- d.add_field("State", state)
- d.add_field("County", county)
- d.add_field("Band", band)
+ d.add_field("State", state.widget)
+ d.add_field("County", county.widget)
+ d.add_field("Band", band.widget)
r = d.run()
+ chose_state = state.get_active_text()
+ chose_county = county.get_active_text()
+ chose_band = band.get_active_text()
d.destroy()
if r != gtk.RESPONSE_OK:
return False
- code = fips.FIPS_STATES[state.get_active_text()]
- county_id = fips.FIPS_COUNTIES[code][county.get_active_text()]
- freq = RB_BANDS[band.get_active_text()]
+ code = fips.FIPS_STATES[chose_state]
+ county_id = fips.FIPS_COUNTIES[code][chose_county]
+ freq = RB_BANDS[chose_band]
CONF.set("state", str(code), "repeaterbook")
CONF.set("county", str(county_id), "repeaterbook")
CONF.set("band", str(freq), "repeaterbook")
@@ -1021,35 +1026,37 @@ of file.
query = query % (code,
band and band or "%%",
county and county or "%%")
- print query
# Do this in case the import process is going to take a while
# to make sure we process events leading up to this
- gtk.gdk.window_process_all_updates()
- while gtk.events_pending():
- gtk.main_iteration(False)
+ with compat.py3safe():
+ gtk.gdk.window_process_all_updates()
+ while gtk.events_pending():
+ gtk.main_iteration(False)
fn = tempfile.mktemp(".csv")
- filename, headers = urllib.urlretrieve(query, fn)
- if not os.path.exists(filename):
- LOG.error("Failed, headers were: %s", headers)
+ try:
+ chirp_common.urlretrieve(query, fn)
+ except Exception as e:
+ LOG.error('Failed to fetch %s: %s' % (query, e))
+ if not os.path.exists(fn):
common.show_error(_("RepeaterBook query failed"))
self.window.set_cursor(None)
return
try:
# Validate CSV
- radio = repeaterbook.RBRadio(filename)
+ radio = repeaterbook.RBRadio(fn)
if radio.errors:
reporting.report_misc_error("repeaterbook",
("query=%s\n" % query) +
("\n") +
("\n".join(radio.errors)))
- except errors.InvalidDataError, e:
+ except errors.InvalidDataError as e:
common.show_error(str(e))
self.window.set_cursor(None)
return
- except Exception, e:
+ except Exception as e:
common.log_exception()
reporting.report_model_usage(radio, "import", True)
@@ -1057,7 +1064,7 @@ of file.
self.window.set_cursor(None)
if do_import:
eset = self.get_current_editorset()
- count = eset.do_import(filename)
+ count = eset.do_import(fn)
else:
self.do_open_live(radio, read_only=True)
@@ -1082,7 +1089,10 @@ of file.
d = inputdialog.FieldDialog(title=_("RepeaterBook Query"),
parent=self)
for k in sorted(fields.keys()):
- d.add_field(k[1:], fields[k][0])
+ widget = fields[k][0]
+ if isinstance(widget, miscwidgets.EditableChoiceBase):
+ widget = widget.widget
+ d.add_field(k[1:], widget)
if isinstance(fields[k][0], gtk.Entry):
fields[k][0].set_text(
CONF.get(k[1:].lower(), "repeaterbook") or "")
@@ -1131,31 +1141,34 @@ of file.
# Do this in case the import process is going to take a while
# to make sure we process events leading up to this
- gtk.gdk.window_process_all_updates()
- while gtk.events_pending():
- gtk.main_iteration(False)
+ with compat.py3safe():
+ gtk.gdk.window_process_all_updates()
+ while gtk.events_pending():
+ gtk.main_iteration(False)
fn = tempfile.mktemp(".csv")
- filename, headers = urllib.urlretrieve(query, fn)
- if not os.path.exists(filename):
- LOG.error("Failed, headers were: %s", headers)
+ try:
+ chirp_common.urlretrieve(query, fn)
+ except Exception as e:
+ LOG.error('Failed to fetch %s: %s' % (query, e))
+ if not os.path.exists(fn):
common.show_error(_("RepeaterBook query failed"))
self.window.set_cursor(None)
return
try:
# Validate CSV
- radio = repeaterbook.RBRadio(filename)
+ radio = repeaterbook.RBRadio(fn)
if radio.errors:
reporting.report_misc_error("repeaterbook",
("query=%s\n" % query) +
("\n") +
("\n".join(radio.errors)))
- except errors.InvalidDataError, e:
+ except errors.InvalidDataError as e:
common.show_error(str(e))
self.window.set_cursor(None)
return
- except Exception, e:
+ except Exception as e:
common.log_exception()
reporting.report_model_usage(radio, "import", True)
@@ -1163,7 +1176,7 @@ of file.
self.window.set_cursor(None)
if do_import:
eset = self.get_current_editorset()
- count = eset.do_import(filename)
+ count = eset.do_import(fn)
else:
self.do_open_live(radio, read_only=True)
@@ -1226,9 +1239,11 @@ of file.
return
fn = tempfile.mktemp(".csv")
- filename, headers = urllib.urlretrieve(url, fn)
- if not os.path.exists(filename):
- LOG.error("Failed, headers were: %s", str(headers))
+ try:
+ chirp_common.urlretrieve(url, fn)
+ except Exception as e:
+ LOG.error('Failed to fetch %s: %s' % (url, e))
+ if not os.path.exists(fn):
common.show_error(_("Query failed"))
return
@@ -1238,14 +1253,14 @@ of file.
MODEL = ""
try:
- radio = PRRadio(filename)
- except Exception, e:
+ radio = PRRadio(fn)
+ except Exception as e:
common.show_error(str(e))
return
if do_import:
eset = self.get_current_editorset()
- count = eset.do_import(filename)
+ count = eset.do_import(fn)
else:
self.do_open_live(radio, read_only=True)
@@ -1378,7 +1393,7 @@ of file.
radio = radioreference.RadioReferenceRadio(None)
radio.set_params(zipcode, username, passwd)
self.do_open_live(radio, read_only=True)
- except errors.RadioError, e:
+ except errors.RadioError as e:
common.show_error(e)
self.window.set_cursor(None)
@@ -1423,18 +1438,14 @@ of file.
sys.version.split()[0])
# Set url hook to handle user activating a URL link in the about dialog
- gtk.about_dialog_set_url_hook(lambda dlg, url: webbrowser.open(url))
+ with compat.py3safe():
+ gtk.about_dialog_set_url_hook(
+ lambda dlg, url: webbrowser.open(url))
d.set_name("CHIRP")
d.set_version(CHIRP_VERSION)
d.set_copyright("Copyright 2019 CHIRP Software LLC")
d.set_website("http://chirp.danplanet.com")
- d.set_authors(("Dan Smith KK7DS <dsmith@danplanet.com>",
- _("With significant contributions from:"),
- "Tom KD7LXL",
- "Marco IZ3GME",
- "Jim KC9HI"
- ))
d.set_translator_credits("Polish: Grzegorz SQ2RBY" +
os.linesep +
"Italian: Fabio IZ2QDH" +
@@ -1620,7 +1631,7 @@ of file.
# See this for why:
# http://stackoverflow.com/questions/2904274/globals-and-locals-in-python-exec
exec(pyc, globals(), globals())
- except Exception, e:
+ except Exception as e:
common.log_exception()
common.show_error("Unable to load module: %s" % e)
@@ -1934,15 +1945,19 @@ of file.
box = gtk.HBox(False, 2)
self.sb_general = gtk.Statusbar()
- self.sb_general.set_has_resize_grip(False)
self.sb_general.show()
box.pack_start(self.sb_general, 1, 1, 1)
self.sb_radio = gtk.Statusbar()
- self.sb_radio.set_has_resize_grip(True)
self.sb_radio.show()
box.pack_start(self.sb_radio, 1, 1, 1)
+ with compat.py3safe(quiet=True):
+ # Gtk2 had resize grips on the status bars, so remove them
+ # if we can
+ self.sb_general.set_has_resize_grip(False)
+ self.sb_radio.set_has_resize_grip(True)
+
box.show()
return box
@@ -2029,8 +2044,15 @@ of file.
except ImportError:
pass
+ # for gtk-mac-integration 2.1.3 in brew
+ try:
+ from gi.repository import GtkosxApplication
+ macapp = GtkosxApplication.Application()
+ except ImportError:
+ pass
+
if macapp is None:
- LOG.error("No MacOS support: %s" % e)
+ LOG.error("No MacOS support")
return
this_platform = platform.get_platform()
@@ -2061,11 +2083,16 @@ of file.
def __init__(self, *args, **kwargs):
gtk.Window.__init__(self, *args, **kwargs)
- def expose(window, event):
+ def expose(window, event=None):
allocation = window.get_allocation()
CONF.set_int("window_w", allocation.width, "state")
CONF.set_int("window_h", allocation.height, "state")
- self.connect("expose_event", expose)
+
+ with compat.py3safe(quiet=True):
+ # GTK3 does not have 'expose_event' and I am not sure which
+ # is a suitable replacement. We only need this to save window
+ # size in the config, so don't warn about it.
+ self.connect("expose_event", expose)
def state_change(window, event):
CONF.set_bool(
diff --git a/chirp/ui/memdetail.py b/chirp/ui/memdetail.py
index d58ecde..bee6083 100644
--- a/chirp/ui/memdetail.py
+++ b/chirp/ui/memdetail.py
@@ -19,6 +19,7 @@ import logging
from chirp import chirp_common, settings
from chirp.ui import miscwidgets, common
+from chirp.ui import compat
LOG = logging.getLogger(__name__)
@@ -61,24 +62,24 @@ class ValueEditor:
try:
newval = self._get_value()
- except ValueError, e:
+ except ValueError as e:
self._errfn(self._name, str(e))
return str(e)
if self._name.startswith("extra_"):
try:
self._memory.extra[self._name.split("_", 1)[1]].value = newval
- except settings.InternalError, e:
+ except settings.InternalError as e:
self._errfn(self._name, str(e))
return str(e)
else:
try:
setattr(self._memory, self._name, newval)
- except chirp_common.ImmutableValueError, e:
+ except chirp_common.ImmutableValueError as e:
if getattr(self._memory, self._name) != self._get_value():
self._errfn(self._name, str(e))
return str(e)
- except ValueError, e:
+ except ValueError as e:
self._errfn(self._name, str(e))
return str(e)
@@ -95,7 +96,11 @@ class ValueEditor:
class StringEditor(ValueEditor):
def _init(self, data):
- self._widget = gtk.Entry(int(data))
+ try:
+ self._widget = gtk.Entry(int(data))
+ except TypeError:
+ self._widget = gtk.Entry()
+ self._widget.set_max_length(int(data))
self._widget.set_text(str(self._mem_value()))
self._widget.connect("changed", self.changed)
@@ -108,13 +113,15 @@ class StringEditor(ValueEditor):
class ChoiceEditor(ValueEditor):
def _init(self, data):
- self._widget = miscwidgets.make_choice([str(x) for x in data],
+ self._choice = miscwidgets.make_choice([str(x) for x in data],
False,
str(self._mem_value()))
+ self._widget = self._choice.widget
+
self._widget.connect("changed", self.changed)
def _get_value(self):
- return self._widget.get_active_text()
+ return self._choice.value
def changed(self, _widget):
self.update()
@@ -295,7 +302,7 @@ class MemoryDetailEditor(gtk.Dialog):
buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
self.set_size_request(-1, 500)
- self._tips = gtk.Tooltips()
+ self._tips = compat.CompatTooltips()
self._features = features
diff --git a/chirp/ui/memedit.py b/chirp/ui/memedit.py
index e521e5f..a1581f5 100644
--- a/chirp/ui/memedit.py
+++ b/chirp/ui/memedit.py
@@ -16,6 +16,7 @@
import threading
+import base64
import gtk
import pango
from gobject import TYPE_INT, \
@@ -29,7 +30,10 @@ import pickle
import os
import logging
+import six
+
from chirp.ui import common, shiftdialog, miscwidgets, config, memdetail
+from chirp.ui import compat
from chirp.ui import bandplans
from chirp import chirp_common, errors, directory, import_logic
@@ -178,7 +182,7 @@ class MemoryEditor(common.Editor):
try:
new = chirp_common.parse_freq(new)
- except ValueError, e:
+ except ValueError as e:
LOG.error("chirp_common.parse_freq error: %s", e)
new = None
@@ -423,12 +427,14 @@ class MemoryEditor(common.Editor):
if extd:
val = extd
- return val
+ return str(val)
def render(self, _, rend, model, iter, colnum):
- val, hide = model.get(iter, colnum, self.col("_hide_cols"))
+ val, hide, filled = model.get(iter, colnum, self.col("_hide_cols"),
+ self.col('_filled'))
val = self._render(colnum, val, iter, hide or [])
rend.set_property("text", "%s" % val)
+ rend.set_sensitive(filled)
def insert_new(self, iter, loc=None):
line = []
@@ -911,18 +917,41 @@ class MemoryEditor(common.Editor):
return uim.get_widget("/Menu")
+ def double_click_empty_memory(self, treeiter, path, col):
+ loc = self.store.get(treeiter, self.col(_('Loc')))
+ # Make this filled=True, thus sensitive=True
+ self.store.set(treeiter, self.col(_('_filled')), True)
+ # Set the cursor and stat editing
+ self.view.set_cursor(path, col, True)
+
def click_cb(self, view, event):
self.emit("usermsg", "")
- if event.button == 3:
- pathinfo = view.get_path_at_pos(int(event.x), int(event.y))
- if pathinfo is not None:
- path, col, x, y = pathinfo
- view.grab_focus()
- sel = view.get_selection()
- if (not sel.path_is_selected(path)):
- view.set_cursor(path, col)
- menu = self.make_context_menu()
+
+ pathinfo = view.get_path_at_pos(int(event.x), int(event.y))
+ if pathinfo is None:
+ return
+ path, col, x, y = pathinfo
+ treeiter = self.store.get_iter(path)
+
+ if hasattr(gtk.gdk.EventType, '_2BUTTON_PRESS'):
+ double_click = event.type == gtk.gdk.EventType._2BUTTON_PRESS
+ else:
+ double_click = False
+
+ if event.button == 1 and double_click:
+ filled, = self.store.get(treeiter, self.col(_('_filled')))
+ if not filled:
+ self.double_click_empty_memory(treeiter, path, col)
+ return True
+ elif event.button == 3:
+ view.set_cursor(path, col)
+ menu = self.make_context_menu()
+ try:
menu.popup(None, None, None, event.button, event.time)
+ except TypeError:
+ # GTK3
+ menu.popup(None, None, None, None, event.button,
+ event.time)
return True
def get_column_visible(self, col):
@@ -939,7 +968,6 @@ class MemoryEditor(common.Editor):
def cell_editing_stopped(self, *args):
self._in_editing = False
- print 'Would activate %s' % str(self._edit_path)
self.view.grab_focus()
self.view.set_cursor(*self._edit_path)
@@ -972,7 +1000,7 @@ class MemoryEditor(common.Editor):
for i in col_order:
if i not in default_col_order:
raise Exception()
- except Exception, e:
+ except Exception as e:
LOG.error("column order setting: %s", e)
col_order = default_col_order
@@ -981,12 +1009,14 @@ class MemoryEditor(common.Editor):
unsupported_cols = self.get_unsupported_columns()
visible_cols = self.get_columns_visible()
+ self._renderers = {}
cols = {}
i = 0
for _cap, _type, _rend in self.cols:
if not _rend:
continue
rend = _rend()
+ self._renderers[_cap] = rend
rend.connect('editing-started', self.cell_editing_started)
rend.connect('editing-canceled', self.cell_editing_stopped)
rend.connect('edited', self.cell_editing_stopped)
@@ -1002,18 +1032,18 @@ class MemoryEditor(common.Editor):
else:
choices = gtk.ListStore(TYPE_STRING, TYPE_STRING)
for choice in self.choices[_cap]:
- choices.append([choice, self._render(i, choice)])
+ choices.append([str(choice), self._render(i, choice)])
rend.set_property("model", choices)
rend.set_property("text-column", 1)
rend.set_property("editable", True)
rend.set_property("has-entry", False)
rend.connect("edited", self.edited, _cap)
- col = gtk.TreeViewColumn(_cap, rend, text=i, sensitive=filled)
+ col = gtk.TreeViewColumn(_cap, rend, text=i)
col.set_cell_data_func(rend, self.render, i)
else:
rend.set_property("editable", _cap not in non_editable)
rend.connect("edited", self.edited, _cap)
- col = gtk.TreeViewColumn(_cap, rend, text=i, sensitive=filled)
+ col = gtk.TreeViewColumn(_cap, rend, text=i)
col.set_cell_data_func(rend, self.render, i)
col.set_reorderable(True)
@@ -1049,6 +1079,15 @@ class MemoryEditor(common.Editor):
_("Internal Error: Column {name} not found").format(
name=caption))
+ def rend(self, caption):
+ try:
+ return self._renderers[caption]
+ except KeyError:
+ print(self._renderers)
+ raise Exception(
+ _('Internal Error: Renderer for column %s not found') % (
+ caption))
+
def prefill(self):
self.store.clear()
self._rows_in_store = 0
@@ -1097,7 +1136,9 @@ class MemoryEditor(common.Editor):
self.col(_("Duplex")), memory.duplex,
self.col(_("Offset")), memory.offset,
self.col(_("Mode")), memory.mode,
- self.col(_("Power")), memory.power or "",
+ self.col(_("Power")), (memory.power and
+ str(memory.power) or
+ ""),
self.col(_("Tune Step")), memory.tuning_step,
self.col(_("Skip")), memory.skip,
self.col(_("Comment")), memory.comment)
@@ -1192,7 +1233,8 @@ class MemoryEditor(common.Editor):
self._config.get_int(hikey) or 999
self.lo_limit_adj = gtk.Adjustment(lostart, min, max-1, 1, 10)
- lo = gtk.SpinButton(self.lo_limit_adj)
+ lo = compat.SpinButton(self.lo_limit_adj)
+ lo.set_value(lostart)
lo.connect("value-changed", self._store_limit, "lo")
lo.show()
hbox.pack_start(lo, 0, 0, 0)
@@ -1202,7 +1244,8 @@ class MemoryEditor(common.Editor):
hbox.pack_start(lab, 0, 0, 0)
self.hi_limit_adj = gtk.Adjustment(histart, min+1, max, 1, 10)
- hi = gtk.SpinButton(self.hi_limit_adj)
+ hi = compat.SpinButton(self.hi_limit_adj)
+ hi.set_value(histart)
hi.connect("value-changed", self._store_limit, "hi")
hi.show()
hbox.pack_start(hi, 0, 0, 0)
@@ -1430,9 +1473,16 @@ class MemoryEditor(common.Editor):
self._set_memory(iter, mem)
- result = pickle.dumps((self._features, selection))
- clipboard = gtk.Clipboard(selection="CLIPBOARD")
- clipboard.set_text(result)
+ result = base64.b64encode(pickle.dumps((self._features,
+ selection))).decode()
+ if hasattr(gtk.Clipboard, 'get'):
+ # GTK3
+ clipboard = gtk.Clipboard.get(gtk.gdk.SELECTION_CLIPBOARD)
+ clipboard.set_text(result, len(result))
+ else:
+ # GTK2
+ clipboard = gtk.Clipboard(selection="CLIPBOARD")
+ clipboard.set_text(result)
clipboard.store()
return cut # Only changed if we did a cut
@@ -1451,7 +1501,7 @@ class MemoryEditor(common.Editor):
always = False
try:
- src_features, mem_list = pickle.loads(text)
+ src_features, mem_list = pickle.loads(base64.b64decode(text))
except Exception:
LOG.error("Paste failed to unpickle")
return
@@ -1526,8 +1576,15 @@ class MemoryEditor(common.Editor):
self.rthread.submit(job)
def paste_selection(self):
- clipboard = gtk.Clipboard(selection="CLIPBOARD")
- clipboard.request_text(self._paste_selection)
+ if hasattr(gtk.Clipboard, 'get'):
+ # GTK3
+ clipboard = gtk.Clipboard.get(gtk.gdk.SELECTION_CLIPBOARD)
+ text = clipboard.wait_for_text()
+ self._paste_selection(clipboard, text, None)
+ else:
+ # GTK2
+ clipboard = gtk.Clipboard(selection="CLIPBOARD")
+ clipboard.request_text(self._paste_selection)
def select_all(self):
self.view.get_selection().select_all()
@@ -1642,13 +1699,11 @@ class DstarMemoryEditor(MemoryEditor):
for i in _dv_columns:
if i not in self.choices:
continue
- column = self.view.get_column(self.col(i))
- rend = column.get_cell_renderers()[0]
+ rend = self.rend(i)
rend.set_property("has-entry", True)
for i in _dv_columns:
- col = self.view.get_column(self.col(i))
- rend = col.get_cell_renderers()[0]
+ rend = self.rend(i)
rend.set_property("family", "Monospace")
def set_urcall_list(self, urcalls):
diff --git a/chirp/ui/miscwidgets.py b/chirp/ui/miscwidgets.py
index 768cfb6..e68ae2a 100644
--- a/chirp/ui/miscwidgets.py
+++ b/chirp/ui/miscwidgets.py
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import abc
import gtk
import gobject
import pango
@@ -20,7 +21,11 @@ import pango
import os
import logging
+import six
+
from chirp import platform
+from chirp.ui import compat
+from chirp.ui import common
LOG = logging.getLogger(__name__)
@@ -65,6 +70,8 @@ class KeyedListWidget(gtk.HBox):
def _make_view(self):
colnum = -1
+ self._renderers = []
+
for typ, cap in self.columns:
colnum += 1
if colnum == 0:
@@ -82,6 +89,8 @@ class KeyedListWidget(gtk.HBox):
else:
raise Exception("Unsupported type %s" % typ)
+ self._renderers.append(rend)
+
column.set_sort_column_id(colnum)
self.__view.append_column(column)
@@ -130,7 +139,7 @@ class KeyedListWidget(gtk.HBox):
try:
(store, iter) = self.__view.get_selection().get_selected()
return store.get(iter, 0)[0]
- except Exception, e:
+ except Exception as e:
LOG.error("Unable to find selected: %s" % e)
return None
@@ -185,8 +194,7 @@ class KeyedListWidget(gtk.HBox):
gtk.HBox.connect(self, signame, *args)
def set_editable(self, column, is_editable):
- col = self.__view.get_column(column)
- rend = col.get_cell_renderers()[0]
+ rend = self.get_renderer(column)
rend.set_property("editable", True)
rend.connect("edited", self._edited, column + 1)
@@ -197,7 +205,7 @@ class KeyedListWidget(gtk.HBox):
col.set_sort_column_id(value)
def get_renderer(self, colnum):
- return self.__view.get_column(colnum).get_cell_renderers()[0]
+ return self._renderers[colnum]
class ListWidget(gtk.HBox):
@@ -300,7 +308,7 @@ class ListWidget(gtk.HBox):
try:
(lst, iter) = self._view.get_selection().get_selected()
lst.remove(iter)
- except Exception, e:
+ except Exception as e:
LOG.error("Unable to remove selected: %s" % e)
def get_selected(self, take_default=False):
@@ -322,7 +330,7 @@ class ListWidget(gtk.HBox):
target = lst.get_iter(pos-1)
elif delta < 0:
target = lst.get_iter(pos+1)
- except Exception, e:
+ except Exception as e:
return False
if target:
@@ -588,7 +596,7 @@ class LatLonEntry(gtk.Entry):
except:
try:
return self.parse_dms(string)
- except Exception, e:
+ except Exception as e:
LOG.error("DMS: %s" % e)
raise Exception("Invalid format")
@@ -615,23 +623,138 @@ class YesNoDialog(gtk.Dialog):
self._label.set_text(text)
-def make_choice(options, editable=True, default=None):
- if editable:
- sel = gtk.combo_box_entry_new_text()
- else:
- sel = gtk.combo_box_new_text()
+@six.add_metaclass(abc.ABCMeta)
+class EditableChoiceBase(object):
+ def __init__(self, options, editable, default):
+ pass
- for opt in options:
- sel.append_text(opt)
+ @property
+ @abc.abstractmethod
+ def widget(self):
+ raise NotImplementedError()
+
+ @property
+ @abc.abstractmethod
+ def value(self):
+ pass
+
+ @value.setter
+ @abc.abstractmethod
+ def value(self):
+ pass
+
+ @abc.abstractmethod
+ def get_model(self):
+ pass
+
+ @abc.abstractmethod
+ def append_text(self, text):
+ """Add a choice option"""
+ pass
+
+ def set_active(self, text):
+ """Legacy compat"""
+ self.value = text
+
+ def get_active_text(self):
+ """Legacy compat"""
+ return self.value
+
+ def set_sensitive(self, sensitive):
+ self.widget.set_sensitive(sensitive)
+
+ def connect(self, signal, fn, data):
+ self.widget.connect(signal, lambda *a: fn(self, data))
- if default:
- try:
- idx = options.index(default)
- sel.set_active(idx)
- except:
- pass
- return sel
+class EditableChoiceGTK3(EditableChoiceBase):
+ def __init__(self, options, editable, default):
+ self.store = gtk.ListStore(str)
+ for i, option in enumerate(options):
+ self.store.append([option])
+ if editable:
+ self.sel = gtk.ComboBox.new_with_model_and_entry(self.store)
+ self.sel.set_entry_text_column(0)
+ else:
+ self.sel = gtk.ComboBox.new_with_model(self.store)
+ renderer_text = gtk.CellRendererText()
+ self.sel.pack_start(renderer_text, True)
+ self.sel.add_attribute(renderer_text, "text", 0)
+ if default:
+ self.value = default
+
+ @property
+ def widget(self):
+ return self.sel
+
+ @property
+ def value(self):
+ modeliter = self.sel.get_active_iter()
+ if modeliter:
+ return self.store[modeliter][0]
+ else:
+ LOG.warning('No active iter')
+
+ @value.setter
+ def value(self, val):
+ modeliter = self.store.get_iter_first()
+ while modeliter is not None:
+ row = self.store[modeliter]
+ if row[0] == val:
+ self.sel.set_active_iter(modeliter)
+ break
+ modeliter = self.store.iter_next(modeliter)
+
+ def get_model(self):
+ return self.store
+
+ def append_text(self, text):
+ self.store.append([text])
+
+
+class EditableChoiceGTK2(EditableChoiceBase):
+ def __init__(self, options, editable, default):
+ if editable:
+ self.sel = gtk.combo_box_entry_new_text()
+ else:
+ self.sel = gtk.combo_box_new_text()
+
+ for opt in options:
+ self.sel.append_text(opt)
+
+ if default:
+ try:
+ idx = options.index(default)
+ self.sel.set_active(idx)
+ except Exception as e:
+ pass
+
+ @property
+ def widget(self):
+ return self.sel
+
+ @property
+ def value(self):
+ store = self.sel.get_model()
+ modeliter = self.sel.get_active_iter()
+ return store[modeliter][0]
+
+ @value.setter
+ def value(self, val):
+ common.combo_select(self.sel, val)
+
+ def get_model(self):
+ return self.sel.get_model()
+
+ def append_text(self, text):
+ self.sel.append_text(text)
+
+
+def make_choice(options, editable=True, default=None):
+ if hasattr(gtk.ComboBox, 'new_with_entry'):
+ return EditableChoiceGTK3(options, editable, default)
+ else:
+ return EditableChoiceGTK2(options, editable, default)
class FilenameBox(gtk.HBox):
@@ -737,9 +860,9 @@ def test():
def print_val(entry):
if entry.validate():
- print "Valid: %s" % entry.value()
+ print("Valid: %s" % entry.value())
else:
- print "Invalid"
+ print("Invalid")
lle.connect("activate", print_val)
lle.set_text("45 13 12")
@@ -749,7 +872,7 @@ def test():
except KeyboardInterrupt:
pass
- print lst.get_values()
+ print(lst.get_values())
if __name__ == "__main__":
diff --git a/chirp/ui/reporting.py b/chirp/ui/reporting.py
index 6908e10..ad52be9 100644
--- a/chirp/ui/reporting.py
+++ b/chirp/ui/reporting.py
@@ -132,7 +132,7 @@ class ReportThread(threading.Thread):
def _run(self):
try:
return self.__func(*self.__args)
- except Exception, e:
+ except Exception as e:
LOG.debug("Failed to report: %s" % e)
return False
diff --git a/chirp/ui/settingsedit.py b/chirp/ui/settingsedit.py
index 10e9808..60272b3 100644
--- a/chirp/ui/settingsedit.py
+++ b/chirp/ui/settingsedit.py
@@ -96,7 +96,7 @@ class SettingsEditor(common.Editor):
elif isinstance(value, settings.RadioSettingValueBoolean):
value.set_value(widget.get_active())
elif isinstance(value, settings.RadioSettingValueList):
- value.set_value(widget.get_active_text())
+ value.set_value(widget.value)
elif isinstance(value, settings.RadioSettingValueString):
value.set_value(widget.get_text())
else:
@@ -109,7 +109,7 @@ class SettingsEditor(common.Editor):
def _save_setting(self, widget, value):
try:
self._do_save_setting(widget, value)
- except settings.InvalidValueError, e:
+ except settings.InvalidValueError as e:
common.show_error(_("Invalid setting value: %s") % e)
def _build_ui_tab(self, group):
@@ -155,7 +155,7 @@ class SettingsEditor(common.Editor):
xoptions=gtk.FILL, yoptions=0,
xpadding=12, ypadding=3)
- for i in element.keys():
+ for i in list(element.keys()):
value = element[i]
if isinstance(value, settings.RadioSettingValueInteger):
widget = gtk.SpinButton()
@@ -175,15 +175,14 @@ class SettingsEditor(common.Editor):
widget.set_active(value.get_value())
widget.connect("toggled", self._save_setting, value)
elif isinstance(value, settings.RadioSettingValueList):
- widget = miscwidgets.make_choice([], editable=False)
- model = widget.get_model()
+ choice = miscwidgets.make_choice([], editable=False)
+ model = choice.get_model()
model.clear()
for option in value.get_options():
- widget.append_text(option)
- current = value.get_value()
- index = value.get_options().index(current)
- widget.set_active(index)
- widget.connect("changed", self._save_setting, value)
+ choice.append_text(option)
+ choice.value = value.get_value()
+ widget = choice.widget
+ choice.connect("changed", self._save_setting, value)
elif isinstance(value, settings.RadioSettingValueString):
widget = gtk.Entry()
widget.set_width_chars(32)
diff --git a/chirp/ui/shiftdialog.py b/chirp/ui/shiftdialog.py
index b975dbf..98fdca1 100644
--- a/chirp/ui/shiftdialog.py
+++ b/chirp/ui/shiftdialog.py
@@ -136,7 +136,7 @@ class ShiftDialog(gtk.Dialog):
try:
count = func(newhole, *args)
- except errors.InvalidMemoryLocation, e:
+ except errors.InvalidMemoryLocation as e:
self.status(str(e), 0)
self.finished()
return
diff --git a/chirp/util.py b/chirp/util.py
index 064b70b..001f749 100644
--- a/chirp/util.py
+++ b/chirp/util.py
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import six
import struct
@@ -23,15 +24,25 @@ def hexprint(data, addrfmt=None):
block_size = 8
- lines = len(data) / block_size
+ lines = len(data) // block_size
+
+ if six.PY3 and isinstance(data, bytes):
+ pad = bytes([0])
+ else:
+ pad = '\x00'
if (len(data) % block_size) != 0:
lines += 1
- data += "\x00" * ((lines * block_size) - len(data))
+ data += pad * ((lines * block_size) - len(data))
out = ""
- for block in range(0, (len(data)/block_size)):
+ if six.PY3 and isinstance(data, bytes):
+ byte_to_int = lambda b: b
+ else:
+ byte_to_int = ord
+
+ for block in range(0, (len(data) // block_size)):
addr = block * block_size
try:
out += addrfmt % locals()
@@ -46,15 +57,19 @@ def hexprint(data, addrfmt=None):
limit = block_size
for j in range(0, limit):
- out += "%02x " % ord(data[(block * block_size) + j])
+ byte = data[(block * block_size) + j]
+ if isinstance(byte, str):
+ byte = ord(byte)
+ out += "%02x " % byte
out += " "
for j in range(0, limit):
- char = data[(block * block_size) + j]
-
- if ord(char) > 0x20 and ord(char) < 0x7E:
- out += "%s" % char
+ byte = data[(block * block_size) + j]
+ if isinstance(byte, str):
+ byte = ord(byte)
+ if byte > 0x20 and byte < 0x7E:
+ out += "%s" % chr(byte)
else:
out += "."
@@ -107,3 +122,25 @@ def safe_charset_string(indexes, charset, safechar=" "):
except IndexError:
_string += safechar
return _string
+
+
+class StringStruct(object):
+ """String-compatible struct module."""
+ @staticmethod
+ def pack(*args):
+ from chirp import bitwise
+ fmt = args[0]
+ # Encode any string arguments to bytes
+ newargs = (bitwise.string_straight_encode(x) if isinstance(x, str)
+ else x
+ for x in args[1:])
+ return bitwise.string_straight_decode(struct.pack(fmt, *newargs))
+
+ @staticmethod
+ def unpack(fmt, data):
+ from chirp import bitwise
+ result = struct.unpack(fmt, bitwise.string_straight_encode(data))
+ # Decode any string results
+ return tuple(bitwise.string_straight_decode(x) if isinstance(x, bytes)
+ else x
+ for x in result)
diff --git a/chirp/wxui/__init__.py b/chirp/wxui/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/chirp/wxui/__init__.py
diff --git a/chirp/wxui/clone.py b/chirp/wxui/clone.py
new file mode 100644
index 0000000..e2a2a51
--- /dev/null
+++ b/chirp/wxui/clone.py
@@ -0,0 +1,276 @@
+import collections
+import logging
+import threading
+
+import serial
+import wx
+
+from chirp import chirp_common
+from chirp import directory
+from chirp import platform
+from chirp.ui import config
+from chirp.wxui import common
+
+LOG = logging.getLogger(__name__)
+CONF = config.get()
+
+
+class CloneThread(threading.Thread):
+ def __init__(self, radio, dialog, fn):
+ super(CloneThread, self).__init__()
+ self._radio = radio
+ self._dialog = dialog
+ self._fn = getattr(self._radio, fn)
+ self._radio.status_fn = self._status
+
+ def _status(self, status):
+ self._dialog._status(status)
+
+ def run(self):
+ try:
+ self._fn()
+ except Exception as e:
+ LOG.error('Failed to clone: %s' % e)
+ self._dialog.fail(str(e))
+ else:
+ self._dialog.complete()
+
+
+class SettingsThread(threading.Thread):
+ def __init__(self, radio, progdialog, settings=None):
+ super(SettingsThread, self).__init__()
+ self._radio = radio
+ self._dialog = progdialog
+ self.settings = settings
+ self._dialog.SetRange(100)
+ self.error = None
+
+ def run(self):
+ self._radio.pipe.open()
+ try:
+ self._run()
+ except Exception as e:
+ LOG.exception('Failed during setting operation')
+ wx.CallAfter(self._dialog.Update, 100)
+ self.error = str(e)
+ finally:
+ self._radio.pipe.close()
+
+ def _run(self):
+ if self.settings:
+ msg = _('Applying settings')
+ else:
+ msg = _('Loading settings')
+ wx.CallAfter(self._dialog.Update, 10, newmsg=msg)
+ if self.settings:
+ self._radio.set_settings(self.settings)
+ else:
+ self.settings = self._radio.get_settings()
+ wx.CallAfter(self._dialog.Update, 100, newmsg=_('Complete'))
+
+
+class ChirpCloneDialog(wx.Dialog):
+ def __init__(self, *a, **k):
+ super(ChirpCloneDialog, self).__init__(
+ *a, title='Communicate with radio', **k)
+
+ panel = wx.Panel(self)
+
+ try:
+ grid = wx.FlexGridSizer(3, 2)
+ except TypeError:
+ grid = wx.FlexGridSizer(2, 5, 0)
+
+ def _add_grid(label, control):
+ grid.Add(wx.StaticText(panel, label=label),
+ border=20, flag=wx.ALIGN_CENTER|wx.RIGHT|wx.LEFT)
+ grid.Add(control, 1, flag=wx.EXPAND)
+
+ ports = platform.get_platform().list_serial_ports()
+ last_port = CONF.get('last_port', 'state')
+ if last_port and last_port not in ports:
+ ports.insert(0, last_port)
+ elif not last_port:
+ last_port = ports[0]
+ self._port = wx.ComboBox(panel, choices=ports)
+ self._port.SetValue(last_port)
+ self.Bind(wx.EVT_COMBOBOX, self._selected_port, self._port)
+ _add_grid('Port', self._port)
+
+ self._vendor = wx.Choice(panel, choices=['Icom', 'Yaesu'])
+ _add_grid('Vendor', self._vendor)
+ self.Bind(wx.EVT_CHOICE, self._selected_vendor, self._vendor)
+
+ self._model = wx.Choice(panel, choices=[])
+ _add_grid('Model', self._model)
+ self.Bind(wx.EVT_CHOICE, self._selected_model, self._model)
+
+ self.gauge = wx.Gauge(panel)
+
+ hbox2 = wx.BoxSizer(wx.HORIZONTAL)
+
+ action = self._make_action(panel)
+
+ hbox2.Add(action)
+ self._action_button = action
+
+ cancel = wx.Button(panel, wx.ID_CANCEL)
+ hbox2.Add(cancel, flag=wx.RIGHT)
+
+ vbox = wx.BoxSizer(wx.VERTICAL)
+ vbox.Add(grid, proportion=0, flag=wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM,
+ border=20)
+ vbox.Add(self.gauge, flag=wx.EXPAND, border=10, proportion=1)
+ vbox.Add(wx.StaticLine(panel), flag=wx.EXPAND|wx.TOP, border=10)
+ vbox.Add(hbox2, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=10)
+ panel.SetSizer(vbox)
+
+ self._vendors = collections.defaultdict(list)
+ for rclass in directory.DRV_TO_RADIO.values():
+ if (not issubclass(rclass, chirp_common.CloneModeRadio) and
+ not issubclass(rclass, chirp_common.LiveRadio)):
+ continue
+ self._vendors[rclass.VENDOR].append(rclass)
+ for alias in rclass.ALIASES:
+ self._vendors[alias.VENDOR].append(alias)
+
+ self._vendor.Set(sorted(self._vendors.keys()))
+ try:
+ self.select_vendor_model(CONF.get('last_vendor', 'state'),
+ CONF.get('last_model', 'state'))
+ except ValueError as e:
+ LOG.warning('Last vendor/model not found')
+
+ def disable_model_select(self):
+ self._vendor.Disable()
+ self._model.Disable()
+
+ def disable_running(self):
+ self._port.Disable()
+ self._action_button.Disable()
+
+ def _persist_choices(self):
+ CONF.set('last_vendor', self._vendor.GetStringSelection(), 'state')
+ CONF.set('last_model', self._model.GetStringSelection(), 'state')
+ CONF.set('last_port', self._port.GetValue(), 'state')
+
+ def _selected_port(self, event):
+ self._persist_choices()
+
+ def _select_vendor(self, vendor):
+ models = [x.MODEL for x in self._vendors[vendor]]
+ self._model.Set(models)
+ self._model.SetSelection(0)
+
+ def _selected_vendor(self, event):
+ self._select_vendor(event.GetString())
+ self._persist_choices()
+
+ def _selected_model(self, event):
+ self._persist_choices()
+
+ def select_vendor_model(self, vendor, model):
+ self._vendor.SetSelection(self._vendor.GetItems().index(vendor))
+ self._select_vendor(vendor)
+ self._model.SetSelection(self._model.GetItems().index(model))
+
+ def _status(self, status):
+ def _safe_status():
+ self.gauge.SetRange(status.max)
+ self.gauge.SetValue(status.cur)
+
+ wx.CallAfter(_safe_status)
+
+ def complete(self):
+ self._radio.pipe.close()
+ wx.CallAfter(self.EndModal, wx.ID_OK)
+
+ def fail(self, message):
+ def safe_fail():
+ wx.MessageBox(message,
+ 'Error communicating with radio',
+ wx.ICON_ERROR)
+ self.EndModal(wx.ID_CANCEL)
+
+ wx.CallAfter(safe_fail)
+
+ def get_selected_rclass(self):
+ vendor = self._vendor.GetStringSelection()
+ model = self._model.GetSelection()
+ return self._vendors[vendor][model]
+
+
+class ChirpDownloadDialog(ChirpCloneDialog):
+ def _make_action(self, panel):
+ start = wx.Button(panel, label='Download')
+ start.Bind(wx.EVT_BUTTON, self._download)
+ return start
+
+ def _selected_model(self, event):
+ super(ChirpDownloadDialog, self)._selected_model(event)
+ rclass = self.get_selected_rclass()
+ prompts = rclass.get_prompts()
+ if prompts.pre_download:
+ prompt = prompts.pre_download
+ else:
+ prompt = ''
+
+ # FIXME: Handle download prompt here
+
+ def _download(self, event):
+ self.disable_model_select()
+ self.disable_running()
+
+ port = self._port.GetValue()
+ rclass = self.get_selected_rclass()
+
+ pipe = serial.Serial(port=port, baudrate=rclass.BAUD_RATE,
+ rtscts=rclass.HARDWARE_FLOW, timeout=0.25)
+ try:
+ self._radio = rclass(pipe)
+ except Exception as e:
+ self.fail(str(e))
+ return
+
+ if isinstance(self._radio, chirp_common.LiveRadio):
+ self._radio = common.LiveAdapter(self._radio)
+
+ self._radio.status_fn = self._status
+
+ self._clone_thread = CloneThread(self._radio, self, 'sync_in')
+ self._clone_thread.start()
+
+
+class ChirpUploadDialog(ChirpCloneDialog):
+ def __init__(self, radio, *a, **k):
+ super(ChirpUploadDialog, self).__init__(*a, **k)
+ self._radio = radio
+
+ self.select_vendor_model(self._radio.VENDOR,
+ self._radio.MODEL)
+
+ if isinstance(self._radio, chirp_common.LiveRadio):
+ self._radio = common.LiveAdapter(self._radio)
+
+ def _make_action(self, panel):
+ start = wx.Button(panel, label='Upload')
+ start.Bind(wx.EVT_BUTTON, self._upload)
+ self.disable_model_select()
+ return start
+
+ def _upload(self, event):
+ self.disable_running()
+
+ port = self._port.GetValue()
+
+ baud = self._radio.BAUD_RATE
+ if self._radio.pipe:
+ baud = self._radio.pipe.baudrate
+
+ pipe = serial.Serial(port=port, baudrate=baud,
+ rtscts=self._radio.HARDWARE_FLOW, timeout=0.25)
+ self._radio.set_pipe(pipe)
+ self._radio._status_fn = self._status
+
+ self._clone_thread = CloneThread(self._radio, self, 'sync_out')
+ self._clone_thread.start()
diff --git a/chirp/wxui/common.py b/chirp/wxui/common.py
new file mode 100644
index 0000000..34dcf3e
--- /dev/null
+++ b/chirp/wxui/common.py
@@ -0,0 +1,272 @@
+import functools
+import logging
+
+import wx
+
+from chirp import chirp_common
+from chirp.drivers import generic_csv
+from chirp import errors
+from chirp import settings
+
+LOG = logging.getLogger(__name__)
+
+CHIRP_DATA_MEMORY = wx.DataFormat('x-chirp/memory-channel')
+EditorChanged, EVT_EDITOR_CHANGED = wx.lib.newevent.NewCommandEvent()
+
+
+class LiveAdapter(generic_csv.CSVRadio):
+ FILE_EXTENSION = 'img'
+
+ def __init__(self, liveradio):
+ # Python2 old-style class compatibility
+ generic_csv.CSVRadio.__init__(self, None)
+ self._liveradio = liveradio
+ self.VENDOR = liveradio.VENDOR
+ self.MODEL = liveradio.MODEL
+ self.VARIANT = liveradio.VARIANT
+ self.BAUD_RATE = liveradio.BAUD_RATE
+ self.HARDWARE_FLOW = liveradio.HARDWARE_FLOW
+ self.pipe = liveradio.pipe
+ self._features = self._liveradio.get_features()
+
+ def get_features(self):
+ return self._features
+
+ def set_pipe(self, pipe):
+ self.pipe = pipe
+ self._liveradio.pipe = pipe
+
+ def sync_in(self):
+ for i in range(*self._features.memory_bounds):
+ mem = self._liveradio.get_memory(i)
+ self.set_memory(mem)
+ status = chirp_common.Status()
+ status.max = self._features.memory_bounds[1]
+ status.cur = i
+ status.msg = 'Cloning'
+ self.status_fn(status)
+
+ def sync_out(self):
+ # FIXME: Handle errors
+ for i in range(*self._features.memory_bounds):
+ mem = self.get_memory(i)
+ if mem.freq == 0:
+ # Convert the CSV notion of emptiness
+ try:
+ self._liveradio.erase_memory(i)
+ except errors.RadioError as e:
+ LOG.error(e)
+ else:
+ try:
+ self._liveradio.set_memory(mem)
+ except errors.RadioError as e:
+ LOG.error(e)
+ status = chirp_common.Status()
+ status.max = self._features.memory_bounds[1]
+ status.cur = i
+ status.msg = 'Cloning'
+ self.status_fn(status)
+
+ def get_settings(self):
+ return self._liveradio.get_settings()
+
+ def set_settings(self, settings):
+ return self._liveradio.set_settings(settings)
+
+
+class ChirpEditor(wx.Panel):
+ def cb_copy(self, cut=False):
+ pass
+
+ def cb_paste(self, data):
+ pass
+
+ def select_all(self):
+ pass
+
+ def saved(self):
+ pass
+
+ def selected(self):
+ pass
+
+
+class ChirpSettingGrid(wx.Panel):
+ def __init__(self, settinggroup, *a, **k):
+ super(ChirpSettingGrid, self).__init__(*a, **k)
+ self._group = settinggroup
+
+ self.pg = wx.propgrid.PropertyGrid(
+ self,
+ style=wx.propgrid.PG_SPLITTER_AUTO_CENTER |
+ wx.propgrid.PG_BOLD_MODIFIED)
+
+ self.pg.Bind(wx.propgrid.EVT_PG_CHANGED, self._pg_changed)
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ self.SetSizer(sizer)
+ sizer.Add(self.pg, 1, wx.EXPAND)
+
+ self._choices = {}
+
+ for name, element in self._group.items():
+ if not isinstance(element, settings.RadioSetting):
+ LOG.debug('Skipping nested group %s' % element)
+ continue
+ for i in element.keys():
+ value = element[i]
+ if isinstance(value, settings.RadioSettingValueInteger):
+ editor = self._get_editor_int(element, value)
+ elif isinstance(value, settings.RadioSettingValueFloat):
+ editor = self._get_editor_float(element, value)
+ elif isinstance(value, settings.RadioSettingValueList):
+ editor = self._get_editor_choice(element, value)
+ elif isinstance(value, settings.RadioSettingValueBoolean):
+ editor = self._get_editor_bool(element, value)
+ elif isinstance(value, settings.RadioSettingValueString):
+ editor = self._get_editor_str(element, value)
+ else:
+ LOG.warning('Unsupported setting type %r' % value)
+ editor = None
+ if editor:
+ self.pg.Append(editor)
+
+ def _pg_changed(self, event):
+ wx.PostEvent(self, EditorChanged(self.GetId()))
+
+ def _get_editor_int(self, setting, value):
+ class ChirpIntProperty(wx.propgrid.IntProperty):
+ def ValidateValue(self, val, info):
+ if not (val > value.get_min() and val < value.get_max()):
+ info.SetFailureMessage(
+ _('Value must be between %i and %i') % (
+ value.get_min(), value.get_max()))
+ return False
+ return True
+ return ChirpIntProperty(setting.get_shortname(),
+ setting.get_name(),
+ value=int(value))
+
+ def _get_editor_float(self, setting, value):
+ class ChirpFloatProperty(wx.propgrid.IntProperty):
+ def ValidateValue(self, val, info):
+ if not (val > value.get_min() and val < value.get_max()):
+ info.SetFailureMessage(
+ _('Value must be between %.4f and %.4f') % (
+ value.get_min(), value.get_max()))
+ return ChirpFloatProperty(setting.get_shortname(),
+ setting.get_name(),
+ value=int(value))
+
+ def _get_editor_choice(self, setting, value):
+ choices = value.get_options()
+ self._choices[setting.get_name()] = choices
+ current = choices.index(str(value))
+ return wx.propgrid.EnumProperty(setting.get_shortname(),
+ setting.get_name(),
+ choices, range(len(choices)),
+ current)
+
+ def _get_editor_bool(self, setting, value):
+ prop = wx.propgrid.BoolProperty(setting.get_shortname(),
+ setting.get_name(),
+ bool(value))
+ prop.SetAttribute(wx.propgrid.PG_BOOL_USE_CHECKBOX, True)
+ return prop
+
+ def _get_editor_str(self, setting, value):
+ class ChirpStrProperty(wx.propgrid.StringProperty):
+ def ValidateValue(self, text, info):
+ try:
+ value.set_value(text)
+ except Exception as e:
+ info.SetFailureMessage(str(e))
+ return False
+ return True
+
+ return ChirpStrProperty(setting.get_shortname(),
+ setting.get_name(),
+ value=str(value))
+
+ def get_values(self):
+ values = {}
+ for prop in self.pg._Items():
+ if isinstance(prop, wx.propgrid.EnumProperty):
+ value = self._choices[prop.GetName()][prop.GetValue()]
+ else:
+ value = prop.GetValue()
+ values[prop.GetName()] = value
+ return values
+
+ def saved(self):
+ for prop in self.pg._Items():
+ prop.SetModifiedStatus(False)
+
+
+def _error_proof(*expected_errors):
+ """Decorate a method and display an error if it raises.
+
+ If the method raises something in expected_errors, then
+ log an error, otherwise log exception.
+ """
+
+ def show_error(msg):
+ d = wx.MessageDialog(None, str(msg), 'An error has occurred',
+ style=wx.OK | wx.ICON_ERROR)
+ d.ShowModal()
+
+ def wrap(fn):
+ @functools.wraps(fn)
+ def inner(*args, **kwargs):
+ try:
+ return fn(*args, **kwargs)
+ except expected_errors as e:
+ LOG.error('%s: %s' % (fn, e))
+ show_error(e)
+ except Exception as e:
+ LOG.exception('%s raised unexpected exception' % fn)
+ show_error(e)
+
+ return inner
+ return wrap
+
+
+class error_proof(object):
+ def __init__(self, *expected_exceptions):
+ self._expected = expected_exceptions
+
+ @staticmethod
+ def show_error(msg):
+ d = wx.MessageDialog(None, str(msg), 'An error has occurred',
+ style=wx.OK | wx.ICON_ERROR)
+ d.ShowModal()
+
+ def run_safe(self, fn, args, kwargs):
+ try:
+ return fn(*args, **kwargs)
+ except self._expected as e:
+ LOG.error('%s: %s' % (fn, e))
+ self.show_error(e)
+ except Exception as e:
+ LOG.exception('%s raised unexpected exception' % fn)
+ self.show_error(e)
+
+ def __call__(self, fn):
+ @functools.wraps(fn)
+ def wrapper(*args, **kwargs):
+ return self.run_safe(fn, args, kwargs)
+ return wrapper
+
+ def __enter__(self):
+ pass
+
+ def __exit__(self, exc_type, exc_val, traceback):
+ if exc_type:
+ if exc_type in self._expected:
+ LOG.error('%s: %s: %s' % (fn, exc_type, exc_val))
+ self.show_error(exc_val)
+ return True
+ else:
+ LOG.exception('Context raised unexpected_exception',
+ exc_info=(exc_type, exc_val, traceback))
+ self.show_error(exc_val)
diff --git a/chirp/wxui/developer.py b/chirp/wxui/developer.py
new file mode 100644
index 0000000..a4e5c70
--- /dev/null
+++ b/chirp/wxui/developer.py
@@ -0,0 +1,364 @@
+import functools
+import logging
+import os
+
+import wx
+import wx.richtext
+import wx.lib.scrolledpanel
+
+from chirp import bitwise
+from chirp.wxui import common
+
+LOG = logging.getLogger(__name__)
+
+
+def simple_diff(a, b, diffsonly=False):
+ lines_a = a.split(os.linesep)
+ lines_b = b.split(os.linesep)
+ blankprinted = True
+
+ diff = ""
+ for i in range(0, len(lines_a)):
+ if lines_a[i] != lines_b[i]:
+ diff += "-%s%s" % (lines_a[i], os.linesep)
+ diff += "+%s%s" % (lines_b[i], os.linesep)
+ blankprinted = False
+ elif diffsonly is True:
+ if blankprinted:
+ continue
+ diff += os.linesep
+ blankprinted = True
+ else:
+ diff += " %s%s" % (lines_a[i], os.linesep)
+ return diff
+
+
+class MemoryDialog(wx.Dialog):
+ def __init__(self, mem, *a, **k):
+
+ super(MemoryDialog, self).__init__(*a, **k)
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ self.SetSizer(sizer)
+
+ self.text = wx.richtext.RichTextCtrl(
+ self, style=wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER)
+ sizer.Add(self.text, 1, wx.EXPAND)
+
+ sizer.Add(wx.StaticLine(self), 0)
+
+ btn = wx.Button(self, wx.OK, 'OK')
+ btn.Bind(wx.EVT_BUTTON, lambda e: self.EndModal(wx.OK))
+ sizer.Add(btn, 0)
+
+ font = wx.Font(12, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL,
+ wx.FONTWEIGHT_NORMAL)
+
+ self.text.BeginFont(font)
+
+ if isinstance(mem, tuple):
+ mem_a, mem_b = mem
+ self._diff_memories(mem_a, mem_b)
+ else:
+ self._raw_memory(mem)
+
+ self.Centre()
+
+ def _raw_memory(self, mem):
+ self.text.WriteText(mem)
+
+ def _diff_memories(self, mem_a, mem_b):
+ diff = simple_diff(mem_a, mem_b)
+
+ for line in diff.split(os.linesep):
+ color = None
+ if line.startswith('+'):
+ self.text.BeginTextColour((255, 0, 0))
+ color = True
+ elif line.startswith('-'):
+ self.text.BeginTextColour((0, 0, 255))
+ color = True
+ self.text.WriteText(line)
+ self.text.Newline()
+ if color:
+ self.text.EndTextColour()
+
+
+class ChirpEditor(wx.Panel):
+ def __init__(self, parent, obj):
+ super(ChirpEditor, self).__init__(parent)
+ self._obj = obj
+ self._fixed_font = wx.Font(pointSize=10,
+ family=wx.FONTFAMILY_TELETYPE,
+ style=wx.FONTSTYLE_NORMAL,
+ weight=wx.FONTWEIGHT_NORMAL)
+ self._changed_color = wx.Colour(0, 255, 0)
+ self._error_color = wx.Colour(255, 0, 0)
+
+ def set_up(self):
+ pass
+
+ def _mark_changed(self, thing):
+ thing.SetBackgroundColour(self._changed_color)
+ tt = thing.GetToolTip()
+ if not tt:
+ tt = wx.ToolTip('')
+ thing.SetToolTip(tt)
+ tt.SetTip('Press enter to set this in memory')
+
+ def _mark_unchanged(self, thing):
+ thing.SetBackgroundColour(wx.NullColour)
+ thing.UnsetToolTip()
+
+ def _mark_error(self, thing, reason):
+ tt = thing.GetToolTip()
+ if not tt:
+ tt = wx.ToolTip('')
+ thing.SetToolTip(tt)
+ tt.SetTip(reason)
+ thing.SetBackgroundColour(self._error_color)
+
+ def __repr__(self):
+ addr = '0x%02x' % int(self._obj._offset)
+
+ def typestr(c):
+ return c.__class__.__name__.lower().replace('dataelement', '')
+
+ if isinstance(self._obj, bitwise.arrayDataElement):
+ innertype = list(self._obj.items())[0][1]
+ return '%s[%i] (%i bytes each) @ %s' % (typestr(innertype),
+ len(self._obj),
+ innertype.size() / 8,
+ addr)
+ elif self._obj.size() % 8 == 0:
+ return '%s (%i bytes) @ %s' % (typestr(self._obj),
+ self._obj.size() / 8,
+ addr)
+ else:
+ return '%s bits @ %s' % (self._obj.size(),
+ addr)
+
+
+class ChirpStringEditor(ChirpEditor):
+ def set_up(self):
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ entry = wx.TextCtrl(self, value=str(self._obj),
+ style=wx.TE_PROCESS_ENTER)
+ entry.SetMaxLength(len(self._obj))
+ self.SetSizer(sizer)
+ sizer.Add(entry, 1, wx.EXPAND)
+
+ entry.Bind(wx.EVT_TEXT, self._edited)
+ entry.Bind(wx.EVT_TEXT_ENTER, self._changed)
+
+ def _edited(self, event):
+ entry = event.GetEventObject()
+ value = entry.GetValue()
+ if len(value) == len(self._obj):
+ self._mark_changed(entry)
+ else:
+ self._mark_error(entry, 'Length must be %i' % len(self._obj))
+
+ @common.error_proof()
+ def _changed(self, event):
+ entry = event.GetEventObject()
+ value = entry.GetValue()
+ self._obj.set_value(value)
+ self._mark_unchanged(entry)
+ LOG.debug('Set value: %r' % value)
+
+
+class ChirpIntegerEditor(ChirpEditor):
+ def set_up(self):
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ self.SetSizer(sizer)
+
+ hexdigits = (self._obj.size() / 4) + (self._obj.size() % 4 and 1 or 0)
+ bindigits = self._obj.size()
+
+ self._editors = {'Hex': (16, '{:0%iX}' % hexdigits),
+ 'Dec': (10, '{:d}'),
+ 'Bin': (2, '{:0%ib}' % bindigits)}
+ self._entries = {}
+ for name, (base, fmt) in self._editors.items():
+ label = wx.StaticText(self, label=name)
+ entry = wx.TextCtrl(self, value=fmt.format(int(self._obj)),
+ style=wx.TE_PROCESS_ENTER)
+ entry.SetFont(self._fixed_font)
+ sizer.Add(label, 0, wx.ALIGN_CENTER)
+ sizer.Add(entry, 1, flag=wx.EXPAND)
+ self._entries[name] = entry
+
+ entry.Bind(wx.EVT_TEXT, functools.partial(self._edited,
+ base=base))
+ entry.Bind(wx.EVT_TEXT_ENTER, functools.partial(self._changed,
+ base=base))
+
+ def _edited(self, event, base=10):
+ entry = event.GetEventObject()
+ others = {n: e for n, e in self._entries.items()
+ if e != entry}
+
+ try:
+ val = int(entry.GetValue(), base)
+ assert val >= 0, 'Value must be zero or greater'
+ assert val < pow(2, self._obj.size()), \
+ 'Value does not fit in %i bits' % self._obj.size()
+ except (ValueError, AssertionError) as e:
+ self._mark_error(entry, str(e))
+ return
+ else:
+ self._mark_changed(entry)
+
+ for name, entry in others.items():
+ base, fmt = self._editors[name]
+ entry.ChangeValue(fmt.format(val))
+
+ @common.error_proof()
+ def _changed(self, event, base=10):
+ entry = event.GetEventObject()
+ val = int(entry.GetValue(), base)
+ self._obj.set_value(val)
+ self._mark_unchanged(entry)
+ LOG.debug('Set value: %r' % val)
+
+
+class ChirpBCDEditor(ChirpEditor):
+ def set_up(self):
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ self.SetSizer(sizer)
+ entry = wx.TextCtrl(self, value=str(int(self._obj)),
+ style=wx.TE_PROCESS_ENTER)
+ entry.SetFont(self._fixed_font)
+ sizer.Add(entry, 1, wx.EXPAND)
+ entry.Bind(wx.EVT_TEXT, self._edited)
+ entry.Bind(wx.EVT_TEXT_ENTER, self._changed)
+
+ def _edited(self, event):
+ entry = event.GetEventObject()
+ try:
+ val = int(entry.GetValue())
+ digits = self._obj.size() // 4
+ assert val >= 0, 'Value must be zero or greater'
+ assert len(entry.GetValue()) == digits, \
+ 'Value must be exactly %i decimal digits' % digits
+ except (ValueError, AssertionError) as e:
+ self._mark_error(entry, str(e))
+ else:
+ self._mark_changed(entry)
+
+ @common.error_proof()
+ def _changed(self, event):
+ entry = event.GetEventObject()
+ val = int(entry.GetValue())
+ self._obj.set_value(val)
+ self._mark_unchanged(entry)
+ LOG.debug('Set Value: %r' % val)
+
+
+class ChirpBrowserPanel(wx.lib.scrolledpanel.ScrolledPanel):
+ def __init__(self, parent):
+ super(ChirpBrowserPanel, self).__init__(parent)
+ self._sizer = wx.FlexGridSizer(2)
+ self._sizer.AddGrowableCol(1)
+ self.SetSizer(self._sizer)
+ self.SetupScrolling()
+ self._editors = {}
+
+ def add_editor(self, name, editor):
+ self._editors[name] = editor
+
+ def selected(self):
+ for name, editor in self._editors.items():
+ editor.set_up()
+ label = wx.StaticText(self, label='%s: ' % name)
+ tt = wx.ToolTip(repr(editor))
+ label.SetToolTip(tt)
+
+ self._sizer.Add(label, 0, wx.ALIGN_CENTER)
+ self._sizer.Add(editor, 1, flag=wx.EXPAND)
+
+ self._editors = {}
+ self._sizer.Layout()
+
+
+class ChirpRadioBrowser(common.ChirpEditor):
+ def __init__(self, radio, *a, **k):
+ super(ChirpRadioBrowser, self).__init__(*a, **k)
+ self._loaded = False
+ self._radio = radio
+ self._features = radio.get_features()
+
+ self._treebook = wx.Treebook(self)
+
+ try:
+ view = self._treebook.GetTreeCtrl()
+ except AttributeError:
+ # https://github.com/wxWidgets/Phoenix/issues/918
+ view = self._treebook.GetChildren()[0]
+
+ view.SetMinSize((250,0))
+
+ self._treebook.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED,
+ self.page_selected)
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ sizer.Add(self._treebook, 1, wx.EXPAND)
+ self.SetSizer(sizer)
+
+ def selected(self):
+ if self._loaded:
+ return
+
+ pd = wx.ProgressDialog('Loading', 'Building Radio Browser')
+ self._loaded = True
+ self._load_from_radio('%s %s' % (self._radio.VENDOR,
+ self._radio.MODEL),
+ self._radio._memobj, pd)
+ pd.Destroy()
+ self._treebook.ExpandNode(0)
+
+ def page_selected(self, event):
+ page = self._treebook.GetPage(event.GetSelection())
+ page.selected()
+
+ def _load_from_radio(self, name, memobj, pd, parent=None):
+ editor = None
+
+ def sub_panel(name, memobj, pd, parent):
+ page = ChirpBrowserPanel(self)
+ if parent:
+ pos = self._treebook.FindPage(parent)
+ self._treebook.InsertSubPage(pos, page, name)
+ # Stop updating the progress dialog once we get past the
+ # first generation in the tree because it slows us down
+ # a lot.
+ pd = None
+ else:
+ self._treebook.AddPage(page, name)
+
+ for subname, item in memobj.items():
+ self._load_from_radio(subname, item, pd, parent=page)
+
+
+ if isinstance(memobj, bitwise.structDataElement):
+ if pd:
+ pd.Pulse('Loading %s' % name)
+ sub_panel(name, memobj, pd, parent)
+ elif isinstance(memobj, bitwise.arrayDataElement):
+ if isinstance(memobj[0], bitwise.charDataElement):
+ editor = ChirpStringEditor(parent, memobj)
+ elif isinstance(memobj[0], bitwise.bcdDataElement):
+ editor = ChirpBCDEditor(parent, memobj)
+ else:
+ if pd:
+ pd.Pulse('Loading %s' % name)
+ sub_panel('%s[%i]' % (name, len(memobj)), memobj, pd, parent)
+ elif isinstance(memobj, bitwise.intDataElement):
+ editor = ChirpIntegerEditor(parent, memobj)
+ else:
+ print('Unsupported editor type for %s (%s)' % (
+ name, memobj.__class__))
+
+ if editor:
+ parent.add_editor(name, editor)
diff --git a/chirp/wxui/main.py b/chirp/wxui/main.py
new file mode 100644
index 0000000..0c179dc
--- /dev/null
+++ b/chirp/wxui/main.py
@@ -0,0 +1,522 @@
+import datetime
+import functools
+import logging
+import os
+import sys
+
+import wx
+import wx.aui
+import wx.lib.newevent
+
+from chirp import directory
+from chirp.ui import config
+from chirp.wxui import common
+from chirp.wxui import clone
+from chirp.wxui import developer
+from chirp.wxui import memedit
+from chirp.wxui import settingsedit
+from chirp import CHIRP_VERSION
+
+EditorSetChanged, EVT_EDITORSET_CHANGED = wx.lib.newevent.NewCommandEvent()
+CONF = config.get()
+LOG = logging.getLogger(__name__)
+
+
+class ChirpEditorSet(wx.Panel):
+ def __init__(self, radio, filename, *a, **k):
+ super(ChirpEditorSet, self).__init__(*a, **k)
+ self._radio = radio
+ if filename is None:
+ filename = '%s.%s' % (self.default_filename,
+ radio.FILE_EXTENSION)
+ self._filename = filename
+ self._modified = not os.path.exists(filename)
+
+ self._editors = wx.Notebook(self, style=wx.NB_LEFT)
+
+ self._editors.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING,
+ self._editor_selected)
+
+ sizer = wx.BoxSizer()
+ sizer.Add(self._editors, 1, wx.EXPAND)
+ self.SetSizer(sizer)
+
+ features = radio.get_features()
+
+ if features.has_sub_devices:
+ radios = radio.get_sub_devices()
+ format = 'Memories (%(variant)s)'
+ else:
+ radios = [radio]
+ format = 'Memories'
+
+ for radio in radios:
+ edit = memedit.ChirpMemEdit(radio, self._editors)
+ edit.refresh()
+ self.Bind(common.EVT_EDITOR_CHANGED, self._editor_changed)
+ self._editors.AddPage(edit, format % {'variant': radio.VARIANT})
+
+ if features.has_settings:
+ if isinstance(radio, common.LiveAdapter):
+ settings = settingsedit.ChirpLiveSettingsEdit(radio,
+ self._editors)
+ else:
+ settings = settingsedit.ChirpCloneSettingsEdit(radio,
+ self._editors)
+ self._editors.AddPage(settings, 'Settings')
+
+ if CONF.get_bool('developer', 'state'):
+ browser = developer.ChirpRadioBrowser(radio, self._editors)
+ self._editors.AddPage(browser, 'Browser')
+
+ def _editor_changed(self, event):
+ self._modified = True
+ wx.PostEvent(self, EditorSetChanged(self.GetId(), editorset=self))
+
+ def _editor_selected(self, event):
+ page_index = event.GetSelection()
+ page = self._editors.GetPage(page_index)
+ page.selected()
+
+ def save(self, filename=None):
+ if filename is None:
+ filename = self.filename
+ LOG.debug('Saving to %s' % filename)
+ self._radio.save(filename)
+ self._filename = filename
+ self._modified = False
+ # FIXME
+ self._editors.GetPage(1).saved()
+
+ @property
+ def filename(self):
+ return self._filename
+
+ @property
+ def modified(self):
+ return self._modified
+
+ @property
+ def radio(self):
+ return self._radio
+
+ @property
+ def default_filename(self):
+ defname_format = CONF.get("default_filename", "global") or \
+ "{vendor}_{model}_{date}"
+ defname = defname_format.format(
+ vendor=self._radio.VENDOR,
+ model=self._radio.MODEL,
+ date=datetime.datetime.now().strftime('%Y%m%d')
+ ).replace('/', '_')
+ return defname
+
+ @property
+ def current_editor(self):
+ return self._editors.GetCurrentPage()
+
+ @property
+ def current_editor_index(self):
+ return self._editors.GetSelection()
+
+ def select_editor(self, index):
+ self._editors.SetSelection(index)
+
+ def cb_copy(self, cut=False):
+ return self.current_editor.cb_copy(cut=cut)
+
+ def cb_paste(self, data):
+ return self.current_editor.cb_paste(data)
+
+ def select_all(self):
+ return self.current_editor.select_all()
+
+
+class ChirpMain(wx.Frame):
+ def __init__(self, *args, **kwargs):
+ super(ChirpMain, self).__init__(*args, **kwargs)
+
+ self.SetSize(int(CONF.get('window_w', 'state') or 1024),
+ int(CONF.get('window_h', 'state') or 768))
+
+ self.SetMenuBar(self.make_menubar())
+
+ # Stock items look good on linux, terrible on others,
+ # so punt on this for the moment.
+ # self.make_toolbar()
+
+ self._editors = wx.aui.AuiNotebook(
+ self, style=wx.aui.AUI_NB_CLOSE_ON_ALL_TABS|wx.aui.AUI_NB_TAB_MOVE)
+ self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self._editor_close)
+ self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED,
+ self._editor_page_changed)
+ self.Bind(wx.EVT_CLOSE, self._window_close)
+
+ self._update_window_for_editor()
+
+ @property
+ def current_editorset(self):
+ return self._editors.GetCurrentPage()
+
+ def open_file(self, filename, exists=True, select=True):
+
+ if exists:
+ radio = directory.get_radio_by_image(filename)
+ else:
+ CSVRadio = directory.get_radio('Generic_CSV')
+ radio = CSVRadio(None)
+
+ editorset = ChirpEditorSet(radio, filename, self._editors)
+ self.add_editorset(editorset, select=select)
+
+ def add_editorset(self, editorset, select=True):
+ self._editors.AddPage(editorset,
+ os.path.basename(editorset.filename),
+ select=select)
+ self.Bind(EVT_EDITORSET_CHANGED, self._editor_changed, editorset)
+ self._update_editorset_title(editorset)
+
+ def make_menubar(self):
+ file_menu = wx.Menu()
+
+ new_item = file_menu.Append(wx.ID_NEW)
+ self.Bind(wx.EVT_MENU, self._menu_new, new_item)
+
+ open_item = file_menu.Append(wx.ID_OPEN)
+ self.Bind(wx.EVT_MENU, self._menu_open, open_item)
+
+ save_item = file_menu.Append(wx.ID_SAVE)
+ self.Bind(wx.EVT_MENU, self._menu_save, save_item)
+
+ save_item = file_menu.Append(wx.ID_SAVEAS)
+ self.Bind(wx.EVT_MENU, self._menu_save_as, save_item)
+
+ file_menu.Append(wx.MenuItem(file_menu, wx.ID_SEPARATOR))
+
+ close_item = file_menu.Append(wx.ID_CLOSE)
+ self.Bind(wx.EVT_MENU, self._menu_close, close_item)
+
+ exit_item = file_menu.Append(wx.ID_EXIT)
+ self.Bind(wx.EVT_MENU, self._menu_exit, exit_item)
+
+ edit_menu = wx.Menu()
+
+ cut_item = edit_menu.Append(wx.ID_CUT)
+ self.Bind(wx.EVT_MENU, functools.partial(self._menu_copy, cut=True),
+ cut_item)
+
+ copy_item = edit_menu.Append(wx.ID_COPY)
+ self.Bind(wx.EVT_MENU, self._menu_copy, copy_item)
+
+ paste_item = edit_menu.Append(wx.ID_PASTE)
+ self.Bind(wx.EVT_MENU, self._menu_paste, paste_item)
+
+ selall_item = edit_menu.Append(wx.ID_SELECTALL)
+ self.Bind(wx.EVT_MENU, self._menu_selall, selall_item)
+
+ radio_menu = wx.Menu()
+
+ self._download_menu_item = wx.NewId()
+ download_item = wx.MenuItem(radio_menu, self._download_menu_item,
+ 'Download')
+ download_item.SetAccel(wx.AcceleratorEntry(wx.ACCEL_ALT, ord('D')))
+ self.Bind(wx.EVT_MENU, self._menu_download, download_item)
+ radio_menu.Append(download_item)
+
+ self._upload_menu_item = wx.NewId()
+ upload_item = wx.MenuItem(radio_menu, self._upload_menu_item, 'Upload')
+ upload_item.SetAccel(wx.AcceleratorEntry(wx.ACCEL_ALT, ord('U')))
+ self.Bind(wx.EVT_MENU, self._menu_upload, upload_item)
+ radio_menu.Append(upload_item)
+
+ if CONF.get_bool('developer', 'state'):
+ radio_menu.Append(wx.MenuItem(file_menu, wx.ID_SEPARATOR))
+
+ self._reload_driver_item = wx.NewId()
+ reload_drv_item = wx.MenuItem(radio_menu,
+ self._reload_driver_item,
+ 'Reload Driver')
+ reload_drv_item.SetAccel(
+ wx.AcceleratorEntry(wx.ACCEL_ALT | wx.ACCEL_CTRL,
+ ord('R')))
+ self.Bind(wx.EVT_MENU, self._menu_reload_driver, reload_drv_item)
+ radio_menu.Append(reload_drv_item)
+
+ self._reload_both_item = wx.NewId()
+ reload_both_item = wx.MenuItem(radio_menu,
+ self._reload_both_item,
+ 'Reload Driver and File')
+ reload_both_item.SetAccel(
+ wx.AcceleratorEntry(
+ wx.ACCEL_ALT | wx.ACCEL_CTRL | wx.ACCEL_SHIFT,
+ ord('R')))
+ self.Bind(
+ wx.EVT_MENU,
+ functools.partial(self._menu_reload_driver, andfile=True),
+ reload_both_item)
+ radio_menu.Append(reload_both_item)
+
+ self._interact_driver_item = wx.NewId()
+ interact_drv_item = wx.MenuItem(radio_menu,
+ self._interact_driver_item,
+ 'Interact with driver')
+ self.Bind(wx.EVT_MENU, self._menu_interact_driver,
+ interact_drv_item)
+ radio_menu.Append(interact_drv_item)
+
+ help_menu = wx.Menu()
+
+ about_item = wx.MenuItem(help_menu, wx.NewId(), 'About')
+ self.Bind(wx.EVT_MENU, self._menu_about, about_item)
+ help_menu.Append(about_item)
+
+ menu_bar = wx.MenuBar()
+ menu_bar.Append(file_menu, '&File')
+ menu_bar.Append(edit_menu, '&Edit')
+ menu_bar.Append(radio_menu, '&Radio')
+ menu_bar.Append(help_menu, '&Help')
+
+ return menu_bar
+
+ def make_toolbar(self):
+ tb = self.CreateToolBar()
+
+ def bm(stock):
+ return wx.ArtProvider.GetBitmap(stock,
+ wx.ART_TOOLBAR, (32, 32))
+
+ tbopen = tb.AddTool(wx.NewId(), 'Open', bm(wx.ART_FILE_OPEN),
+ 'Open a file')
+ tbsave = tb.AddTool(wx.NewId(), 'Save', bm(wx.ART_FILE_SAVE),
+ 'Save file')
+ tbclose = tb.AddTool(wx.NewId(), 'Close', bm(wx.ART_CLOSE),
+ 'Close file')
+ tbdl = tb.AddTool(wx.NewId(), 'Download', bm(wx.ART_GO_DOWN),
+ 'Download from radio')
+ tbl = tb.AddTool(wx.NewId(), 'Upload', bm(wx.ART_GO_UP),
+ 'Upload to radio')
+
+ self.Bind(wx.EVT_MENU, self._menu_open, tbopen)
+ tb.Realize()
+
+ def _editor_page_changed(self, event):
+ self._editors.GetPage(event.GetSelection())
+ self._update_window_for_editor()
+
+ def _editor_changed(self, event):
+ self._update_editorset_title(event.editorset)
+ self._update_window_for_editor()
+
+ def _editor_close(self, event):
+ eset = self._editors.GetPage(event.GetSelection())
+ if eset.modified:
+ if wx.MessageBox(
+ '%s has not been saved. Close anyway?' % eset.filename,
+ 'Close without saving?',
+ wx.YES_NO|wx.NO_DEFAULT|wx.ICON_WARNING) != wx.YES:
+ event.Veto()
+
+ wx.CallAfter(self._update_window_for_editor)
+
+ def _update_window_for_editor(self):
+ eset = self.current_editorset
+ can_close = False
+ can_save = False
+ can_saveas = False
+ can_upload = False
+ CSVRadio = directory.get_radio('Generic_CSV')
+ if eset is not None:
+ can_close = True
+ can_save = eset.modified
+ can_saveas = True
+ can_upload = not (isinstance(eset.radio, CSVRadio) and not
+ isinstance(eset.radio, common.LiveAdapter))
+
+ items = [
+ (wx.ID_CLOSE, can_close),
+ (wx.ID_SAVE, can_save),
+ (wx.ID_SAVEAS, can_saveas),
+ (self._upload_menu_item, can_upload),
+ ]
+ for ident, enabled in items:
+ menuitem = self.GetMenuBar().FindItemById(ident)
+ menuitem.Enable(enabled)
+
+ def _window_close(self, event):
+ if any([self._editors.GetPage(i).modified
+ for i in range(self._editors.GetPageCount())]):
+ if wx.MessageBox(
+ 'Some files have not been saved. Exit anyway?',
+ 'Exit without saving?',
+ wx.YES_NO|wx.NO_DEFAULT|wx.ICON_WARNING) != wx.YES:
+ if event.CanVeto():
+ event.Veto()
+ return
+
+ size = self.GetSize()
+ CONF.set_int('window_w', size.GetWidth(), 'state')
+ CONF.set_int('window_h', size.GetHeight(), 'state')
+ config._CONFIG.save()
+ self.Destroy()
+
+ def _update_editorset_title(self, editorset):
+ index = self._editors.GetPageIndex(editorset)
+ self._editors.SetPageText(index, '%s%s' % (
+ os.path.basename(editorset.filename),
+ editorset.modified and '*' or ''))
+
+ def _menu_new(self, event):
+ self.open_file('Untitled.csv', exists=False)
+
+ def _menu_open(self, event):
+ wildcard = '|'.join(['Chirp Image Files (*.img)|*.img',
+ 'CSV Files (*.csv)|*.csv',
+ 'All Files (*.*)|*.*'])
+ with wx.FileDialog(self, 'Open a file', wildcard=wildcard,
+ style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) as fd:
+ if fd.ShowModal() == wx.ID_CANCEL:
+ return
+ filename = fd.GetPath()
+ self.open_file(str(filename))
+
+ def _menu_save_as(self, event):
+ eset = self.current_editorset
+ wildcard = 'CHIRP %(vendor)s %(model)s Files (*.%(ext)s)|*.%(ext)s' % {
+ 'vendor': eset._radio.VENDOR,
+ 'model': eset._radio.MODEL,
+ 'ext': eset._radio.FILE_EXTENSION}
+
+ style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT | wx.FD_CHANGE_DIR
+ with wx.FileDialog(self, "Save file", defaultFile=eset.filename,
+ wildcard=wildcard,
+ style=style) as fd:
+ if fd.ShowModal() == wx.ID_CANCEL:
+ return
+ filename = fd.GetPath()
+ eset.save(filename)
+ self._update_editorset_title(eset)
+
+ def _menu_save(self, event):
+ editorset = self.current_editorset
+ if not editorset.modified:
+ return
+
+ if not os.path.exists(editorset.filename):
+ return self._menu_save_as(event)
+
+ editorset.save()
+ self._update_editorset_title(self.current_editorset)
+
+ def _menu_close(self, event):
+ self._editors.DeletePage(self._editors.GetSelection())
+ self._update_window_for_editor()
+
+ def _menu_exit(self, event):
+ self.Close(True)
+
+ def _menu_copy(self, event, cut=False):
+ data = self.current_editorset.cb_copy(cut=cut)
+ if wx.TheClipboard.Open():
+ wx.TheClipboard.SetData(data)
+ wx.TheClipboard.Close()
+
+ def _menu_paste(self, event):
+ memdata = wx.CustomDataObject(common.CHIRP_DATA_MEMORY)
+ textdata = wx.TextDataObject()
+ if wx.TheClipboard.Open():
+ gotchirpmem = wx.TheClipboard.GetData(memdata)
+ got = wx.TheClipboard.GetData(textdata)
+ wx.TheClipboard.Close()
+ if gotchirpmem:
+ self.current_editorset.cb_paste(memdata)
+ if got:
+ self.current_editorset.cb_paste(textdata)
+
+ def _menu_selall(self, event):
+ self.current_editorset.select_all()
+
+ def _menu_download(self, event):
+ with clone.ChirpDownloadDialog(self) as d:
+ d.Centre()
+ if d.ShowModal() == wx.ID_OK:
+ radio = d._radio
+ editorset = ChirpEditorSet(radio, None, self._editors)
+ self.add_editorset(editorset)
+
+ def _menu_upload(self, event):
+ radio = self.current_editorset.radio
+ with clone.ChirpUploadDialog(radio, self) as d:
+ d.Centre()
+ d.ShowModal()
+
+ @common.error_proof()
+ def _menu_reload_driver(self, event, andfile=False):
+ radio = self.current_editorset.radio
+ try:
+ # If we were loaded from a dynamic alias in directory,
+ # get the pointer to the original
+ orig_rclass = radio._orig_rclass
+ except AttributeError:
+ orig_rclass = radio.__class__
+
+ # Save a reference to the radio's internal mmap. If the radio does
+ # anything strange or does not follow the typical convention, this
+ # will not work
+ mmap = radio._mmap
+
+ # Reload the actual module
+ module = sys.modules[orig_rclass.__module__]
+ LOG.warning('Going to reload %s' % module)
+ directory.enable_reregistrations()
+ import importlib
+ importlib.reload(module)
+
+ # Grab a new reference to the updated module and pick out the
+ # radio class from it.
+ module = sys.modules[orig_rclass.__module__]
+ rclass = getattr(module, orig_rclass.__name__)
+
+ filename = self.current_editorset.filename
+ if andfile:
+ # Reload the file while creating the radio
+ new_radio = rclass(filename)
+ else:
+ # Try to reload the driver in place, without
+ # re-reading the file; mimic the file loading
+ # procedure after jamming the memory back in
+ new_radio = rclass(None)
+ new_radio._mmap = mmap
+ new_radio.process_mmap()
+
+ # Kill the current editorset now that we know the radio loaded
+ # successfully
+ last_editor = self.current_editorset.current_editor_index
+ self._menu_close(event)
+
+ # Mimic the File->Open process to get a new editorset based
+ # on our franken-radio
+ editorset = ChirpEditorSet(new_radio, filename, self._editors)
+ self.add_editorset(editorset, select=True)
+ editorset.select_editor(last_editor)
+
+ LOG.info('Reloaded radio driver%s in place; good luck!' % (
+ andfile and ' (and file)' or ''))
+
+ def _menu_interact_driver(self, event):
+ LOG.warning('Going to interact with radio at the console')
+ radio = self.current_editorset.radio
+ import code
+ locals = {'main': self,
+ 'radio': radio}
+ code.interact(banner='Locals are: %s' % (', '.join(locals.keys())),
+ local=locals)
+
+ def _menu_about(self, event):
+ pyver = sys.version_info
+ aboutinfo = 'CHIRP %s on Python %s wxPython %s' % (
+ CHIRP_VERSION,
+ '%s.%s.%s' % (pyver.major, pyver.minor, pyver.micro),
+ wx.version())
+ wx.MessageBox(aboutinfo, 'About CHIRP',
+ wx.OK | wx.ICON_INFORMATION)
+
diff --git a/chirp/wxui/memedit.py b/chirp/wxui/memedit.py
new file mode 100644
index 0000000..4eef1be
--- /dev/null
+++ b/chirp/wxui/memedit.py
@@ -0,0 +1,601 @@
+import functools
+import logging
+import pickle
+
+import wx
+import wx.lib.newevent
+import wx.grid
+import wx.propgrid
+
+from chirp import chirp_common
+from chirp.ui import config
+from chirp.wxui import common
+from chirp.wxui import developer
+
+LOG = logging.getLogger(__name__)
+CONF = config.get()
+
+
+class ChirpMemoryColumn(object):
+ NAME = None
+ DEFAULT = ''
+
+ def __init__(self, name, radio):
+ """
+ :param name: The name on the Memory object that this represents
+ """
+ self._name = name
+ self._radio = radio
+ self._features = radio.get_features()
+
+ @property
+ def label(self):
+ return self.NAME or self._name.title()
+
+ def hidden_for(self, memory):
+ return False
+
+ @property
+ def valid(self):
+ if self._name in ['freq', 'rtone']:
+ return True
+ to_try = ['has_%s', 'valid_%ss', 'valid_%ses', 'valid_%s_levels']
+ for thing in to_try:
+ try:
+ return bool(self._features[thing % self._name])
+ except KeyError:
+ pass
+
+ LOG.error('Unsure if %r is valid' % self._name)
+ return True
+
+ def _render_value(self, memory, value):
+ if value is []:
+ raise Exception('Found empty list value for %s: %r' % (
+ self._name, value))
+ return str(value)
+
+ def value(self, memory):
+ return getattr(memory, self._name)
+
+ def render_value(self, memory):
+ if memory.empty:
+ return ''
+ if self.hidden_for(memory):
+ return ''
+ return self._render_value(memory, self.value(memory))
+
+ def _digest_value(self, memory, input_value):
+ return str(input_value)
+
+ def digest_value(self, memory, input_value):
+ setattr(memory, self._name, self._digest_value(memory, input_value))
+
+ def get_editor(self):
+ return wx.grid.GridCellTextEditor()
+
+ def get_propeditor(self, memory):
+ class ChirpStringProperty(wx.propgrid.StringProperty):
+ def ValidateValue(myself, value, validationInfo):
+ try:
+ self._digest_value(memory, value)
+ return True
+ except ValueError:
+ validationInfo.SetFailureMessage(
+ 'Invalid value: %r' % value)
+ return False
+ except Exception as e:
+ LOG.exception('Failed to validate %r for property %s' % (
+ value, self._name))
+ validationInfo.SetFailureMessage(
+ 'Invalid value: %r' % value)
+ return False
+
+ editor = ChirpStringProperty(self.label, self._name)
+ editor.SetValue(self.render_value(memory))
+ return editor
+
+
+class ChirpFrequencyColumn(ChirpMemoryColumn):
+ DEFAULT = 0
+ @property
+ def label(self):
+ if self._name == 'offset':
+ return 'Offset'
+ else:
+ return 'Frequency'
+
+ def hidden_for(self, memory):
+ return self._name == 'offset' and not memory.duplex
+
+ def _render_value(self, memory, value):
+ if not value:
+ value = 0
+ return '%.5f' % (value / 1000000.0)
+
+ def _digest_value(self, memory, input_value):
+ if not input_value.strip():
+ input_value = 0
+ return int(chirp_common.to_MHz(float(input_value)))
+
+
+class ChirpToneColumn(ChirpMemoryColumn):
+ def __init__(self, name, radio):
+ super(ChirpToneColumn, self).__init__(name, radio)
+ self._choices = chirp_common.TONES
+ self._str_choices = [str(x) for x in self._choices]
+
+ @property
+ def label(self):
+ if self._name == 'rtone':
+ return 'Tone'
+ else:
+ return 'ToneSql'
+
+ def hidden_for(self, memory):
+ return (
+ (self._name == 'rtone' and memory.tmode not in ('Tone', 'Cross'))
+ or
+ (self._name == 'ctone' and memory.tmode not in ('TSQL', 'Cross')))
+
+ def _digest_value(self, memory, input_value):
+ return float(input_value)
+
+ def get_editor(self):
+ return wx.grid.GridCellChoiceEditor(['%.1f' % t
+ for t in chirp_common.TONES])
+
+ def get_propeditor(self, memory):
+ current = self.value(memory)
+ return wx.propgrid.EnumProperty(self.label, self._name,
+ self._str_choices,
+ range(len(self._choices)),
+ self._choices.index(current))
+
+
+class ChirpChoiceColumn(ChirpMemoryColumn):
+ def __init__(self, name, radio, choices):
+ super(ChirpChoiceColumn, self).__init__(name, radio)
+ self._choices = choices
+ self._str_choices = [str(x) for x in choices]
+
+ def _digest_value(self, memory, input_value):
+ idx = self._str_choices.index(input_value)
+ return self._choices[idx]
+
+ def get_editor(self):
+ return wx.grid.GridCellChoiceEditor(self._str_choices)
+
+ def get_propeditor(self, memory):
+ current = self._render_value(memory, self.value(memory))
+ try:
+ cur_index = self._choices.index(current)
+ except ValueError:
+ # This means the memory has some value set that the radio
+ # does not support, like the default cross_mode not being
+ # in rf.valid_cross_modes. This is likely because the memory
+ # just doesn't have that value set, so take the first choice
+ # in this case.
+ cur_index = 0
+ return wx.propgrid.EnumProperty(self.label, self._name,
+ self._str_choices,
+ range(len(self._str_choices)),
+ cur_index)
+
+
+class ChirpDTCSColumn(ChirpChoiceColumn):
+ def __init__(self, name, radio):
+ dtcs_codes = ['%03i' % code for code in chirp_common.DTCS_CODES]
+ super(ChirpDTCSColumn, self).__init__(name, radio,
+ dtcs_codes)
+
+ @property
+ def label(self):
+ if self._name == 'dtcs':
+ return 'DTCS'
+ elif self._name == 'rx_dtcs':
+ return 'RX DTCS'
+ else:
+ return 'ErrDTCS'
+
+ def _digest_value(self, memory, input_value):
+ return int(input_value)
+
+ def _render_value(self, memory, value):
+ return '%03i' % value
+
+ def hidden_for(self, memory):
+ return (
+ (self._name == 'dtcs' and not (
+ memory.tmode == 'DTCS' or (memory.tmode == 'Cross' and
+ 'DTCS->' in memory.cross_mode)))
+ or
+ (self._name == 'rx_dtcs' and not (
+ memory.tmode == 'Cross' and '>DTCS' in memory.cross_mode)))
+
+
+class ChirpCrossModeColumn(ChirpChoiceColumn):
+ def __init__(self, name, radio):
+ rf = radio.get_features()
+ super(ChirpCrossModeColumn, self).__init__(name, radio,
+ rf.valid_cross_modes)
+
+ @property
+ def label(self):
+ return 'Cross mode'
+
+ def hidden_for(self, memory):
+ return memory.tmode != 'Cross'
+
+
+class ChirpMemEdit(common.ChirpEditor):
+ def __init__(self, radio, *a, **k):
+ super(ChirpMemEdit, self).__init__(*a, **k)
+
+ self._radio = radio
+ self._features = self._radio.get_features()
+
+ #self._radio.subscribe(self._job_done)
+ self._jobs = {}
+ self._memory_cache = {}
+
+ self._col_defs = self._setup_columns()
+
+ self._grid = wx.grid.Grid(self)
+ self._grid.CreateGrid(self._features.memory_bounds[1] +
+ len(self._features.valid_special_chans) + 1,
+ len(self._col_defs))
+ self._grid.SetSelectionMode(wx.grid.Grid.SelectRows)
+
+ self._fixed_font = wx.Font(pointSize=10,
+ family=wx.FONTFAMILY_TELETYPE,
+ style=wx.FONTSTYLE_NORMAL,
+ weight=wx.FONTWEIGHT_NORMAL)
+
+ for col, col_def in enumerate(self._col_defs):
+ if not col_def.valid:
+ self._grid.HideCol(col)
+ else:
+ self._grid.SetColLabelValue(col, col_def.label)
+ attr = wx.grid.GridCellAttr()
+ attr.SetEditor(col_def.get_editor())
+ attr.SetFont(self._fixed_font)
+ self._grid.SetColAttr(col, attr)
+ self._grid.SetColMinimalWidth(col, 75)
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ sizer.Add(self._grid, 1, wx.EXPAND)
+ self.SetSizer(sizer)
+
+ wx.CallAfter(self._grid.AutoSizeColumns, setAsMin=False)
+
+ self._grid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
+ self._memory_edited)
+ self._grid.Bind(wx.grid.EVT_GRID_CELL_CHANGED,
+ self._memory_changed)
+ self._grid.Bind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK,
+ self._memory_rclick)
+
+ # For resize calculations
+ self._dc = wx.ScreenDC()
+ self._dc.SetFont(self._fixed_font)
+
+ def _setup_columns(self):
+ defs = [
+ ChirpFrequencyColumn('freq', self._radio),
+ ChirpMemoryColumn('name', self._radio),
+ ChirpChoiceColumn('tmode', self._radio,
+ self._features.valid_tmodes),
+ ChirpToneColumn('rtone', self._radio),
+ ChirpToneColumn('ctone', self._radio),
+ ChirpDTCSColumn('dtcs', self._radio),
+ ChirpDTCSColumn('rx_dtcs', self._radio),
+ ChirpChoiceColumn('duplex', self._radio,
+ self._features.valid_duplexes),
+ ChirpFrequencyColumn('offset', self._radio),
+ ChirpChoiceColumn('mode', self._radio,
+ self._features.valid_modes),
+ ChirpChoiceColumn('tuning_step', self._radio,
+ self._features.valid_tuning_steps),
+ ChirpChoiceColumn('skip', self._radio,
+ self._features.valid_skips),
+ ChirpCrossModeColumn('cross_mode', self._radio),
+ ChirpChoiceColumn('power', self._radio,
+ self._features.valid_power_levels),
+ ChirpMemoryColumn('comment', self._radio),
+ ]
+ return defs
+
+ def refresh_memory(self, memory):
+ self._memory_cache[memory.number] = memory
+
+ row = memory.number - self._features.memory_bounds[0]
+
+ if memory.extd_number:
+ self._grid.SetRowLabelValue(row, memory.extd_number)
+ else:
+ self._grid.SetRowLabelValue(row, str(memory.number))
+
+ for col, col_def in enumerate(self._col_defs):
+ self._grid.SetCellValue(row, col, col_def.render_value(memory))
+
+ def refresh(self):
+ for i in range(*self._features.memory_bounds):
+ try:
+ m = self._radio.get_memory(i)
+ except Exception as e:
+ LOG.exception('Failure retreiving memory %i from %s' % (
+ i, '%s %s %s' % (self._radio.VENDOR,
+ self._radio.MODEL,
+ self._radio.VARIANT)))
+ continue
+ self.refresh_memory(m)
+
+ return
+
+ for i in self._features.valid_special_chans:
+ m = self._radio.get_memory(i)
+ self.refresh_memory(m)
+
+ def _memory_edited(self, event):
+ """
+ Called when the memory row in the UI is edited.
+ Writes the memory to the radio and displays an error if needed.
+ """
+ row = event.GetRow()
+ col = event.GetCol()
+ val = event.GetString()
+
+ col_def = self._col_defs[col]
+
+ try:
+ mem = self._memory_cache[row + self._features.memory_bounds[0]]
+ except KeyError:
+ wx.MessageBox('Unable to edit memory before radio is loaded')
+ event.Veto()
+ return
+
+ try:
+ if col_def.label == 'Name':
+ val = self._radio.filter_name(val)
+ col_def.digest_value(mem, val)
+ mem.empty = False
+ job = self._radio.set_memory(mem)
+ except Exception as e:
+ LOG.exception('Failed to edit memory')
+ wx.MessageBox('Invalid edit: %s' % e, 'Error')
+ event.Veto()
+ else:
+ LOG.debug('Memory %i changed, column: %i:%s' % (row, col, mem))
+
+ wx.CallAfter(self._resize_col_after_edit, row, col)
+
+ def _resize_col_after_edit(self, row, col):
+ """Resize the column if the text in row,col does not fit."""
+ size = self._dc.GetTextExtent(self._grid.GetCellValue(row, col))
+ padsize = size[0] + 20
+ if padsize > self._grid.GetColSize(col):
+ self._grid.SetColSize(col, padsize)
+
+ def _memory_changed(self, event):
+ """
+ Called when the memory in the UI has been changed.
+ Responsible for re-requesting the memory from the radio and updating
+ the UI accordingly.
+ Also provides the trigger to the editorset that we have changed.
+ """
+ row = event.GetRow()
+ mem = self._radio.get_memory(row + self._features.memory_bounds[0])
+ self.refresh_memory(mem)
+ wx.PostEvent(self, common.EditorChanged(self.GetId()))
+
+ def delete_memory_at(self, row, event):
+ number = row + self._features.memory_bounds[0]
+ mem = self._radio.get_memory(number)
+ mem.empty = True
+ self._radio.set_memory(mem)
+ self.refresh_memory(mem)
+ wx.PostEvent(self, common.EditorChanged(self.GetId()))
+
+ def _delete_memories_at(self, rows, event):
+ for row in rows:
+ self.delete_memory_at(row, event)
+
+ def _memory_rclick(self, event):
+ menu = wx.Menu()
+ selected_rows = self._grid.GetSelectedRows()
+
+ props_item = wx.MenuItem(menu, wx.NewId(), 'Properties')
+ self.Bind(wx.EVT_MENU,
+ functools.partial(self._mem_properties, selected_rows),
+ props_item)
+ menu.Append(props_item)
+
+ if len(selected_rows) > 1:
+ del_item = wx.MenuItem(menu, wx.NewId(),
+ 'Delete %i Memories' % len(selected_rows))
+ to_delete = selected_rows
+ else:
+ del_item = wx.MenuItem(menu, wx.NewId(), 'Delete')
+ to_delete = [event.GetRow()]
+ self.Bind(wx.EVT_MENU,
+ functools.partial(self._delete_memories_at, to_delete),
+ del_item)
+ menu.Append(del_item)
+
+ if CONF.get_bool('developer', 'state'):
+ menu.Append(wx.MenuItem(menu, wx.ID_SEPARATOR))
+
+ raw_item = wx.MenuItem(menu, wx.NewId(), 'Show Raw Memory')
+ self.Bind(wx.EVT_MENU,
+ functools.partial(self._mem_showraw, event.GetRow()),
+ raw_item)
+ menu.Append(raw_item)
+
+ if len(selected_rows) == 2:
+ diff_item = wx.MenuItem(menu, wx.NewId(), 'Diff Raw Memories')
+ self.Bind(wx.EVT_MENU,
+ functools.partial(self._mem_diff, selected_rows),
+ diff_item)
+ menu.Append(diff_item)
+
+ self.PopupMenu(menu)
+ menu.Destroy()
+
+ def row2mem(self, row):
+ return row + self._features.memory_bounds[0]
+
+ def _mem_properties(self, rows, event):
+ memories = [
+ self._radio.get_memory(self.row2mem(row))
+ for row in rows]
+ with ChirpMemPropDialog(memories, self) as d:
+ if d.ShowModal() == wx.ID_OK:
+ for memory in d._memories:
+ self._radio.set_memory(memory)
+ self.refresh_memory(memory)
+
+ def _mem_showraw(self, row, event):
+ mem = self._radio.get_raw_memory(self.row2mem(row))
+ with developer.MemoryDialog(mem, self) as d:
+ d.ShowModal()
+
+ def _mem_diff(self, rows, event):
+ mem_a = self._radio.get_raw_memory(self.row2mem(rows[0]))
+ mem_b = self._radio.get_raw_memory(self.row2mem(rows[1]))
+ with developer.MemoryDialog((mem_a, mem_b), self) as d:
+ d.ShowModal()
+
+ def cb_copy(self, cut=False):
+ rows = self._grid.GetSelectedRows()
+ offset = self._features.memory_bounds[0]
+ mems = []
+ for row in rows:
+ mem = self._radio.get_memory(row + offset)
+ # We can't pickle settings, nor would they apply if we
+ # paste across models
+ mem.extra = []
+ mems.append(mem)
+ data = wx.CustomDataObject(common.CHIRP_DATA_MEMORY)
+ data.SetData(pickle.dumps(mems))
+ for mem in mems:
+ if cut:
+ self._radio.erase_memory(mem.number)
+ mem = self._radio.get_memory(mem.number)
+ self.refresh_memory(mem)
+ return data
+
+ def _cb_paste_memories(self, mems):
+ try:
+ row = self._grid.GetSelectedRows()[0]
+ except IndexError:
+ LOG.info('No row selected for paste')
+ return
+
+ for mem in mems:
+ mem.empty = False
+ mem.number = row + self._features.memory_bounds[0]
+ row += 1
+ self._radio.set_memory(mem)
+ self.refresh_memory(mem)
+
+ def cb_paste(self, data):
+ if data.GetFormat() == common.CHIRP_DATA_MEMORY:
+ mems = pickle.loads(data.GetData().tobytes())
+ self._cb_paste_memories(mems)
+ elif data.GetFormat() == wx.DF_UNICODETEXT:
+ LOG.debug('FIXME: handle pasted text: %r' % data.GetText())
+ else:
+ LOG.warning('Unknown data format %s' % data.GetFormat().Type)
+
+ def select_all(self):
+ self._grid.SelectAll()
+
+
+class ChirpMemPropDialog(wx.Dialog):
+ def __init__(self, memories, memedit, *a, **k):
+ if len(memories) == 1:
+ title = 'Edit details for memory %i' % memories[0].number
+ else:
+ title = 'Edit details for %i memories' % len(memories)
+
+ super(ChirpMemPropDialog, self).__init__(
+ memedit, *a, title=title, **k)
+
+ self.Centre()
+
+ self._memories = memories
+ self._col_defs = memedit._col_defs
+
+ # The first memory sets the defaults
+ memory = self._memories[0]
+
+ self._tabs = wx.Notebook(self)
+
+ vbox = wx.BoxSizer(wx.VERTICAL)
+ self.SetSizer(vbox)
+ vbox.Add(self._tabs, 1, wx.EXPAND)
+
+ self._pg = wx.propgrid.PropertyGrid(self._tabs)
+ self._tabs.InsertPage(0, self._pg, 'Values')
+
+ if memory.extra:
+ self._tabs.InsertPage(1, common.ChirpSettingGrid(memory.extra,
+ self._tabs),
+ 'Extra')
+
+ for coldef in memedit._col_defs:
+ if coldef.valid:
+ self._pg.Append(coldef.get_propeditor(memory))
+
+ hbox = wx.BoxSizer(wx.HORIZONTAL)
+ hbox.Add(wx.Button(self, wx.ID_OK))
+ hbox.Add(wx.Button(self, wx.ID_CANCEL))
+
+ vbox.Add(hbox, 0, wx.ALIGN_RIGHT|wx.ALL, border=10)
+
+ self.Bind(wx.EVT_BUTTON, self._button)
+
+ def _col_def_by_name(self, name):
+ for coldef in self._col_defs:
+ if coldef._name == name:
+ return coldef
+ LOG.error('No column definition for %s' % name)
+
+ def _make_memories(self):
+ memories = [memory.dupe() for memory in self._memories]
+
+ for mem in memories:
+ for prop in self._pg._Items():
+ name = prop.GetName()
+
+ coldef = self._col_def_by_name(name)
+ value = prop.GetValueAsString()
+ value = coldef._digest_value(mem, value)
+
+ if (getattr(self._memories[0], name) == value):
+ LOG.debug('Skipping unchanged field %s' % name)
+ continue
+
+ LOG.debug('Value for %s is %r' % (name, value))
+ setattr(mem, prop.GetName(), value)
+
+ if self._tabs.GetPageCount() == 2:
+ extra = self._tabs.GetPage(1).get_values()
+ for setting in mem.extra:
+ name = setting.get_name()
+ try:
+ setting.value = extra[name]
+ except KeyError:
+ raise
+ LOG.warning('Missing setting %r' % name)
+ continue
+
+ return memories
+
+ def _button(self, event):
+ button_id = event.GetEventObject().GetId()
+ if button_id == wx.ID_OK:
+ self._memories = self._make_memories()
+
+ self.EndModal(button_id)
diff --git a/chirp/wxui/settingsedit.py b/chirp/wxui/settingsedit.py
new file mode 100644
index 0000000..8a61034
--- /dev/null
+++ b/chirp/wxui/settingsedit.py
@@ -0,0 +1,161 @@
+import logging
+
+import wx
+import wx.dataview
+
+from chirp import settings
+from chirp.wxui import clone
+from chirp.wxui import common
+
+LOG = logging.getLogger(__name__)
+
+
+class ChirpSettingsEdit(common.ChirpEditor):
+ def __init__(self, radio, *a, **k):
+ super(ChirpSettingsEdit, self).__init__(*a, **k)
+
+ self._radio = radio
+ self._settings = None
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ self.SetSizer(sizer)
+
+ self._pre_propgrid_hook(sizer)
+
+ self._group_control = wx.Listbook(self, style=wx.LB_LEFT)
+ sizer.Add(self._group_control, 1, wx.EXPAND)
+
+ self._initialized = False
+ self._group_control.Bind(wx.EVT_PAINT, self._activate)
+
+ def _activate(self, event):
+ if not self._initialized:
+ self._initialized = True
+ wx.CallAfter(self._initialize)
+
+ def _load_settings(self):
+ for group in self._settings:
+ self._add_group(group)
+ self._group_control.Layout()
+
+ def _add_group(self, group):
+ propgrid = common.ChirpSettingGrid(group, self._group_control)
+ self.Bind(common.EVT_EDITOR_CHANGED, self._changed, propgrid)
+ LOG.debug('Adding page for %s' % group.get_shortname())
+ self._group_control.AddPage(propgrid, group.get_shortname())
+
+ for element in group.values():
+ if not isinstance(element, settings.RadioSetting):
+ self._add_group(element)
+
+ def cb_copy(self, cut=False):
+ pass
+
+ def cb_paste(self, data):
+ pass
+
+ def _apply_settings(self):
+ try:
+ all_values = {}
+ for i in range(self._group_control.GetPageCount()):
+ page = self._group_control.GetPage(i)
+ all_values.update(page.get_values())
+ for group in self._settings:
+ self._apply_setting_group(all_values, group)
+ return True
+ except Exception as e:
+ LOG.exception('Failed to apply settings')
+ wx.MessageBox(str(e), 'Error applying settings',
+ wx.OK | wx.ICON_ERROR)
+ return False
+
+ def _apply_setting_group(self, all_values, group):
+ for element in group.values():
+ if isinstance(element, settings.RadioSetting):
+ if element.value.get_mutable():
+ element.value = all_values[element.get_name()]
+ else:
+ self._apply_setting_group(all_values, element)
+
+ def _changed(self, event):
+ wx.PostEvent(self, common.EditorChanged(self.GetId()))
+
+ def saved(self):
+ for i in range(self._group_control.GetPageCount()):
+ page = self._group_control.GetPage(i)
+ page.saved()
+
+
+class ChirpCloneSettingsEdit(ChirpSettingsEdit):
+
+ def __init__(self, *a, **k):
+ super(ChirpCloneSettingsEdit, self).__init__(*a, **k)
+
+ self._settings = self._radio.get_settings()
+
+ def _initialize(self):
+ self._load_settings()
+
+ def _pre_propgrid_hook(self, sizer):
+ pass
+
+ def _changed(self, event):
+ if not self._apply_settings():
+ return
+ self._radio.set_settings(self._settings)
+ super(ChirpCloneSettingsEdit, self)._changed(event)
+
+
+class ChirpLiveSettingsEdit(ChirpSettingsEdit):
+ def _pre_propgrid_hook(self, sizer):
+ buttons = wx.Panel(self)
+ hbox = wx.BoxSizer(wx.HORIZONTAL)
+ buttons.SetSizer(hbox)
+ sizer.Add(buttons, 0, flag=wx.ALIGN_RIGHT)
+
+ self._apply_btn = wx.Button(buttons, wx.ID_APPLY)
+ hbox.Add(self._apply_btn, 0,
+ flag=wx.ALIGN_RIGHT|wx.ALL, border=10)
+ self._apply_btn.Disable()
+ self._apply_btn.Bind(wx.EVT_BUTTON, self._apply_settings_button)
+
+ def _apply_setting_edit(self):
+ # Do not apply settings during edit for live radios
+ pass
+
+ def _changed(self, event):
+ self._apply_btn.Enable()
+ # Do not send the changed event for live radios
+
+ def saved(self):
+ # Do not allow saved event to change modified statuses
+ pass
+
+ def _initialize(self):
+ LOG.debug('Loading settings for live radio')
+ prog = wx.ProgressDialog('Loading Settings', 'Please wait...', 100,
+ parent=self)
+ thread = clone.SettingsThread(self._radio, prog)
+ thread.start()
+ prog.ShowModal()
+ LOG.debug('Settings load complete')
+ self._settings = thread.settings
+ self._load_settings()
+
+ def _apply_settings_button(self, event):
+ if not self._apply_settings():
+ return
+
+ prog = wx.ProgressDialog('Applying Settings', 'Please wait...', 100,
+ parent=self)
+ thread = clone.SettingsThread(self._radio, prog, self._settings)
+ thread.start()
+ prog.ShowModal()
+
+ if thread.error:
+ wx.MessageBox('Error applying settings: %s' % thread.error,
+ 'Error',
+ wx.OK | wx.ICON_ERROR)
+ else:
+ self._apply_btn.Disable()
+ super(ChirpLiveSettingsEdit, self).saved()
diff --git a/chirp/xml_ll.py b/chirp/xml_ll.py
deleted file mode 100644
index e3bac20..0000000
--- a/chirp/xml_ll.py
+++ /dev/null
@@ -1,256 +0,0 @@
-# Copyright 2008 Dan Smith <dsmith@danplanet.com>
-#
-# 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-import re
-
-from chirp import chirp_common, errors
-
-
-def get_memory(doc, number):
- """Extract a Memory object from @doc"""
- ctx = doc.xpathNewContext()
-
- base = "//radio/memories/memory[@location=%i]" % number
-
- fields = ctx.xpathEval(base)
- if len(fields) > 1:
- raise errors.RadioError("%i memories claiming to be %i" % (len(fields),
- number))
- elif len(fields) == 0:
- raise errors.InvalidMemoryLocation("%i does not exist" % number)
-
- memnode = fields[0]
-
- def _get(ext):
- path = base + ext
- result = ctx.xpathEval(path)
- if result:
- return result[0].getContent()
- else:
- return ""
-
- if _get("/mode/text()") == "DV":
- mem = chirp_common.DVMemory()
- mem.dv_urcall = _get("/dv/urcall/text()")
- mem.dv_rpt1call = _get("/dv/rpt1call/text()")
- mem.dv_rpt2call = _get("/dv/rpt2call/text()")
- try:
- mem.dv_code = _get("/dv/digitalCode/text()")
- except ValueError:
- mem.dv_code = 0
- else:
- mem = chirp_common.Memory()
-
- mem.number = int(memnode.prop("location"))
- mem.name = _get("/longName/text()")
- mem.freq = chirp_common.parse_freq(_get("/frequency/text()"))
- mem.rtone = float(_get("/squelch[@id='rtone']/tone/text()"))
- mem.ctone = float(_get("/squelch[@id='ctone']/tone/text()"))
- mem.dtcs = int(_get("/squelch[@id='dtcs']/code/text()"), 10)
- mem.dtcs_polarity = _get("/squelch[@id='dtcs']/polarity/text()")
-
- try:
- sql = _get("/squelchSetting/text()")
- if sql == "rtone":
- mem.tmode = "Tone"
- elif sql == "ctone":
- mem.tmode = "TSQL"
- elif sql == "dtcs":
- mem.tmode = "DTCS"
- else:
- mem.tmode = ""
- except IndexError:
- mem.tmode = ""
-
- dmap = {"positive": "+", "negative": "-", "none": ""}
- dupx = _get("/duplex/text()")
- mem.duplex = dmap.get(dupx, "")
-
- mem.offset = chirp_common.parse_freq(_get("/offset/text()"))
- mem.mode = _get("/mode/text()")
- mem.tuning_step = float(_get("/tuningStep/text()"))
-
- skip = _get("/skip/text()")
- if skip == "none":
- mem.skip = ""
- else:
- mem.skip = skip
-
- # FIXME: bank support in .chirp files needs to be re-written
- # bank_id = _get("/bank/@bankId")
- # if bank_id:
- # mem.bank = int(bank_id)
- # bank_index = _get("/bank/@bankIndex")
- # if bank_index:
- # mem.bank_index = int(bank_index)
-
- return mem
-
-
-def set_memory(doc, mem):
- """Set @mem in @doc"""
- ctx = doc.xpathNewContext()
-
- base = "//radio/memories/memory[@location=%i]" % mem.number
-
- fields = ctx.xpathEval(base)
- if len(fields) > 1:
- raise errors.RadioError("%i memories claiming to be %i" % (len(fields),
- mem.number))
- elif len(fields) == 1:
- fields[0].unlinkNode()
-
- radio = ctx.xpathEval("//radio/memories")[0]
- memnode = radio.newChild(None, "memory", None)
- memnode.newProp("location", "%i" % mem.number)
-
- sname_filter = "[^A-Z0-9/ >-]"
- sname = memnode.newChild(None, "shortName", None)
- sname.addContent(re.sub(sname_filter, "", mem.name.upper()[:6]))
-
- lname_filter = "[^.A-Za-z0-9/ >-]"
- lname = memnode.newChild(None, "longName", None)
- lname.addContent(re.sub(lname_filter, "", mem.name[:16]))
-
- freq = memnode.newChild(None, "frequency", None)
- freq.newProp("units", "MHz")
- freq.addContent(chirp_common.format_freq(mem.freq))
-
- rtone = memnode.newChild(None, "squelch", None)
- rtone.newProp("id", "rtone")
- rtone.newProp("type", "repeater")
- tone = rtone.newChild(None, "tone", None)
- tone.addContent("%.1f" % mem.rtone)
-
- ctone = memnode.newChild(None, "squelch", None)
- ctone.newProp("id", "ctone")
- ctone.newProp("type", "ctcss")
- tone = ctone.newChild(None, "tone", None)
- tone.addContent("%.1f" % mem.ctone)
-
- dtcs = memnode.newChild(None, "squelch", None)
- dtcs.newProp("id", "dtcs")
- dtcs.newProp("type", "dtcs")
- code = dtcs.newChild(None, "code", None)
- code.addContent("%03i" % mem.dtcs)
- polr = dtcs.newChild(None, "polarity", None)
- polr.addContent(mem.dtcs_polarity)
-
- sset = memnode.newChild(None, "squelchSetting", None)
- if mem.tmode == "Tone":
- sset.addContent("rtone")
- elif mem.tmode == "TSQL":
- sset.addContent("ctone")
- elif mem.tmode == "DTCS":
- sset.addContent("dtcs")
-
- dmap = {"+": "positive", "-": "negative", "": "none"}
- dupx = memnode.newChild(None, "duplex", None)
- dupx.addContent(dmap[mem.duplex])
-
- oset = memnode.newChild(None, "offset", None)
- oset.newProp("units", "MHz")
- oset.addContent(chirp_common.format_freq(mem.offset))
-
- mode = memnode.newChild(None, "mode", None)
- mode.addContent(mem.mode)
-
- step = memnode.newChild(None, "tuningStep", None)
- step.newProp("units", "kHz")
- step.addContent("%.5f" % mem.tuning_step)
-
- if mem.skip:
- skip = memnode.newChild(None, "skip", None)
- skip.addContent(mem.skip)
-
- # FIXME: .chirp bank support needs to be redone
- # if mem.bank is not None:
- # bank = memnode.newChild(None, "bank", None)
- # bank.newProp("bankId", str(int(mem.bank)))
- # if mem.bank_index >= 0:
- # bank.newProp("bankIndex", str(int(mem.bank_index)))
-
- if isinstance(mem, chirp_common.DVMemory):
- dv = memnode.newChild(None, "dv", None)
-
- ur = dv.newChild(None, "urcall", None)
- ur.addContent(mem.dv_urcall)
-
- r1 = dv.newChild(None, "rpt1call", None)
- if mem.dv_rpt1call and mem.dv_rpt1call != "*NOTUSE*":
- r1.addContent(mem.dv_rpt1call)
-
- r2 = dv.newChild(None, "rpt2call", None)
- if mem.dv_rpt2call and mem.dv_rpt2call != "*NOTUSE*":
- r2.addContent(mem.dv_rpt2call)
-
- dc = dv.newChild(None, "digitalCode", None)
- dc.addContent(str(mem.dv_code))
-
-
-def del_memory(doc, number):
- """Remove memory @number from @doc"""
- path = "//radio/memories/memory[@location=%i]" % number
- ctx = doc.xpathNewContext()
- fields = ctx.xpathEval(path)
-
- for field in fields:
- field.unlinkNode()
-
-
-def _get_bank(node):
- bank = chirp_common.Bank(node.prop("label"))
- ident = int(node.prop("id"))
-
- return ident, bank
-
-
-def get_banks(doc):
- """Return a list of banks from @doc"""
- path = "//radio/banks/bank"
- ctx = doc.xpathNewContext()
- fields = ctx.xpathEval(path)
-
- banks = []
- for field in fields:
- banks.append(_get_bank(field))
-
- def _cmp(itema, itemb):
- return itema[0] - itemb[0]
-
- banks.sort(cmp=_cmp)
-
- return [x[1] for x in banks]
-
-
-def set_banks(doc, banklist):
- """Set the list of banks in @doc"""
- path = "//radio/banks/bank"
- ctx = doc.xpathNewContext()
- fields = ctx.xpathEval(path)
-
- for field in fields:
- field.unlinkNode()
-
- path = "//radio/banks"
- ctx = doc.xpathNewContext()
- banks = ctx.xpathEval(path)[0]
-
- i = 0
- for bank in banklist:
- banknode = banks.newChild(None, "bank", None)
- banknode.newProp("id", "%i" % i)
- banknode.newProp("label", "%s" % bank)
- i += 1
diff --git a/chirp_banks.xsd b/chirp_banks.xsd
deleted file mode 100644
index 14e577b..0000000
--- a/chirp_banks.xsd
+++ /dev/null
@@ -1,8 +0,0 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="bankType">
- <xsd:attribute name="id" type="xsd:nonNegativeInteger" use="required"/>
- <xsd:attribute name="label" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/chirp_memory.xsd b/chirp_memory.xsd
deleted file mode 100644
index ba4bc8a..0000000
--- a/chirp_memory.xsd
+++ /dev/null
@@ -1,121 +0,0 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="memoryType">
- <xsd:sequence>
- <xsd:element name="shortName" type="shortNameType"/>
- <xsd:element name="longName" type="longNameType" minOccurs="0"/>
- <xsd:element name="frequency" type="frequencyType"/>
- <xsd:element name="squelch" type="squelchType"
- minOccurs="0" maxOccurs="3"/>
- <xsd:element name="squelchSetting" type="xsd:string" minOccurs="0"/>
- <xsd:element name="duplex" type="duplexType"/>
- <xsd:element name="offset" type="frequencyType"/>
- <xsd:element name="mode" type="modeType"/>
- <xsd:element name="tuningStep" type="frequencyType"/>
- <xsd:element name="skip" type="skipType" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="bank" type="bankInfoType" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="dv" type="dvType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="location" type="xsd:nonNegativeInteger"/>
- </xsd:complexType>
-
- <xsd:simpleType name="shortNameType">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[A-Z0-9/ >-]{0,6}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="frequencyType">
- <xsd:simpleContent>
- <xsd:extension base="xsd:decimal">
- <xsd:attribute name="units" type="freqUnitsType" use="required"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="freqUnitsType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Hz"/>
- <xsd:enumeration value="kHz"/>
- <xsd:enumeration value="MHz"/>
- <xsd:enumeration value="GHz"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="longNameType">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[.A-Za-z0-9/ >-]{0,16}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:complexType name="squelchType">
- <xsd:sequence>
- <xsd:element name="tone" type="xsd:decimal" minOccurs="0"/>
- <xsd:element name="code" type="xsd:positiveInteger" minOccurs="0"/>
- <xsd:element name="polarity" type="dtcsPolarityType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="id"/>
- <xsd:attribute name="type"/>
- </xsd:complexType>
-
- <xsd:simpleType name="dtcsPolarityType">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[RN]{2}"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="duplexType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="positive"/>
- <xsd:enumeration value="negative"/>
- <xsd:enumeration value="none"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="modeType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="FM"/>
- <xsd:enumeration value="NFM"/>
- <xsd:enumeration value="WFM"/>
- <xsd:enumeration value="AM"/>
- <xsd:enumeration value="NAM"/>
- <xsd:enumeration value="DV"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="dvType">
- <xsd:sequence>
- <xsd:element name="urcall" type="callsignType"/>
- <xsd:element name="rpt1call" type="callsignType"/>
- <xsd:element name="rpt2call" type="callsignType"/>
- <xsd:element name="digitalCode" type="digitalCodeType" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name="callsignType">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[A-Z0-9/ ]*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="digitalCodeType">
- <xsd:restriction base="xsd:integer">
- <xsd:minInclusive value="0"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="skipType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="S"/>
- <xsd:enumeration value="P"/>
- <xsd:enumeration value=""/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="bankInfoType">
- <xsd:attribute name="bankId" type="xsd:nonNegativeInteger" use="required"/>
- <xsd:attribute name="bankIndex" type="xsd:nonNegativeInteger"/>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/chirpc b/chirpc
new file mode 100755
index 0000000..1663a05
--- /dev/null
+++ b/chirpc
@@ -0,0 +1,403 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import glob
+import serial
+import os
+import sys
+import argparse
+import logging
+
+from chirp import logger
+# from chirp.drivers import *
+from chirp import chirp_common, errors, directory, util
+from chirp.ui import compat
+
+directory.safe_import_drivers()
+
+LOG = logging.getLogger("chirpc")
+RADIOS = directory.DRV_TO_RADIO
+
+
+def fail_unsupported():
+ LOG.error("Operation not supported by selected radio")
+ sys.exit(1)
+
+
+def fail_missing_mmap():
+ LOG.error("mmap-only operation requires specification of an mmap file")
+ sys.exit(1)
+
+
+class ToneAction(argparse.Action):
+ def __call__(self, parser, namespace, value, option_string=None):
+ if value in chirp_common.TONES:
+ raise argparse.ArgumentError("Invalid tone valeu: %.1f" % value)
+ setattr(namespace, self.dest, value)
+
+
+class DTCSAction(argparse.Action):
+ def __call__(self, parser, namespace, value, option_string=None):
+ try:
+ value = int(value, 10)
+ except ValueError:
+ raise argparse.ArgumentError("Invalid DTCS value: %s" % value)
+
+ if value not in chirp_common.DTCS_CODES:
+ raise argparse.ArgumentError("Invalid DTCS value: %03i" % value)
+ setattr(namespace, self.dest, value)
+
+
+class DTCSPolarityAction(argparse.Action):
+ def __call__(self, parser, namespace, value, option_string=None):
+ if value not in ["NN", "RN", "NR", "RR"]:
+ raise optparse.OptionValueError("Invaid DTCS polarity: %s" % value)
+ setattr(parser.values, option.dest, value)
+
+
+def parse_memory_number(radio, args):
+ if len(args) < 1:
+ LOG.error("You must provide an argument specifying the memory number.")
+ sys.exit(1)
+
+ try:
+ memnum = int(args[0])
+ except ValueError:
+ memnum = args[0]
+
+ rf = radio.get_features()
+ start, end = rf.memory_bounds
+ if not (start <= memnum <= end or memnum in rf.valid_special_chans):
+ if len(rf.valid_special_chans) > 0:
+ LOG.error(
+ "memory number must be between %d and %d or one of %s"
+ " (got %s)",
+ start, end, ", ".join(rf.valid_special_chans), memnum)
+ else:
+ LOG.error("memory number must be between %d and %d (got %s)",
+ start, end, memnum)
+ sys.exit(1)
+ return memnum
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ logger.add_version_argument(parser)
+ parser.add_argument("-s", "--serial", dest="serial",
+ default="mmap",
+ help="Serial port (default: mmap)")
+
+ parser.add_argument("--list-settings", action="store_true",
+ help="List settings")
+
+ parser.add_argument("-i", "--id", dest="id",
+ default=False,
+ action="store_true",
+ help="Request radio ID string")
+
+ memarg = parser.add_argument_group("Memory/Channel Options")
+ memarg.add_argument("--list-mem", action="store_true",
+ help="List all memory locations")
+
+ memarg.add_argument("--list-special-mem", action="store_true",
+ help="List all special memory locations")
+
+ memarg.add_argument("--raw", action="store_true",
+ help="Dump raw memory location")
+
+ memarg.add_argument("--get-mem", action="store_true",
+ help="Get and print memory location")
+ memarg.add_argument("--copy-mem", action="store_true",
+ help="Copy memory location")
+ memarg.add_argument("--clear-mem", action="store_true",
+ help="Clear memory location")
+
+ memarg.add_argument("--set-mem-name", help="Set memory name")
+ memarg.add_argument("--set-mem-freq", type=float,
+ help="Set memory frequency")
+
+ memarg.add_argument("--set-mem-tencon", action="store_true",
+ help="Set tone encode enabled flag")
+ memarg.add_argument("--set-mem-tencoff", action="store_true",
+ help="Set tone decode disabled flag")
+ memarg.add_argument("--set-mem-tsqlon", action="store_true",
+ help="Set tone squelch enabled flag")
+ memarg.add_argument("--set-mem-tsqloff", action="store_true",
+ help="Set tone squelch disabled flag")
+ memarg.add_argument("--set-mem-dtcson", action="store_true",
+ help="Set DTCS enabled flag")
+ memarg.add_argument("--set-mem-dtcsoff", action="store_true",
+ help="Set DTCS disabled flag")
+
+ memarg.add_argument("--set-mem-tenc",
+ type=float, action=ToneAction, nargs=1,
+ help="Set memory encode tone")
+ memarg.add_argument("--set-mem-tsql",
+ type=float, action=ToneAction, nargs=1,
+ help="Set memory squelch tone")
+
+ memarg.add_argument("--set-mem-dtcs",
+ type=int, action=DTCSAction, nargs=1,
+ help="Set memory DTCS code")
+ memarg.add_argument("--set-mem-dtcspol",
+ action=DTCSPolarityAction, nargs=1,
+ help="Set memory DTCS polarity (NN, NR, RN, RR)")
+
+ memarg.add_argument("--set-mem-dup",
+ help="Set memory duplex (+,-, or blank)")
+ memarg.add_argument("--set-mem-offset", type=float,
+ help="Set memory duplex offset (in MHz)")
+
+ memarg.add_argument("--set-mem-mode",
+ help="Set mode (%s)" % ",".join(chirp_common.MODES))
+
+ parser.add_argument("-r", "--radio", dest="radio",
+ default=None,
+ help="Radio model (see --list-radios)")
+ parser.add_argument("--list-radios", action="store_true",
+ help="List radio models")
+ parser.add_argument("--mmap", dest="mmap",
+ default=None,
+ help="Radio memory map file location")
+ parser.add_argument("--download-mmap", dest="download_mmap",
+ action="store_true",
+ default=False,
+ help="Download memory map from radio")
+ parser.add_argument("--upload-mmap", dest="upload_mmap",
+ action="store_true",
+ default=False,
+ help="Upload memory map to radio")
+ logger.add_arguments(parser)
+ parser.add_argument("args", metavar="arg", nargs='*',
+ help="Some commands require additional arguments")
+
+ if len(sys.argv) <= 1:
+ parser.print_help()
+ sys.exit(0)
+
+ options = parser.parse_args()
+ args = options.args
+
+ logger.handle_options(options)
+
+ if options.list_radios:
+ print("Supported Radios:\n\t", "\n\t".join(sorted(RADIOS.keys())))
+ sys.exit(0)
+
+ if options.id:
+ from chirp import icf
+ s = serial.Serial(port=options.serial, baudrate=9600, timeout=0.5)
+ md = icf.get_model_data(s)
+ print("Model:\n%s" % util.hexprint(md))
+ sys.exit(0)
+
+ if not options.radio:
+ if options.mmap:
+ rclass = directory.get_radio_by_image(options.mmap).__class__
+ else:
+ print("You must specify a radio model. See --list-radios.")
+ sys.exit(1)
+ else:
+ rclass = directory.get_radio(options.radio)
+
+ if options.serial == "mmap":
+ if options.mmap:
+ s = options.mmap
+ else:
+ s = options.radio + ".img"
+ if not os.path.exists(s):
+ LOG.error("Image file '%s' does not exist" % s)
+ sys.exit(1)
+ else:
+ LOG.info("opening %s at %i" % (options.serial, rclass.BAUD_RATE))
+ s = compat.CompatSerial.get(rclass.NEEDS_COMPAT_SERIAL,
+ port=options.serial,
+ baudrate=rclass.BAUD_RATE,
+ timeout=0.5)
+
+ radio = rclass(s)
+
+ if options.list_settings:
+ print(radio.get_settings())
+ sys.exit(0)
+
+ if options.list_mem:
+ rf = radio.get_features()
+ start, end = rf.memory_bounds
+ for i in range(start, end + 1):
+ mem = radio.get_memory(i)
+ if mem.empty and not logger.is_visible(logging.INFO):
+ continue
+ print(mem)
+ sys.exit(0)
+
+ if options.list_special_mem:
+ rf = radio.get_features()
+ for i in sorted(rf.valid_special_chans):
+ mem = radio.get_memory(i)
+ if mem.empty and not logger.is_visible(logging.INFO):
+ continue
+ print(mem)
+ sys.exit(0)
+
+ if options.copy_mem:
+ src = parse_memory_number(radio, args)
+ dst = parse_memory_number(radio, args[1:])
+ try:
+ mem = radio.get_memory(src)
+ except errors.InvalidMemoryLocation as e:
+ LOG.exception(e)
+ sys.exit(1)
+ LOG.info("copying memory %s to %s", src, dst)
+ mem.number = dst
+ radio.set_memory(mem)
+
+ if options.clear_mem:
+ memnum = parse_memory_number(radio, args)
+ try:
+ mem = radio.get_memory(memnum)
+ except errors.InvalidMemoryLocation as e:
+ LOG.exception(e)
+ sys.exit(1)
+ if mem.empty:
+ LOG.warn("memory %s is already empty, deleting again", memnum)
+ mem.empty = True
+ radio.set_memory(mem)
+
+ if options.raw:
+ memnum = parse_memory_number(radio, args)
+ data = radio.get_raw_memory(memnum)
+ for i in data:
+ if ord(i) > 0x7F:
+ print("Memory location %s (%i):\n%s" %
+ (memnum, len(data), util.hexprint(data)))
+ sys.exit(0)
+ print(data)
+ sys.exit(0)
+
+ if options.set_mem_dup is not None:
+ if options.set_mem_dup != "+" and \
+ options.set_mem_dup != "-" and \
+ options.set_mem_dup != "":
+ LOG.error("Invalid duplex value `%s'" % options.set_mem_dup)
+ LOG.error("Valid values are: '+', '-', ''")
+ sys.exit(1)
+ else:
+ _dup = options.set_mem_dup
+ else:
+ _dup = None
+
+ if options.set_mem_mode:
+ LOG.info("Set mode: %s" % options.set_mem_mode)
+ if options.set_mem_mode not in chirp_common.MODES:
+ LOG.error("Invalid mode `%s'")
+ sys.exit(1)
+ else:
+ _mode = options.set_mem_mode
+ else:
+ _mode = None
+
+ if options.set_mem_name or options.set_mem_freq or \
+ options.set_mem_tencon or options.set_mem_tencoff or \
+ options.set_mem_tsqlon or options.set_mem_tsqloff or \
+ options.set_mem_dtcson or options.set_mem_dtcsoff or \
+ options.set_mem_tenc or options.set_mem_tsql or \
+ options.set_mem_dtcs or options.set_mem_dup is not None or \
+ options.set_mem_mode or options.set_mem_dtcspol or\
+ options.set_mem_offset:
+ memnum = parse_memory_number(radio, args)
+ try:
+ mem = radio.get_memory(memnum)
+ except errors.InvalidMemoryLocation as e:
+ LOG.exception(e)
+ sys.exit(1)
+
+ if mem.empty:
+ LOG.info("creating new memory (#%s)", memnum)
+ mem = chirp_common.Memory()
+ mem.number = memnum
+
+ mem.name = options.set_mem_name or mem.name
+ mem.freq = options.set_mem_freq or mem.freq
+ mem.rtone = options.set_mem_tenc or mem.rtone
+ mem.ctone = options.set_mem_tsql or mem.ctone
+ mem.dtcs = options.set_mem_dtcs or mem.dtcs
+ mem.dtcs_polarity = options.set_mem_dtcspol or mem.dtcs_polarity
+ if _dup is not None:
+ mem.duplex = _dup
+ mem.offset = options.set_mem_offset or mem.offset
+ mem.mode = _mode or mem.mode
+
+ if options.set_mem_tencon:
+ mem.tencEnabled = True
+ elif options.set_mem_tencoff:
+ mem.tencEnabled = False
+
+ if options.set_mem_tsqlon:
+ mem.tsqlEnabled = True
+ elif options.set_mem_tsqloff:
+ mem.tsqlEnabled = False
+
+ if options.set_mem_dtcson:
+ mem.dtcsEnabled = True
+ elif options.set_mem_dtcsoff:
+ mem.dtcsEnabled = False
+
+ radio.set_memory(mem)
+
+ if options.get_mem:
+ pos = parse_memory_number(radio, args)
+ try:
+ mem = radio.get_memory(pos)
+ except errors.InvalidMemoryLocation as e:
+ mem = chirp_common.Memory()
+ mem.number = pos
+
+ print(mem)
+ sys.exit(0)
+
+ if options.download_mmap:
+ if not issubclass(rclass, chirp_common.CloneModeRadio):
+ LOG.error("%s is not a clone mode radio" % options.radio)
+ sys.exit(1)
+ if not options.mmap:
+ LOG.error("You must specify the destination file name with --mmap")
+ sys.exit(1)
+ try:
+ radio.sync_in()
+ radio.save_mmap(options.mmap)
+ except Exception as e:
+ LOG.exception(e)
+ sys.exit(1)
+
+ if options.upload_mmap:
+ if not issubclass(rclass, chirp_common.CloneModeRadio):
+ LOG.error("%s is not a clone mode radio" % options.radio)
+ sys.exit(1)
+ if not options.mmap:
+ LOG.error("You must specify the source file name with --mmap")
+ sys.exit(1)
+ try:
+ radio.load_mmap(options.mmap)
+ radio.sync_out()
+ print("Upload successful")
+ except Exception as e:
+ LOG.exception(e)
+ sys.exit(1)
+
+ if options.mmap and isinstance(radio, chirp_common.CloneModeRadio):
+ radio.save_mmap(options.mmap)
diff --git a/chirpw b/chirpw
index 9cd5c70..4e1c88b 100755
--- a/chirpw
+++ b/chirpw
@@ -15,15 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import glob
import os
-
-from chirp import chirp_common
-from chirp import logger
-from chirp import elib_intl
-from chirp import platform
-from chirp.drivers import *
-from chirp.ui import config
-
+import six
import sys
import os
@@ -33,10 +27,24 @@ import argparse
import logging
import urllib
-LOG = logging.getLogger("chirpw")
+if six.PY3:
+ from gi import pygtkcompat
+ pygtkcompat.enable()
+ pygtkcompat.enable_gtk(version='3.0')
+from chirp import chirp_common
+from chirp import directory
+from chirp import logger
+from chirp import elib_intl
+from chirp import platform
+from chirp.ui import config
+
+directory.safe_import_drivers()
+
+LOG = logging.getLogger("chirpw")
-urllib.URLopener.version = chirp_common.http_user_agent()
+# Does not work with python3 chirpw
+# urllib.URLopener.version = chirp_common.http_user_agent()
localepath = platform.get_platform().find_resource("locale")
@@ -103,7 +111,7 @@ except:
vmaj, vmin = pyver.split(".", 2)
vrel = 0
-if int(vmaj) < 2 or int(vmin) < 6:
+if int(vmaj) == 2 and int(vmin) < 6:
# Python <2.6, emulate str.format()
import __builtin__
diff --git a/chirpwx.py b/chirpwx.py
new file mode 100755
index 0000000..044aca9
--- /dev/null
+++ b/chirpwx.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python3
+
+import argparse
+import collections
+import functools
+import gettext
+import logging
+import os
+import sys
+
+import wx
+import wx.aui
+import wx.grid
+import wx.lib.newevent
+
+from chirp import chirp_common
+from chirp.drivers import ic2820, generic_csv
+from chirp import directory
+from chirp import logger
+
+from chirp.wxui import main
+
+
+
+if __name__ == '__main__':
+ gettext.install('CHIRP')
+ parser = argparse.ArgumentParser()
+ parser.add_argument("files", metavar="file", nargs='*',
+ help="File to open")
+ parser.add_argument("--module", metavar="module",
+ help="Load module on startup")
+ logger.add_version_argument(parser)
+ parser.add_argument("--profile", action="store_true",
+ help="Enable profiling")
+ parser.add_argument("--onlydriver", nargs="+",
+ help="Include this driver while loading")
+ parser.add_argument("--inspect", action="store_true",
+ help="Show wxPython inspector")
+ logger.add_arguments(parser)
+ args = parser.parse_args()
+
+ logger.handle_options(args)
+
+ directory.safe_import_drivers(limit=args.onlydriver)
+
+ #logging.basicConfig(level=logging.DEBUG)
+ app = wx.App()
+ mainwindow = main.ChirpMain(None, title='CHIRP')
+ mainwindow.Show()
+ for fn in args.files:
+ mainwindow.open_file(fn, select=False)
+
+ if args.inspect:
+ import wx.lib.inspection
+ wx.lib.inspection.InspectionTool().Show()
+
+ app.MainLoop()
diff --git a/locale/Makefile b/locale/Makefile
new file mode 100644
index 0000000..5271862
--- /dev/null
+++ b/locale/Makefile
@@ -0,0 +1,28 @@
+LOCALES = en_US pl it nl de hu ru pt_BR fr uk_UA es_ES
+MOFILES = $(patsubst %,%/LC_MESSAGES/CHIRP.mo,$(LOCALES))
+
+COPY="Dan Smith <dsmith@danplanet.com>"
+PKG=CHIRP
+XGT_OPTS=--copyright-holder=$(COPY) --package-name=$(PKG)
+
+all: $(MOFILES)
+
+clean:
+ rm -f $(MOFILES) *~ *.orig
+ find . -name '*.mo' -exec rm -f "{}" \;
+ find * -depth -type d -exec rmdir "{}" \;
+
+chirpui.pot:
+ /usr/bin/find ../chirp/ui -name '*.py' > .files
+ xgettext -L Python -k_ -o chirpui.pot -f .files $(XGT_OPTS)
+
+%.po: chirpui.pot
+ if [ -f $@ ]; then \
+ msgmerge -U $@ chirpui.pot; \
+ else \
+ msginit --input=chirpui.pot --locale=$(@:%.po=%); \
+ fi
+
+%/LC_MESSAGES/CHIRP.mo: %.po
+ mkdir -p $(shell dirname $@)
+ msgfmt --output-file=$@ $^
diff --git a/locale/check_parameters.py b/locale/check_parameters.py
new file mode 100755
index 0000000..f0f3d51
--- /dev/null
+++ b/locale/check_parameters.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+import polib
+from string import Formatter
+import glob
+
+filelist = glob.glob("*.po")
+pos = {filename: polib.pofile(filename) for filename in filelist}
+
+formatter = Formatter()
+
+for name, po in pos.iteritems():
+ print "Testing", name
+ for entry in po:
+ if len(entry.msgstr) > 0:
+ try:
+ ids = [field_name
+ for literal_text, field_name, format_spec, conversion
+ in formatter.parse(entry.msgid)]
+ tids = [field_name
+ for literal_text, field_name, format_spec, conversion
+ in formatter.parse(entry.msgstr)]
+ except Exception as e:
+ print "Got exception!", e, "for entry", entry.msgid
+ else:
+ if tids is not None:
+ missing = [name for name in tids
+ if name is not None and name not in ids]
+ if len(missing) > 0:
+ print "Missing parameters", missing, \
+ "in translation of", entry.msgid
diff --git a/locale/de.po b/locale/de.po
new file mode 100644
index 0000000..c7c8704
--- /dev/null
+++ b/locale/de.po
@@ -0,0 +1,1081 @@
+# German translations for CHIRP package.
+# Copyright (C) 2012 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dsmith@danplanet.com>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-10-02 00:01-0700\n"
+"PO-Revision-Date: 2012-10-02 22:11+0100\n"
+"Last-Translator: Benjamin, HB9EUK <hb9euk@hb9d.org>\n"
+"Language-Team: German\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 1.5.3\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Abrufen der Speicherbank"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Setze Name für Bank"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Bank"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:258
+#: ../chirpui/importdialog.py:576 ../chirpui/memdetail.py:228
+#: ../chirpui/memedit.py:65 ../chirpui/memedit.py:86 ../chirpui/memedit.py:259
+#: ../chirpui/memedit.py:900 ../chirpui/memedit.py:956
+#: ../chirpui/memedit.py:1098 ../chirpui/memedit.py:1100
+msgid "Name"
+msgstr "Name"
+
+#: ../chirpui/bankedit.py:201
+msgid "Updating bank index for memory {num}"
+msgstr "Aktualisiere Bank Index für Speicher {num}"
+
+#: ../chirpui/bankedit.py:210
+msgid "Updating bank information for memory {num}"
+msgstr "Aktualisiere Bankinformation für Speicher {num}"
+
+#: ../chirpui/bankedit.py:216 ../chirpui/bankedit.py:246
+msgid "Getting memory {num}"
+msgstr "Lade Speicher {num}"
+
+#: ../chirpui/bankedit.py:231
+msgid "Setting index for memory {num}"
+msgstr "Setze Index für Speicher {num}"
+
+#: ../chirpui/bankedit.py:240
+msgid "Getting bank for memory {num}"
+msgstr "Lade Bank für Speicher {num}"
+
+#: ../chirpui/bankedit.py:256 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:174 ../chirpui/memedit.py:258
+#: ../chirpui/memedit.py:327 ../chirpui/memedit.py:347
+#: ../chirpui/memedit.py:361 ../chirpui/memedit.py:432
+#: ../chirpui/memedit.py:444 ../chirpui/memedit.py:468
+#: ../chirpui/memedit.py:470 ../chirpui/memedit.py:543
+#: ../chirpui/memedit.py:557 ../chirpui/memedit.py:559
+#: ../chirpui/memedit.py:600 ../chirpui/memedit.py:602
+#: ../chirpui/memedit.py:643 ../chirpui/memedit.py:849
+#: ../chirpui/memedit.py:898 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:954
+#: ../chirpui/memedit.py:1275
+msgid "Loc"
+msgstr "Loc"
+
+#: ../chirpui/bankedit.py:257 ../chirpui/importdialog.py:577
+#: ../chirpui/memdetail.py:227 ../chirpui/memedit.py:64
+#: ../chirpui/memedit.py:87 ../chirpui/memedit.py:189
+#: ../chirpui/memedit.py:252 ../chirpui/memedit.py:260
+#: ../chirpui/memedit.py:283 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:316 ../chirpui/memedit.py:901
+#: ../chirpui/memedit.py:953
+msgid "Frequency"
+msgstr "Frequenz"
+
+#: ../chirpui/bankedit.py:259
+msgid "Index"
+msgstr "Index"
+
+#: ../chirpui/bankedit.py:346
+msgid "Getting bank information for memory {num}"
+msgstr "Lade Bankinformation für Speicher {num}"
+
+#: ../chirpui/bankedit.py:368
+msgid "Getting bank information"
+msgstr "Lade Bankinformation"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} auf {port}"
+
+#: ../chirpui/clone.py:103 ../chirpui/clone.py:104 ../chirpui/clone.py:166
+msgid "Detect"
+msgstr "Erkennung"
+
+#: ../chirpui/clone.py:127
+msgid "Port"
+msgstr "Port"
+
+#: ../chirpui/clone.py:128
+msgid "Vendor"
+msgstr "Hersteller"
+
+#: ../chirpui/clone.py:129
+msgid "Model"
+msgstr "Model"
+
+#: ../chirpui/clone.py:142
+msgid "Radio"
+msgstr "Gerät"
+
+#: ../chirpui/clone.py:170
+msgid "Unable to detect radio on {port}"
+msgstr "Kann Gerät auf {port} nicht erkennen"
+
+#: ../chirpui/clone.py:182
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Interner Fehler: Upload zu {model} nicht möglich"
+
+#: ../chirpui/clone.py:230
+msgid "Clone failed: {error}"
+msgstr "Klonen fehlgeschlagen: {error}"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Klonen Fortschritt"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Klonen"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: ../chirpui/common.py:216
+msgid "Completed"
+msgstr "Beendet"
+
+#: ../chirpui/common.py:217
+msgid "idle"
+msgstr "Ruhezustand"
+
+#: ../chirpui/common.py:317
+msgid "Details"
+msgstr "Details"
+
+#: ../chirpui/common.py:320
+msgid "Proceed?"
+msgstr "Weiter?"
+
+#: ../chirpui/common.py:329
+msgid "Do not show this next time"
+msgstr "Nicht wieder anzeigen"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Rufzeichen"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Ihr Rufzeichen"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Repeater Rufzeichen"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Mein Rufzeichen"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1416
+msgid "Downloading URCALL list"
+msgstr "Downloading URCALL Liste"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1428
+msgid "Downloading RPTCALL list"
+msgstr "Downloading RPTCALL Liste"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Downloading MYCALL Liste"
+
+#: ../chirpui/editorset.py:91
+msgid "Memories"
+msgstr "Speicher"
+
+#: ../chirpui/editorset.py:96
+msgid "D-STAR"
+msgstr "D-Star"
+
+#: ../chirpui/editorset.py:102
+msgid "Bank Names"
+msgstr "Bank Namen"
+
+#: ../chirpui/editorset.py:108
+msgid "Banks"
+msgstr "Bank"
+
+#: ../chirpui/editorset.py:114
+msgid "Settings"
+msgstr "Einstellungen"
+
+#: ../chirpui/editorset.py:236
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "Der {vendor} {model} hat mehrere unabhängige Sub-Geräte"
+
+#: ../chirpui/editorset.py:239
+msgid "Choose one to import from:"
+msgstr "Importieren von:"
+
+#: ../chirpui/editorset.py:244
+msgid "Cancelled"
+msgstr "Abgebrochen"
+
+#: ../chirpui/editorset.py:249
+msgid "Internal Error"
+msgstr "Interner Fehler"
+
+#: ../chirpui/editorset.py:281
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+"Es gab Fehler beim Öffnen {file}. Die betroffenen Speicher werden nicht "
+"importiert!"
+
+#: ../chirpui/editorset.py:293
+msgid "There was an error during import: {error}"
+msgstr "Es gab einen Fehler beim Import: {error}"
+
+#: ../chirpui/editorset.py:303
+msgid "Unsupported file type"
+msgstr "Nicht unterstuetzter Dateityp"
+
+#: ../chirpui/editorset.py:319 ../chirpui/editorset.py:334
+msgid "There was an error during export: {error}"
+msgstr "Es gab einen Fehler beim Export: {error}"
+
+#: ../chirpui/editorset.py:346
+msgid "Priming memory"
+msgstr "Primärspeicher"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another valü for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+"Standort {number} wurde bereits importiert. Wählen Sie einen anderen Wert "
+"für 'Neuen Standort' vor der Auswahl 'Import'"
+
+#: ../chirpui/importdialog.py:123
+msgid "Invalid value. Must be an integer."
+msgstr "Ungültiger Wert. Muss eine ganze Zahl sein."
+
+#: ../chirpui/importdialog.py:132
+msgid "Location {number} is already being imported"
+msgstr "Standort {number} wurde bereits importiert"
+
+#: ../chirpui/importdialog.py:192
+msgid "Updating URCALL list"
+msgstr "Updating URCALL Liste"
+
+#: ../chirpui/importdialog.py:197
+msgid "Updating RPTCALL list"
+msgstr "Updating RPTCALL Liste"
+
+#: ../chirpui/importdialog.py:270
+msgid "Setting memory {number}"
+msgstr "Setze Speicher {number}"
+
+#: ../chirpui/importdialog.py:274
+msgid "Importing bank information"
+msgstr "Importieren von Speicherbänke"
+
+#: ../chirpui/importdialog.py:278
+msgid "Error importing memories:"
+msgstr "Fehler beim Speicherimport"
+
+#: ../chirpui/importdialog.py:390
+msgid "All"
+msgstr "Alle"
+
+#: ../chirpui/importdialog.py:396
+msgid "None"
+msgstr "Keine"
+
+#: ../chirpui/importdialog.py:402
+msgid "Inverse"
+msgstr "Umkehren"
+
+#: ../chirpui/importdialog.py:408
+msgid "Select"
+msgstr "Wählen"
+
+#: ../chirpui/importdialog.py:454
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:460
+msgid "Reverse"
+msgstr "Zurücksetzen"
+
+#: ../chirpui/importdialog.py:466
+msgid "Adjust New Location"
+msgstr "Neuen Standort wählen"
+
+#: ../chirpui/importdialog.py:476
+msgid "Confirm overwrites"
+msgstr "Überschreiben bestätigen"
+
+#: ../chirpui/importdialog.py:482
+msgid "Options"
+msgstr "Optionen"
+
+#: ../chirpui/importdialog.py:535
+msgid "Cannot be imported because"
+msgstr "Kann nicht Importiert werden weil"
+
+#: ../chirpui/importdialog.py:553
+msgid "Import From File"
+msgstr "Importieren von Datei"
+
+#: ../chirpui/importdialog.py:554 ../chirpui/mainapp.py:1360
+msgid "Import"
+msgstr "Importieren"
+
+#: ../chirpui/importdialog.py:574
+msgid "To"
+msgstr "Nach"
+
+#: ../chirpui/importdialog.py:575
+msgid "From"
+msgstr "Von"
+
+#: ../chirpui/importdialog.py:578 ../chirpui/memdetail.py:245
+#: ../chirpui/memedit.py:79 ../chirpui/memedit.py:101
+#: ../chirpui/memedit.py:915 ../chirpui/memedit.py:971
+#: ../chirpui/memedit.py:1103
+msgid "Comment"
+msgstr "Kommentar"
+
+#: ../chirpui/importdialog.py:582
+msgid "Location memory will be imported into"
+msgstr "Speicherstandort wird importiert nach"
+
+#: ../chirpui/importdialog.py:583
+msgid "Location of memory in the file being imported"
+msgstr "Speicherposition der importierten Datei"
+
+#: ../chirpui/importdialog.py:606
+msgid "Preparing memory list..."
+msgstr "Speicher Liste vorbereiten..."
+
+#: ../chirpui/importdialog.py:615
+msgid "Export To File"
+msgstr "In Datei exportieren"
+
+#: ../chirpui/importdialog.py:616 ../chirpui/mainapp.py:1361
+msgid "Export"
+msgstr "Exportieren"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Ein Fehler ist aufgetreten"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Überschreiben"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Datei existiert"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Datei {name} existiert bereit, wollen Sie diese überschreiben?"
+
+#: ../chirpui/mainapp.py:219 ../chirpui/mainapp.py:442
+msgid "Untitled"
+msgstr "Namenlos"
+
+#: ../chirpui/mainapp.py:266 ../chirpui/mainapp.py:705
+msgid "CHIRP Radio Images"
+msgstr "CHIRP Radio Images"
+
+#: ../chirpui/mainapp.py:267 ../chirpui/mainapp.py:704
+#: ../chirpui/mainapp.py:999
+msgid "CHIRP Files"
+msgstr "CHIRP Datei"
+
+#: ../chirpui/mainapp.py:268 ../chirpui/mainapp.py:706
+#: ../chirpui/mainapp.py:998
+msgid "CSV Files"
+msgstr "CSV Datei"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:707
+msgid "EVE Files (VX5)"
+msgstr "EVE Files (VX5)"
+
+#: ../chirpui/mainapp.py:270 ../chirpui/mainapp.py:708
+msgid "ICF Files"
+msgstr "ICF Datei"
+
+#: ../chirpui/mainapp.py:271 ../chirpui/mainapp.py:711
+msgid "VX5 Commander Files"
+msgstr "VX5 Commander Files"
+
+#: ../chirpui/mainapp.py:272 ../chirpui/mainapp.py:712
+msgid "VX6 Commander Files"
+msgstr "VX6 Commander Files"
+
+#: ../chirpui/mainapp.py:273 ../chirpui/mainapp.py:713
+msgid "VX7 Commander Files"
+msgstr "VX7 Commander Files"
+
+#: ../chirpui/mainapp.py:283
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"ICF-Dateien können nicht bearbeitet werden, nur angezeigt oder importiert in "
+"eine andere Datei. Öffnen im Read-Only-Modus?"
+
+#: ../chirpui/mainapp.py:326
+msgid "There was an error opening {fname}: {error}"
+msgstr "Es gab einen Fehler beim Öffnen {fname}: {error}"
+
+#: ../chirpui/mainapp.py:341
+msgid "{num} errors during open:"
+msgstr "{num} Fehler beim Öffnen:"
+
+#: ../chirpui/mainapp.py:347
+msgid "Note:"
+msgstr "Hinweis:"
+
+#: ../chirpui/mainapp.py:348
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"Die {vendor} {model} arbeitet im <b> Live-Modus</b>. Dies bedeutet, dass "
+"alle Änderungen sofort an das Radio gesendet werden. Aus diesem Grund können "
+"Sie die Funktionen <u> Speichern </u> oder <u> hochladen </u> nicht "
+"verwenden. Wenn Sie die Inhalte offline bearbeiten wollen, bitte mit <u> "
+"Exportieren </u> in eine CSV-Datei speichern, unter <b> Datei Exportieren </"
+"b>."
+
+#: ../chirpui/mainapp.py:357
+msgid "Don't show this again"
+msgstr "Nicht wieder anzeigen"
+
+#: ../chirpui/mainapp.py:402
+msgid "{vendor} {model} image file"
+msgstr "{vendor} {model} Imagedatei"
+
+#: ../chirpui/mainapp.py:410
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:412
+msgid "VX6 Commander"
+msgstr "VX6 Commander"
+
+#: ../chirpui/mainapp.py:414
+msgid "EVE"
+msgstr "EVE"
+
+#: ../chirpui/mainapp.py:415
+msgid "VX5 Commander"
+msgstr "VX5 Commander"
+
+#: ../chirpui/mainapp.py:477
+msgid "Open recent file {name}"
+msgstr "Letzte Datei öffnen {name}"
+
+#: ../chirpui/mainapp.py:538
+msgid "Import stock configuration {name}"
+msgstr "Speichervorgabe importieren {name}"
+
+#: ../chirpui/mainapp.py:554
+msgid "Open stock configuration {name}"
+msgstr "Vorgaben öffnen {name}"
+
+#: ../chirpui/mainapp.py:576
+msgid "Proceed with experimental driver?"
+msgstr "Weiter mit dem experimentellen Treiber?"
+
+#: ../chirpui/mainapp.py:578
+msgid "This radio's driver is experimental. Do you want to proceed?"
+msgstr "Dieser Geräte Treiber ist experimentell. Wollen Sie fortfahren?"
+
+#: ../chirpui/mainapp.py:671
+msgid "Save Changes?"
+msgstr "Änderungen speichern?"
+
+#: ../chirpui/mainapp.py:676
+msgid "File is modified, save changes before closing?"
+msgstr "Datei wurde geändert, speichern Sie die Änderungen vor dem Schliessen?"
+
+#: ../chirpui/mainapp.py:709
+msgid "Kenwood HMK Files"
+msgstr "Kenwood HMK Datei"
+
+#: ../chirpui/mainapp.py:710
+msgid "Travel Plus Files"
+msgstr "Travel Plus Datei"
+
+#: ../chirpui/mainapp.py:1042
+msgid "With significant contributions by:"
+msgstr "Mit bedeutenden Beiträgen von:"
+
+#: ../chirpui/mainapp.py:1066
+msgid "Select Columns"
+msgstr "Spalten auswählen"
+
+#: ../chirpui/mainapp.py:1081
+msgid "Visible columns for {radio}"
+msgstr "Sichtbare Spalten für {radio}"
+
+#: ../chirpui/mainapp.py:1138
+msgid "Reporting is disabled"
+msgstr "Report ist deaktiviert"
+
+#: ../chirpui/mainapp.py:1139
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"Die Reporting-Funktion von CHIRP soll helfen, <u>die Qualität ständig zu "
+"verbessern</u>, in dem sich die Autoren auf die Fehler der am häufigsten "
+"verwendeten Radio-Treiber konzentrieren können. Die Berichte enthalten keine "
+"identifizierbaren Informationen und werden zu rein statistischen Zwecken "
+"verwendet. Ihre Privatsphäre ist uns sehr wichtig, <u>bitte lassen Sie diese "
+"Funktion aktiviert, so helfen Sie mit, CHIRP weiter zu verbessern!</u> \n"
+"\n"
+"<b>Sind Sie sicher, dass Sie diese Funktion deaktivieren wollen?</b>"
+
+#: ../chirpui/mainapp.py:1172
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+"Wählen Sie eine Sprache oder Auto, um die Defaultsprache vom Betriebssystem "
+"zu verwenden. Bevor die Änderungen wirksam werden, müssen Sie Chirp neu "
+"starten."
+
+#: ../chirpui/mainapp.py:1185
+msgid "Python Modules"
+msgstr "Python Modules"
+
+#: ../chirpui/mainapp.py:1332
+msgid "_File"
+msgstr "_Datei"
+
+#: ../chirpui/mainapp.py:1335
+msgid "Open stock config"
+msgstr "Speichervorgaben öffnen"
+
+#: ../chirpui/mainapp.py:1336
+msgid "_Recent"
+msgstr "_Aktuell"
+
+#: ../chirpui/mainapp.py:1339
+msgid "Load Module"
+msgstr "Module laden"
+
+#: ../chirpui/mainapp.py:1342
+msgid "_Edit"
+msgstr "_Bearbeiten"
+
+#: ../chirpui/mainapp.py:1343
+msgid "_Cut"
+msgstr "_Ausschneiden"
+
+#: ../chirpui/mainapp.py:1344
+msgid "_Copy"
+msgstr "_Kopieren"
+
+#: ../chirpui/mainapp.py:1345
+msgid "_Paste"
+msgstr "_Einfügen"
+
+#: ../chirpui/mainapp.py:1346
+msgid "_Delete"
+msgstr "_Löschen"
+
+#: ../chirpui/mainapp.py:1347
+msgid "Move _Up"
+msgstr "Nach _Oben"
+
+#: ../chirpui/mainapp.py:1348
+msgid "Move Dow_n"
+msgstr "Nach _Unten"
+
+#: ../chirpui/mainapp.py:1349
+msgid "E_xchange"
+msgstr "A_ustausch"
+
+#: ../chirpui/mainapp.py:1350
+msgid "_View"
+msgstr "_Ansicht"
+
+#: ../chirpui/mainapp.py:1351
+msgid "Columns"
+msgstr "Spalten"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Developer"
+msgstr "Entwickler"
+
+#: ../chirpui/mainapp.py:1353
+msgid "Show raw memory"
+msgstr "Zeige Roh Speicher"
+
+#: ../chirpui/mainapp.py:1354
+msgid "Diff raw memories"
+msgstr "Vergleiche Roh Speicher"
+
+#: ../chirpui/mainapp.py:1355
+msgid "Diff tabs"
+msgstr "Registerkarten vergleichen"
+
+#: ../chirpui/mainapp.py:1356
+msgid "Change language"
+msgstr "Sprache wählen"
+
+#: ../chirpui/mainapp.py:1357
+msgid "_Radio"
+msgstr "_Gerät"
+
+#: ../chirpui/mainapp.py:1358
+msgid "Download From Radio"
+msgstr "Download vom Gerät"
+
+#: ../chirpui/mainapp.py:1359
+msgid "Upload To Radio"
+msgstr "Upload zum Gerät"
+
+#: ../chirpui/mainapp.py:1362
+msgid "Import from data source"
+msgstr "Import aus der Datenquelle"
+
+#: ../chirpui/mainapp.py:1363 ../chirpui/mainapp.py:1367
+msgid "RadioReference.com"
+msgstr "RadioReference.com"
+
+#: ../chirpui/mainapp.py:1364 ../chirpui/mainapp.py:1368
+msgid "RFinder"
+msgstr "RFinder"
+
+#: ../chirpui/mainapp.py:1365 ../chirpui/mainapp.py:1369
+msgid "RepeaterBook"
+msgstr "RepeaterBook"
+
+#: ../chirpui/mainapp.py:1366
+msgid "Query data source"
+msgstr "Datenquelle abfragen"
+
+#: ../chirpui/mainapp.py:1370
+msgid "CHIRP Native File"
+msgstr "CHIRP Native File"
+
+#: ../chirpui/mainapp.py:1371
+msgid "CSV File"
+msgstr "CSV Datei"
+
+#: ../chirpui/mainapp.py:1372
+msgid "Import from stock config"
+msgstr "Import von der Vorgabe"
+
+#: ../chirpui/mainapp.py:1374
+msgid "Help"
+msgstr "Hilfe"
+
+#: ../chirpui/mainapp.py:1385
+msgid "Report statistics"
+msgstr "Report Statistik"
+
+#: ../chirpui/mainapp.py:1386
+msgid "Hide Unused Fields"
+msgstr "Unbenutzte Felder verbergen"
+
+#: ../chirpui/mainapp.py:1387
+msgid "Automatic Repeater Offset"
+msgstr "Automatischer Repeater-Offset"
+
+#: ../chirpui/mainapp.py:1388
+msgid "Enable Developer Functions"
+msgstr "Entwickler Funktionen aktivieren"
+
+#: ../chirpui/mainapp.py:1498
+msgid "A new version of CHIRP is available: "
+msgstr "Eine neue Version von CHIRP ist verfügbar:"
+
+#: ../chirpui/mainapp.py:1572
+msgid "Error reporting is enabled"
+msgstr "Fehler Reporting ist eingeschaltet"
+
+#: ../chirpui/mainapp.py:1575
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr ""
+"Wenn Sie diese Funktion deaktivieren möchten, können Sie das im <u>Hilfe</u> "
+"Menu machen"
+
+#: ../chirpui/memdetail.py:214
+msgid "Edit Memory#{num}"
+msgstr "Speiche editieren#{num}"
+
+#: ../chirpui/memdetail.py:229 ../chirpui/memedit.py:66
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:116
+#: ../chirpui/memedit.py:206 ../chirpui/memedit.py:324
+#: ../chirpui/memedit.py:902 ../chirpui/memedit.py:962
+#: ../chirpui/memedit.py:1104 ../chirpui/memedit.py:1168
+msgid "Tone Mode"
+msgstr "Tone Mode"
+
+#: ../chirpui/memdetail.py:230 ../chirpui/memedit.py:67
+#: ../chirpui/memedit.py:88 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:218 ../chirpui/memedit.py:227
+#: ../chirpui/memedit.py:230 ../chirpui/memedit.py:322
+#: ../chirpui/memedit.py:903 ../chirpui/memedit.py:958
+#: ../chirpui/memedit.py:1105
+msgid "Tone"
+msgstr "Tone"
+
+#: ../chirpui/memdetail.py:231 ../chirpui/memedit.py:68
+#: ../chirpui/memedit.py:89 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:228
+#: ../chirpui/memedit.py:231 ../chirpui/memedit.py:322
+#: ../chirpui/memedit.py:904 ../chirpui/memedit.py:959
+#: ../chirpui/memedit.py:1101
+msgid "ToneSql"
+msgstr "ToneSql"
+
+#: ../chirpui/memdetail.py:232 ../chirpui/memedit.py:69
+#: ../chirpui/memedit.py:90 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:213 ../chirpui/memedit.py:220
+#: ../chirpui/memedit.py:225 ../chirpui/memedit.py:232
+#: ../chirpui/memedit.py:318 ../chirpui/memedit.py:905
+#: ../chirpui/memedit.py:960 ../chirpui/memedit.py:1093
+msgid "DTCS Code"
+msgstr "DTCS Code"
+
+#: ../chirpui/memdetail.py:233 ../chirpui/memedit.py:71
+#: ../chirpui/memedit.py:92 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:215 ../chirpui/memedit.py:222
+#: ../chirpui/memedit.py:234 ../chirpui/memedit.py:907
+#: ../chirpui/memedit.py:964 ../chirpui/memedit.py:1095
+#: ../chirpui/memedit.py:1173
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memdetail.py:234
+msgid "Cross mode"
+msgstr "Cross Mode"
+
+#: ../chirpui/memdetail.py:237 ../chirpui/memedit.py:73
+#: ../chirpui/memedit.py:94 ../chirpui/memedit.py:114
+#: ../chirpui/memedit.py:142 ../chirpui/memedit.py:207
+#: ../chirpui/memedit.py:261 ../chirpui/memedit.py:324
+#: ../chirpui/memedit.py:909 ../chirpui/memedit.py:965
+#: ../chirpui/memedit.py:1106 ../chirpui/memedit.py:1178
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memdetail.py:238 ../chirpui/memedit.py:74
+#: ../chirpui/memedit.py:95 ../chirpui/memedit.py:140
+#: ../chirpui/memedit.py:200 ../chirpui/memedit.py:237
+#: ../chirpui/memedit.py:262 ../chirpui/memedit.py:320
+#: ../chirpui/memedit.py:910 ../chirpui/memedit.py:966
+#: ../chirpui/memedit.py:1097
+msgid "Offset"
+msgstr "Offset"
+
+#: ../chirpui/memdetail.py:239 ../chirpui/memedit.py:75
+#: ../chirpui/memedit.py:96 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:308 ../chirpui/memedit.py:911
+#: ../chirpui/memedit.py:967 ../chirpui/memedit.py:1096
+#: ../chirpui/memedit.py:1167 ../chirpui/memedit.py:1180
+#: ../chirpui/memedit.py:1181 ../chirpui/memedit.py:1340
+#: ../chirpui/memedit.py:1358 ../chirpui/memedit.py:1368
+msgid "Mode"
+msgstr "Mode"
+
+#: ../chirpui/memdetail.py:241 ../chirpui/memedit.py:77
+#: ../chirpui/memedit.py:98 ../chirpui/memedit.py:115
+#: ../chirpui/memedit.py:145 ../chirpui/memedit.py:148
+#: ../chirpui/memedit.py:913 ../chirpui/memedit.py:969
+#: ../chirpui/memedit.py:1099
+msgid "Tune Step"
+msgstr "Abstimmungsschritt"
+
+#: ../chirpui/memdetail.py:244 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:100 ../chirpui/memedit.py:914
+#: ../chirpui/memedit.py:970 ../chirpui/memedit.py:1107
+#: ../chirpui/memedit.py:1170
+msgid "Skip"
+msgstr "Überspringen"
+
+#: ../chirpui/memdetail.py:289
+msgid "Memory validation failed:"
+msgstr "Speicher-Validierung fehlgeschlagen:"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Ungültiger Wert für dieses Feld"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:91 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:221
+#: ../chirpui/memedit.py:233 ../chirpui/memedit.py:318
+#: ../chirpui/memedit.py:906 ../chirpui/memedit.py:961
+#: ../chirpui/memedit.py:1094
+msgid "DTCS Rx Code"
+msgstr "DTCS Rx Code"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:93 ../chirpui/memedit.py:117
+#: ../chirpui/memedit.py:908 ../chirpui/memedit.py:963
+#: ../chirpui/memedit.py:1102 ../chirpui/memedit.py:1169
+msgid "Cross Mode"
+msgstr "Cross Mode"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:97 ../chirpui/memedit.py:113
+#: ../chirpui/memedit.py:308 ../chirpui/memedit.py:912
+#: ../chirpui/memedit.py:968 ../chirpui/memedit.py:1108
+#: ../chirpui/memedit.py:1171 ../chirpui/memedit.py:1176
+msgid "Power"
+msgstr "Leistung"
+
+#: ../chirpui/memedit.py:177
+msgid "Erasing memory {loc}"
+msgstr "Lösche Speicher {loc}"
+
+#: ../chirpui/memedit.py:247
+msgid "Unable to make changes to this model"
+msgstr "Keine Änderungen bei diesem Modell möglich"
+
+#: ../chirpui/memedit.py:253
+msgid "Editing new item, taking defaults"
+msgstr "Neues Element editieren, verwende Standardwerte"
+
+#: ../chirpui/memedit.py:269
+msgid "Bad value for {col}: {val}"
+msgstr "Falscher Wert für {col}: {val}"
+
+#: ../chirpui/memedit.py:293
+msgid "Error setting memory"
+msgstr "Fehler beim Setzen der Speicher"
+
+#: ../chirpui/memedit.py:301 ../chirpui/memedit.py:368
+#: ../chirpui/memedit.py:635 ../chirpui/memedit.py:1323
+msgid "Writing memory {number}"
+msgstr "Schreibe Speicher {number}"
+
+#: ../chirpui/memedit.py:373
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Dieser Vorgang erfordert eine Verschiebung aller nachfolgenden Kanäle, bis "
+"eine leere Stelle gefunden wird. Dies kann sehr lange dauern. Sind Sie "
+"sicher dass Sie das wollen?"
+
+#: ../chirpui/memedit.py:396
+msgid "Adding memory {number}"
+msgstr "Hinzufügen von Speicher {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:943
+msgid "Erasing memory {number}"
+msgstr "Löschen von Speicher {number}"
+
+#: ../chirpui/memedit.py:418 ../chirpui/memedit.py:527
+#: ../chirpui/memedit.py:573 ../chirpui/memedit.py:578
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:1202
+msgid "Getting memory {number}"
+msgstr "Lade Speicher {number}"
+
+#: ../chirpui/memedit.py:506 ../chirpui/memedit.py:517
+#: ../chirpui/memedit.py:565
+msgid "Moving memory from {old} to {new}"
+msgstr "Verschiebe Speicher von {old} nach {new}"
+
+#: ../chirpui/memedit.py:587
+msgid "Raw memory {number}"
+msgstr "Rohspeicher {number}"
+
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:619
+#: ../chirpui/memedit.py:624
+msgid "Getting raw memory {number}"
+msgstr "Lade Rohspeicher {number}"
+
+#: ../chirpui/memedit.py:596
+msgid "You can only diff two memories!"
+msgstr "Sie können nur zwei Speicher vergleichen!"
+
+#: ../chirpui/memedit.py:607
+msgid "Memory {number}"
+msgstr "Speicher {number}"
+
+#: ../chirpui/memedit.py:613
+msgid "Diff of {a} and {b}"
+msgstr "Diff of {a} and {b}"
+
+#: ../chirpui/memedit.py:650
+msgid "Memories must be contiguous"
+msgstr "Speicher müssen fortlaufend sein"
+
+#: ../chirpui/memedit.py:726
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: ../chirpui/memedit.py:727
+msgid "Insert row above"
+msgstr "Zeile oben einfügen"
+
+#: ../chirpui/memedit.py:728
+msgid "Insert row below"
+msgstr "Zeile unten einfügen"
+
+#: ../chirpui/memedit.py:729
+msgid "Delete"
+msgstr "Löschen"
+
+#: ../chirpui/memedit.py:729
+msgid "Delete all"
+msgstr "Alles löschen"
+
+#: ../chirpui/memedit.py:730
+msgid "Delete (and shift up)"
+msgstr "Löschen (und nach oben verschieben)"
+
+#: ../chirpui/memedit.py:731
+msgid "Move up"
+msgstr "Nach Oben"
+
+#: ../chirpui/memedit.py:732
+msgid "Move down"
+msgstr "Nach Unten"
+
+#: ../chirpui/memedit.py:733
+msgid "Exchange memories"
+msgstr "Speicher austauschen"
+
+#: ../chirpui/memedit.py:734
+msgid "Cut"
+msgstr "Ausschneiden"
+
+#: ../chirpui/memedit.py:735
+msgid "Copy"
+msgstr "Kopieren"
+
+#: ../chirpui/memedit.py:736
+msgid "Paste"
+msgstr "Einfügen"
+
+#: ../chirpui/memedit.py:737
+msgid "Show Raw Memory"
+msgstr "Zeige RAW Speicher"
+
+#: ../chirpui/memedit.py:738
+msgid "Diff Raw Memories"
+msgstr "Vergleiche Rohspeicher"
+
+#: ../chirpui/memedit.py:862
+msgid "Internal Error: Column {name} not found"
+msgstr "Interner Fehler: Spalte {name} wurde nicht gefunden"
+
+#: ../chirpui/memedit.py:891
+msgid "Getting channel {chan}"
+msgstr "Lade Kanal {chan}"
+
+#: ../chirpui/memedit.py:983
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Interner Fehler: Ungültige Grenzwert {number}"
+
+#: ../chirpui/memedit.py:993
+msgid "Memory range:"
+msgstr "Speicherbereich:"
+
+#: ../chirpui/memedit.py:1020
+msgid "Go"
+msgstr "Go"
+
+#: ../chirpui/memedit.py:1043
+msgid "Special Channels"
+msgstr "Spezial Kanäle"
+
+#: ../chirpui/memedit.py:1050
+msgid "Show Empty"
+msgstr "Leere anzeigen"
+
+#: ../chirpui/memedit.py:1235
+msgid "Cutting memory {number}"
+msgstr "Ausschneiden Speicher {number}"
+
+#: ../chirpui/memedit.py:1266
+msgid ""
+"Unable to paste {src} memories into {dst} rows. Increase the memory bounds "
+"or show empty memories."
+msgstr ""
+"Kann {src} Speicher in {dst} Zeilen einfügen. Erhöhen Sie die Speicher-"
+"Grenzen oder zeigen leere Speicher."
+
+#: ../chirpui/memedit.py:1277
+msgid "Overwrite?"
+msgstr "Überschreiben?"
+
+#: ../chirpui/memedit.py:1282
+msgid "Overwrite location {number}?"
+msgstr "Überschreibe Standort {number}"
+
+#: ../chirpui/memedit.py:1301
+msgid "Incompatible Memory"
+msgstr "Speicher nicht kompatibel"
+
+#: ../chirpui/memedit.py:1304
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr ""
+"Eingefügter Speicher {number} ist nicht mit diesem Gerät kompatibel weil:"
+
+#: ../chirpui/memedit.py:1360 ../chirpui/memedit.py:1375
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1360 ../chirpui/memedit.py:1376
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1360 ../chirpui/memedit.py:1377
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1361 ../chirpui/memedit.py:1378
+msgid "Digital Code"
+msgstr "Digital Code"
+
+#: ../chirpui/settingsedit.py:138
+msgid "Enabled"
+msgstr "Aktiviert"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "verschieben"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Verschieben {src} nach {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Suche nach einer freien Stelle ({number})"
+
+#: ../chirpui/shiftdialog.py:93
+msgid "No space to insert a row"
+msgstr "Kein Platz zum Einfügen einer Zeile"
+
+#: ../chirpui/shiftdialog.py:140
+msgid "Moved {count} memories"
+msgstr "Verschobene {count} Speicher"
diff --git a/locale/de/LC_MESSAGES/CHIRP.mo b/locale/de/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 3b76d2b..0000000
--- a/locale/de/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/en_US.po b/locale/en_US.po
new file mode 100644
index 0000000..b394796
--- /dev/null
+++ b/locale/en_US.po
@@ -0,0 +1,955 @@
+# English translations for CHIRP package.
+# Copyright (C) 2011 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dan@theine>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2011-11-29 16:07-0800\n"
+"Last-Translator: Dan Smith <dan@theine>\n"
+"Language-Team: English\n"
+"Language: en_US\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr ""
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr ""
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr ""
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr ""
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr ""
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr ""
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr ""
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr ""
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr ""
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr ""
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr ""
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr ""
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr ""
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr ""
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr ""
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr ""
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr ""
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr ""
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr ""
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr ""
+
+#: ../chirpui/importdialog.py:264
+#, fuzzy
+msgid "Error importing memories:"
+msgstr "Error reporting is enabled"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr ""
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr ""
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr ""
+
+#: ../chirpui/importdialog.py:394
+#, fuzzy
+msgid "Select"
+msgstr "Select Columns"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr ""
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr ""
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr ""
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr ""
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr ""
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr ""
+
+#: ../chirpui/importdialog.py:513
+#, fuzzy
+msgid "Import From File"
+msgstr "Import from RFinder"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Import"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr ""
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr ""
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr ""
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr ""
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr ""
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr ""
+
+#: ../chirpui/importdialog.py:575
+#, fuzzy
+msgid "Export To File"
+msgstr "Import from RFinder"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Export"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Untitled"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "CHIRP Radio Images"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "CHIRP Files"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "CSV Files"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "ICF Files"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "VX7 Commander Files"
+
+#: ../chirpui/mainapp.py:330
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "There was an error opening {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr ""
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Note:"
+
+#: ../chirpui/mainapp.py:395
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Don't show this again"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "{vendor} {model} image file"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Open recent file {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr ""
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr ""
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Discard Changes?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "File is modified, save changes before closing?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr ""
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Select Columns"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Visible columns for {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Reporting is disabled"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_File"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Recent"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Edit"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Cut"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Copy"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Paste"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Delete"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Move _Up"
+
+#: ../chirpui/mainapp.py:1184
+#, fuzzy
+msgid "Move Dow_n"
+msgstr "Move D_n"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "E_xchange"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "_View"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Columns"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Developer"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Show raw memory"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Diff raw memories"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Radio"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Download From Radio"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Upload To Radio"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Import from RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "CHIRP Native File"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "CSV File"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Import from RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+#, fuzzy
+msgid "Import from stock config"
+msgstr "Import from RepeaterBook"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Help"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Report statistics"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Hide Unused Fields"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Automatic Repeater Offset"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Enable Developer Functions"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Error reporting is enabled"
+
+#: ../chirpui/mainapp.py:1355
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr ""
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr ""
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr ""
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr ""
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr ""
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr ""
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr ""
+
+#: ../chirpui/clone.py:35
+#, fuzzy
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} image file"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr ""
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr ""
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr ""
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr ""
+
+#: ../chirpui/clone.py:138
+#, fuzzy
+msgid "Radio"
+msgstr "_Radio"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr ""
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr ""
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr ""
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr ""
+
+#: ../chirpui/editorset.py:87
+#, fuzzy
+msgid "Memories"
+msgstr "Diff raw memories"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr ""
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr ""
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr ""
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr ""
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr ""
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr ""
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr ""
+
+#: ../chirpui/editorset.py:248
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+
+#: ../chirpui/editorset.py:260
+#, fuzzy
+msgid "There was an error during import: {error}"
+msgstr "There was an error opening {fname}: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr ""
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+#, fuzzy
+msgid "There was an error during export: {error}"
+msgstr "There was an error opening {fname}: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr ""
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr ""
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr ""
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr ""
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr ""
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr ""
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr ""
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr ""
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr ""
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr ""
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr ""
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr ""
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr ""
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr ""
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr ""
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr ""
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr ""
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr ""
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr ""
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:361
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr ""
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr ""
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr ""
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr ""
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr ""
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr ""
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete"
+msgstr "_Delete"
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete all"
+msgstr "_Delete"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr ""
+
+#: ../chirpui/memedit.py:704
+#, fuzzy
+msgid "Move up"
+msgstr "Move _Up"
+
+#: ../chirpui/memedit.py:705
+#, fuzzy
+msgid "Move down"
+msgstr "Move D_n"
+
+#: ../chirpui/memedit.py:706
+#, fuzzy
+msgid "Exchange memories"
+msgstr "E_xchange"
+
+#: ../chirpui/memedit.py:707
+#, fuzzy
+msgid "Cut"
+msgstr "_Cut"
+
+#: ../chirpui/memedit.py:708
+#, fuzzy
+msgid "Copy"
+msgstr "_Copy"
+
+#: ../chirpui/memedit.py:709
+#, fuzzy
+msgid "Paste"
+msgstr "_Paste"
+
+#: ../chirpui/memedit.py:710
+#, fuzzy
+msgid "Show Raw Memory"
+msgstr "Show raw memory"
+
+#: ../chirpui/memedit.py:711
+#, fuzzy
+msgid "Diff Raw Memories"
+msgstr "Diff raw memories"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr ""
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr ""
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number"
+msgstr ""
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr ""
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr ""
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr ""
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr ""
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr ""
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr ""
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr ""
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr ""
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr ""
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr ""
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr ""
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr ""
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr ""
+
+#~ msgid "%i errors during open, check the debug log for details"
+#~ msgstr "%i errors during open, check the debug log for details"
diff --git a/locale/en_US/LC_MESSAGES/CHIRP.mo b/locale/en_US/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 46476c1..0000000
--- a/locale/en_US/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/es_ES.po b/locale/es_ES.po
new file mode 100644
index 0000000..20ca77d
--- /dev/null
+++ b/locale/es_ES.po
@@ -0,0 +1,946 @@
+# Spanish translations for CHIRP package.
+# Copyright (C) 2011 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dan@theine>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2016-03-28 02:44+0100\n"
+"Last-Translator: Alfonso Moratalla <alfonso.moratalla@gmail.com>\n"
+"Language-Team: \n"
+"Language: es_ES\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 1.5.4\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Completado"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "inactivo"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Recibiendo información del banco"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Poniendo nombre al banco"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Banco"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Nombre"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Actualizando índice del banco para memoria {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Actualizando información del banco para memoria {num}"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Obteniendo memoria {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Fijando índice para memoria {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Obteniendo banco para memoria {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Loc"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Frecuencia"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Índice"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Obteniendo información del banco para memoria {num}"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Obteniendo información del banco"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Ha ocurrido un error"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Sobreescribir"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "El fichero existe"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "El fichero {name} ya existe. ¿Quiere sobreescribirlo?"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+"La localización {number} ya ha sido importada. Elija otro valor para 'Nueva "
+"Localización' antes de seleccionar 'Importar'"
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Valor no válido. Debe ser un número entero."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "Localización {number} ya está siendo importada"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Actualizando listado URCALL"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Actualizando listado RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Fijando memoria {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Importando información del banco"
+
+#: ../chirpui/importdialog.py:264
+msgid "Error importing memories:"
+msgstr "Error importando memorias:"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Todos"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Ninguno"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Inverso"
+
+#: ../chirpui/importdialog.py:394
+msgid "Select"
+msgstr "Seleccionar"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Reverso"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Ajustar nueva localización"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Confirmar sobreescritura"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Opciones"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "No puede ser importado porque"
+
+#: ../chirpui/importdialog.py:513
+msgid "Import From File"
+msgstr "Importar desde fichero"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Importar"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "A"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "Desde"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Comentario"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "La localización de memoria será importada en"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Localización de la memoria en el fichero que está siendo importado"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Preparando lista de memoria..."
+
+#: ../chirpui/importdialog.py:575
+msgid "Export To File"
+msgstr "Exportar a fichero"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Exportar"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Sin nombre"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Imagenes de radio CHIRP"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "Ficheros CHIRP"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "Ficheros CSV"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "Ficheros ICF"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "Ficheros del VX7 Commander"
+
+#: ../chirpui/mainapp.py:330
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"Los ficheros ICF no se pueden editar, solo mostrarse o importarse en otro "
+"fichero. ¿Abrirlo en modo solo-lectura?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Hubo un error abriendo {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} errores mientras se abría:"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Nota:"
+
+#: ../chirpui/mainapp.py:395
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"El {vendor} {model} opera en <b>modo live</b>. Esto significa que cualquier "
+"cambio que haga es enviado inmediatamente a la radio. Por esto, no puede "
+"usar las operaciones <u>Guardar</u> o <u>Subir</u>. Si quiere editar el "
+"contenido offline, por favor <u>Exporte</u> a un fichero CSV, usando el menu "
+"<b>Archivo</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "No mostrar esto otra vez"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "fichero de imagen para {vendor} {model}"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Abrir fichero reciente {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Importar configuración por defecto {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Abrir configuración por defecto {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "¿Descartar cambios?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "El fichero ha sido modificado, ¿guardar los cambios antes de cerrarlo?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "Con contribuciones significativas de:"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Seleccionar columnas"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Columnas visibles para {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Informar está deshabilitado"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"La característica de informar de CHIRP está diseñada para ayudar a "
+"<u>mejorar la calidad</u> permitiendo a los autores centrarse en los drivers "
+"de las radios usadas mas frecuentemente y los errores que se experimentan "
+"los usuarios. Los informes no contienen información que identifique al "
+"usuario y solo son usadas para fines estadísticos por los autores. Su "
+"privacidad es extremadamente importante, pero <u>por favor considere dejar "
+"esta característica habilitada para ayudar a hacer CHIRP mejor</u>\n"
+"\n"
+"<b>¿Seguro que quiere deshabilitar esta caracteristica?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+"Elija un idioma o Auto para usar el de por defecto del sistema operativo. "
+"Tendrá que reiniciar la aplicación para que el cambio surta efecto."
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Fichero"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Abrir configuración por defecto"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Reciente"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Editar"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Cortar"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Copiar"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Pegar"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Borrar"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Subir"
+
+#: ../chirpui/mainapp.py:1184
+msgid "Move Dow_n"
+msgstr "Mover Abaj_o"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "I_ntercambio"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "_Ver"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Columnas"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Desarrollador"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Mostrar memoria raw"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Diferencias entre memorias raw"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Pestañas de diferencias"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Cambiar idioma"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Radio"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Descargar desde radio"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Subir a radio"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Importar desde RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "Fichero CHIRP nativo"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "Fichero CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Importar desde RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+msgid "Import from stock config"
+msgstr "Importar desde configuración por defecto"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Ayuda"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Enviar estadísticas"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Ocultar campos no usados"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Desplazamiento del repetidor automático"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Habilitar funciones de desarrollador"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Informar de errores está habilitado"
+
+#: ../chirpui/mainapp.py:1355
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr ""
+"Si quieres deshabilitar esta característica tiene que hacerlo en el menú "
+"<u>Ayuda</u>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Progreso del clonado"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Clonando"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Desplazamiento"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Moviendo {src} a {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Buscando un hueco libre({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "Movidas {count} memorias"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} en {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Detectar"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Puerto"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Proveedor"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Modelo"
+
+#: ../chirpui/clone.py:138
+msgid "Radio"
+msgstr "Radio"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "No se puede detectar radio en {port}"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Error interno: No se ha podido subir a {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Clonado fallido: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Indicativo"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Tu indicativo"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Indicativo del repetidor"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Mi indicativ"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Descargando lista URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Descargando lista RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Descargando lista MYCALL"
+
+#: ../chirpui/editorset.py:87
+msgid "Memories"
+msgstr "Memorias"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Nombres de los bancos"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Bancos"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "El {vendor} {model} tiene multiples sub-dispositivos independientes"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Elija uno desde el que importar:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Cancelado"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Error interno"
+
+#: ../chirpui/editorset.py:248
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+"Hubo errores mientras se abría {file}. ¡Las memorias afectadas no se podrán "
+"importar!"
+
+#: ../chirpui/editorset.py:260
+msgid "There was an error during import: {error}"
+msgstr "Hubo un error durante la importación: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Tipo de fichero no soportado"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+msgid "There was an error during export: {error}"
+msgstr "Hubo un error mientras se exportaba: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Priming memory"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Valor no válido para este campo"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Modo del tono"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Tono"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "ToneSql"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "Código DTCS"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Modo cruzado"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Desplazamiento"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Modo"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Potencia"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Escalón de sintonía"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Saltar"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Borrando memoria {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "No se pueden hacer cambios a este modelo"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Editando elemento nuevo, tomando valores por defecto"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Valor incorrecto para {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Error fijando memoria"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Escribiendo memoria {number}"
+
+#: ../chirpui/memedit.py:361
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Esta operación requiere mover los subsecuentes canales un hueco hasta "
+"encontrar una localización vacía. Esto puede tardar MUCHO tiempo. ¿Está "
+"seguro de hacerlo?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Añadiendo memoria {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Borrando memoria {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Obteniendo memoria {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Moviendo memoria de {old} a {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Memoria raw {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Obteniendo memoria raw {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "¡Solo puede ver diferencias entre dos memorias!"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Memoria {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Diferencia entre {a} y {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Las memorias deben ser continuas"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Insertar fila encima"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Insertar fila debajo"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete"
+msgstr "Borrar"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete all"
+msgstr "Borrar todo"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Borrar (y desplazar hacia arriba)"
+
+#: ../chirpui/memedit.py:704
+msgid "Move up"
+msgstr "Subir"
+
+#: ../chirpui/memedit.py:705
+msgid "Move down"
+msgstr "Bajar"
+
+#: ../chirpui/memedit.py:706
+msgid "Exchange memories"
+msgstr "Intercambiar memorias"
+
+#: ../chirpui/memedit.py:707
+msgid "Cut"
+msgstr "Cortar"
+
+#: ../chirpui/memedit.py:708
+msgid "Copy"
+msgstr "Copiar"
+
+#: ../chirpui/memedit.py:709
+msgid "Paste"
+msgstr "Pegar"
+
+#: ../chirpui/memedit.py:710
+msgid "Show Raw Memory"
+msgstr "Mostrar memoria raw"
+
+#: ../chirpui/memedit.py:711
+msgid "Diff Raw Memories"
+msgstr "Diferencias entre memorias raw"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Error interno: La columna {name} no se encuentra"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Obteniendo canal {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Error interno: límite {number} invalido"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Rango de memoria:"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Ir"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Canales especiales"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Mostrar vacíos"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Cortando memoria {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "¿Sobrescribir?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "¿Sobrescribir localización {number}?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Memoria incompatible"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr "Memoria {number} pegada no es compatible con esta radio porque:"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Código digital"
+
+#~ msgid "%i errors during open, check the debug log for details"
+#~ msgstr "%i errors during open, check the debug log for details"
diff --git a/locale/es_ES/LC_MESSAGES/CHIRP.mo b/locale/es_ES/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 761bee2..0000000
--- a/locale/es_ES/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/fr.po b/locale/fr.po
new file mode 100644
index 0000000..ae230d4
--- /dev/null
+++ b/locale/fr.po
@@ -0,0 +1,944 @@
+# French translations for CHIRP package.
+# Copyright (C) 2014 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <foo@bar.com>, 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2014-04-05 22:18+0100\n"
+"Last-Translator: Matthieu Lapadu-Hargues <mlhpub@free.fr>\n"
+"Language-Team: French\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Poedit 1.5.4\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Termine"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "Pret"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Recuperation des information de banque"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Donner un nom a la banque"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Banque"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Nom"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Mise a jour de l'index de banque pour la memoire {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Mise a jour des informations de banque pour la memoire {num}"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Lecture memoire {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Assigner son numero a la memoire {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Lecture de la banque pour la memoire {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Mem"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Frequence"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Index"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Lecture de l'information de banque pour la memoire {num}"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Lecture information de banque"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Une erreur s'est produite"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Ecraser"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Le fichier existe"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Le fichier {name} existe deja. Voulez-vous l'ecraser ?"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+"L'emplacement {number} a deja ete importe. Choisissez une autre valeur pour "
+"'nouvel emplacement' avant d'utiliser 'Importer'"
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Valeur invalide. Doit etre un entier."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "L'emplacement {number} a deja ete importe"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Mise a jour de la liste URCALL"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Mise a jour de la liste RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Regler la memoire {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Importation de l'information de banque"
+
+#: ../chirpui/importdialog.py:264
+msgid "Error importing memories:"
+msgstr "Erreur lors de l'importation des memoires :"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Tout"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Aucun"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Inverse"
+
+#: ../chirpui/importdialog.py:394
+msgid "Select"
+msgstr "Selectionner"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Reverse"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Ajuster nouvel emplacement"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Confirmer l'ecrasement"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Options"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "Ne peut pas etre importe car"
+
+#: ../chirpui/importdialog.py:513
+msgid "Import From File"
+msgstr "Importer depuis un fichier"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Importer"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "Vers"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "De"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Commentaire"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "L'emplacement memoire sera importe dans"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Emplacement memoire du fichier importe"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Preparation de la liste des memoires..."
+
+#: ../chirpui/importdialog.py:575
+msgid "Export To File"
+msgstr "Exporter vers un fichier"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Exporter"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Sans titre"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Images de radio CHIRP"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "Fichiers CHIRP"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "Fichiers CSV"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "Fichiers ICF"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "Fichiers VX7 Commander"
+
+#: ../chirpui/mainapp.py:330
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"Les fichiers ICF ne peuvent pas etre edites, uniquement affiches ou importes "
+"dans un autre fichier. Ouvrir en lecture seule ?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Une erreur s'est produite a l'ouverture de {fname} : {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} erreurs durant l'ouverture :"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Note :"
+
+#: ../chirpui/mainapp.py:395
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"Le {vendor} {model} fonctionne en <b>live mode</b>. Cela signifie que tous "
+"les changements que vous faites sont immediatement envoyes a la radio. Pour "
+"cette raison, vous ne pouvez pas utiliser les fonctions <u>Enregistrer</u> "
+"ou <u>Telecharger vers la radio</u>. Si vous souhaitez editer le contenu "
+"hors connexion, vous pouvez <u>Exporter</u> vers un fichier CSV, en "
+"utilisant le <b>menu Fichier</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Ne plus montrer"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "Fichier images {vendor} {model}"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Ouvrir le fichier recent {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Importer la base de donnees {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Ouvrir la base de donnees {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Annuler les changements ?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr ""
+"Le fichier a ete modifie, enregistrer les modifications avant de le fermer ?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "Avec les contributions significatives de :"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Selectionner les colonnes"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Colonnes visibles pour {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Rapport d'utilisation desactive"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"La fonction de rapport de CHIRP est concue pour <u>ameliorer</u> "
+"l'application en permettant aux auteurs de se concentrer sur les pilotes des "
+"radios les plus frequemment utilisees et les errreurs rencontrees par les "
+"utilisateurs. Les rapports ne contiennent aucune donnee d'identification et "
+"ne sont utilisee qu'a des fins statistiques par les auteurs. Votre vie "
+"privee est extremement importante, mais <u>considerez s'il vous plait que "
+"laisser cette fonction activee contribuera a rendre CHIRP encore meilleur !</"
+"u>\n"
+"\n"
+"<b>Etes-vous certain de vouloir desactiver cette fonction ?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+"Choisir une langue ou Auto pour utiliser celle du systeme par defaut. Vous "
+"devrez redemarrer l'application pour appliquer le changement."
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Fichier"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Ouvrir base de donnees"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Recent"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Editer"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Couper"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "C_opier"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "Co_ller"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Supprimer"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "_Monter"
+
+#: ../chirpui/mainapp.py:1184
+msgid "Move Dow_n"
+msgstr "Desce_ndre"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "_Permuter"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "_Voir"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Colonnes"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Developpeur"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Montrer les memoires brutes"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Comparaison memoires brutes"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Comparaison listes"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Changer la langue"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Radio"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Telecharger depuis la radio - Lire"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Telecharger vers la radio - Ecrire"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Importer de RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "Fichier CHIRP natif"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "Fichier CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Importer de RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+msgid "Import from stock config"
+msgstr "Importer de la base de donnees"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Aide"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Rapporter statistiques"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Cacher les champs inutilises"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Decalage automatique de relais ARS"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Activer les fonctions de developpement"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Le rapport d'erreur est active"
+
+#: ../chirpui/mainapp.py:1355
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Pour desactiver cette fonction, utilisez le menu <u>Aide</u>."
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Clonage en cours"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Clonage"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Annuler"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Decalage"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Deplacer {src} vers {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Recherche d'un emplacement libre ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "{count} memoires deplacees"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} sur {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Detecter"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Port"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Fabricant"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Modele"
+
+#: ../chirpui/clone.py:138
+msgid "Radio"
+msgstr "Radio"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Impossible de detecter la radio sur {port}"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Erreur interne : impossible de telecharger vers {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Erreur de clonage: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Indicatif"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Votre indicatif"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Indicatif du relais"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Mon indicatif"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Telechargement de la liste URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Telechargement de la liste RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Telechargement de la liste MYCALL"
+
+#: ../chirpui/editorset.py:87
+msgid "Memories"
+msgstr "Memoires"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Nom des banques"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Banques"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "Le {vendor} {model} a des sous-series multiples et independantes"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Selectionner importation depuis : "
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Annule"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Erreur interne"
+
+#: ../chirpui/editorset.py:248
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+"Erreurs a l'ouverture de {file}. Les memoires ne peuvent pas etre "
+"importees ! "
+
+#: ../chirpui/editorset.py:260
+msgid "There was an error during import: {error}"
+msgstr "Une erreur s'est produite durant l'importation : {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Type de fichier non-supporte"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+msgid "There was an error during export: {error}"
+msgstr "Une erreur s'est produite durant l'exportation : {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Memoire d'amorcage"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Valeur invalide pour ce champ"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Tone Mode"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Tone"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "ToneSql"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "Code DTCS"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Cross mode"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Decalage"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Mode"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Puissance"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Pas"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Ignorer"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Effacer la memoire {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Impossible de realiser des changements pour ce modele"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Modification nouvel element, valeurs par defaut"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Valeur invalide pour {col} : {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Erreur ecriture memoire"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Ecrire la memoire {number}"
+
+#: ../chirpui/memedit.py:361
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Cette operation necessite le deplacement de tous les canaux suivants jusqu'a "
+"ce qu'un emplacement libre soit trouve. Cela peut prendre BEAUCOUP de temps. "
+"Etes-vous certain de vouloir le faire ?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Ajouter la memoire {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Effacer la memoire {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Lecture memoire {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Deplacer la memoire de {old} vers {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Memoire brute {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Lecture memoire brute {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "Vous ne pouvez comparer que deux memoires !"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Memoire {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Comparaison entre {a} et {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Les memoires doivent etre contigues"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Inserer une ligne avant"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Inserer une ligne apres"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete"
+msgstr "Supprimer"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete all"
+msgstr "Tout supprimer"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Supprimer (et remonter)"
+
+#: ../chirpui/memedit.py:704
+msgid "Move up"
+msgstr "Remonter"
+
+#: ../chirpui/memedit.py:705
+msgid "Move down"
+msgstr "Descendre"
+
+#: ../chirpui/memedit.py:706
+msgid "Exchange memories"
+msgstr "Permuter les memoires"
+
+#: ../chirpui/memedit.py:707
+msgid "Cut"
+msgstr "Couper"
+
+#: ../chirpui/memedit.py:708
+msgid "Copy"
+msgstr "Copier"
+
+#: ../chirpui/memedit.py:709
+msgid "Paste"
+msgstr "Coller"
+
+#: ../chirpui/memedit.py:710
+msgid "Show Raw Memory"
+msgstr "Afficher les donnees de memoires brutes"
+
+#: ../chirpui/memedit.py:711
+msgid "Diff Raw Memories"
+msgstr "Comparaison memoires brutes"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Erreur interne : colonne {name} non trouvee"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Lecture canal {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Erreur interne : {number} limite invalide"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Etendue memoire :"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Aller"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Canaux speciaux"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Montrer vides"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Couper la memoire {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Ecraser ?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Ecraser l'emplacement {number} ?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Memoire incompatible"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr "La memoire collee {number} n'est pas compatible avec cette radio car :"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Digital code"
diff --git a/locale/fr/LC_MESSAGES/CHIRP.mo b/locale/fr/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 981fc11..0000000
--- a/locale/fr/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/hu.po b/locale/hu.po
new file mode 100644
index 0000000..20f9a9b
--- /dev/null
+++ b/locale/hu.po
@@ -0,0 +1,1216 @@
+# English translations for CHIRP package.
+# Copyright (C) 2011 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dan@theine>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-10-08 11:40-0700\n"
+"PO-Revision-Date: 2015-01-28 13:47+0100\n"
+"Last-Translator: Attila Joubert <joubert.attila@gmail.com>\n"
+"Language-Team: English\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 1.7.4\n"
+"Language: hu_HU\n"
+
+#: ../chirpui/bandplans.py:92
+msgid ""
+"Band plans define default channel settings for frequencies in a region. "
+"Choose a band plan or None for completely manual channel settings."
+msgstr ""
+"Egy régió sávtervének alapértelmezett csatorna frekvenciái. Válassz egy "
+"sávtervet, vagy ki is hagyhatod a kézi csatorna beállítás befejezéséhez."
+
+#: ../chirpui/bankedit.py:53
+#, python-format
+msgid "Retrieving %s information"
+msgstr "%s információk lekérése"
+
+#: ../chirpui/bankedit.py:76
+#, python-format
+msgid "Setting name on %s"
+msgstr "A %s név beállítása"
+
+#: ../chirpui/bankedit.py:88 ../chirpui/bankedit.py:276
+#: ../chirpui/importdialog.py:594 ../chirpui/memdetail.py:257
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:87 ../chirpui/memedit.py:338
+#: ../chirpui/memedit.py:1053 ../chirpui/memedit.py:1109
+#: ../chirpui/memedit.py:1245 ../chirpui/memedit.py:1247
+msgid "Name"
+msgstr "Név"
+
+#: ../chirpui/bankedit.py:215
+msgid "Updating {type} index for memory {num}"
+msgstr "A {num}. memória {type} index frissítése"
+
+#: ../chirpui/bankedit.py:225
+msgid "Updating mapping information for memory {num}"
+msgstr "A {num}. memória információjának frissítése"
+
+#: ../chirpui/bankedit.py:231 ../chirpui/bankedit.py:262
+msgid "Getting memory {num}"
+msgstr "A {num}. memória beolvasása"
+
+#: ../chirpui/bankedit.py:246
+msgid "Setting index for memory {num}"
+msgstr "A {num}. memória sorszámának beállítása"
+
+#: ../chirpui/bankedit.py:255
+msgid "Getting {type} for memory {num}"
+msgstr "A {num}. memória {type} beolvasása"
+
+#: ../chirpui/bankedit.py:274 ../chirpui/memedit.py:64
+#: ../chirpui/memedit.py:194 ../chirpui/memedit.py:337
+#: ../chirpui/memedit.py:412 ../chirpui/memedit.py:432
+#: ../chirpui/memedit.py:446 ../chirpui/memedit.py:469
+#: ../chirpui/memedit.py:517 ../chirpui/memedit.py:529
+#: ../chirpui/memedit.py:553 ../chirpui/memedit.py:555
+#: ../chirpui/memedit.py:628 ../chirpui/memedit.py:642
+#: ../chirpui/memedit.py:644 ../chirpui/memedit.py:685
+#: ../chirpui/memedit.py:687 ../chirpui/memedit.py:760
+#: ../chirpui/memedit.py:889 ../chirpui/memedit.py:1002
+#: ../chirpui/memedit.py:1051 ../chirpui/memedit.py:1077
+#: ../chirpui/memedit.py:1090 ../chirpui/memedit.py:1107
+#: ../chirpui/memedit.py:1421
+msgid "Loc"
+msgstr "Hely"
+
+#: ../chirpui/bankedit.py:275 ../chirpui/importdialog.py:595
+#: ../chirpui/memdetail.py:256 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:88 ../chirpui/memedit.py:209
+#: ../chirpui/memedit.py:331 ../chirpui/memedit.py:339
+#: ../chirpui/memedit.py:368 ../chirpui/memedit.py:393
+#: ../chirpui/memedit.py:401 ../chirpui/memedit.py:1054
+#: ../chirpui/memedit.py:1106
+msgid "Frequency"
+msgstr "Frekvencia"
+
+#: ../chirpui/bankedit.py:277
+msgid "Index"
+msgstr "Sorszám"
+
+#: ../chirpui/bankedit.py:370
+msgid "Getting {type} information for memory {num}"
+msgstr "A {num}. memória {type} adatainak beolvasása"
+
+#: ../chirpui/bankedit.py:392
+#, python-format
+msgid "Getting %s information"
+msgstr "%s információk beolvasása"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} a {port} porton"
+
+#: ../chirpui/clone.py:105 ../chirpui/clone.py:106 ../chirpui/clone.py:168
+msgid "Detect"
+msgstr "Érzékelés"
+
+#: ../chirpui/clone.py:129
+msgid "Port"
+msgstr "Port"
+
+#: ../chirpui/clone.py:130
+msgid "Vendor"
+msgstr "Gyártó"
+
+#: ../chirpui/clone.py:131
+msgid "Model"
+msgstr "Modell"
+
+#: ../chirpui/clone.py:144
+msgid "Radio"
+msgstr "Rádió"
+
+#: ../chirpui/clone.py:172
+msgid "Unable to detect radio on {port}"
+msgstr "Nem érzékelek a {port} porton!"
+
+#: ../chirpui/clone.py:184
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Belső hiba: nem tölthető fel a {model} rádióra."
+
+#: ../chirpui/clone.py:232
+msgid "Clone failed: {error}"
+msgstr "A klónozás sikertelen: {error}"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Klónozási folyamat"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Klónozás"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Megszakítás"
+
+#: ../chirpui/common.py:240
+msgid "Completed"
+msgstr "Befejeződött"
+
+#: ../chirpui/common.py:241
+msgid "idle"
+msgstr "várakozik"
+
+#: ../chirpui/common.py:341
+msgid "Details"
+msgstr "Részletek"
+
+#: ../chirpui/common.py:344
+msgid "Proceed?"
+msgstr "Folytatod?"
+
+#: ../chirpui/common.py:353
+msgid "Do not show this next time"
+msgstr "Mégegyszer ne mutassa ezt"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Hívójel"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Az Ön hívójele"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Az átjátszó hívójele"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Az én hívójelem"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1566
+msgid "Downloading URCALL list"
+msgstr "Az URCALL lista letöltése"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1578
+msgid "Downloading RPTCALL list"
+msgstr "Az RPTCALL lista letöltése"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "A MYCALL lista letöltése"
+
+#: ../chirpui/editorset.py:79
+#, python-format
+msgid "Memories (%(variant)s)"
+msgstr "Memória (%(variant)s)"
+
+#: ../chirpui/editorset.py:83
+msgid "Memories"
+msgstr "Memória"
+
+#: ../chirpui/editorset.py:94
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:142
+msgid "Settings"
+msgstr "Beállítás"
+
+#: ../chirpui/editorset.py:151
+msgid "Browser"
+msgstr "Böngésző"
+
+#: ../chirpui/editorset.py:262
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "A {vendor} {model} több független altípussal rendelkezik"
+
+#: ../chirpui/editorset.py:265
+msgid "Choose one to import from:"
+msgstr "Válasszon egy importálandót:"
+
+#: ../chirpui/editorset.py:270
+msgid "Cancelled"
+msgstr "Mekszakítva"
+
+#: ../chirpui/editorset.py:275
+msgid "Internal Error"
+msgstr "Belső hiba"
+
+#: ../chirpui/editorset.py:314
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+"Hiba történt a {file} fájl megnyitásakor. Az érintett memóriák nem lesznek "
+"importálhatók."
+
+#: ../chirpui/editorset.py:326
+msgid "There was an error during import: {error}"
+msgstr "Hiba történt az importáláskor: {error}"
+
+#: ../chirpui/editorset.py:336
+msgid "Unsupported file type"
+msgstr "Nem támogatott fájltípus"
+
+#: ../chirpui/editorset.py:352 ../chirpui/editorset.py:367
+msgid "There was an error during export: {error}"
+msgstr "Hiba a(z) {fname} exportálásakor: {error}"
+
+#: ../chirpui/editorset.py:381
+msgid "Priming memory"
+msgstr "Memória feltöltés"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+"A(z) {number}. hely már importálva van. 'Új hely'-nek válasszon másik "
+"értéket, mielőtt az 'importálást' választja!"
+
+#: ../chirpui/importdialog.py:123
+msgid "Invalid value. Must be an integer."
+msgstr "Érvénytelen érték! Egész szám kell legyen."
+
+#: ../chirpui/importdialog.py:132
+msgid "Location {number} is already being imported"
+msgstr "A {number} sorszámú hely már importálva van."
+
+#: ../chirpui/importdialog.py:192
+msgid "Updating URCALL list"
+msgstr "URCALL lista frissítése."
+
+#: ../chirpui/importdialog.py:197
+msgid "Updating RPTCALL list"
+msgstr "RPTCALL lista frissítése"
+
+#: ../chirpui/importdialog.py:270
+msgid "Setting memory {number}"
+msgstr "A {number} memória beállítása"
+
+#: ../chirpui/importdialog.py:274
+msgid "Importing bank information"
+msgstr "Bank információk importálása"
+
+#: ../chirpui/importdialog.py:278
+msgid "Error importing memories:"
+msgstr "Hiba a memória importálásakor:"
+
+#: ../chirpui/importdialog.py:390
+msgid "All"
+msgstr "Mind"
+
+#: ../chirpui/importdialog.py:396
+msgid "None"
+msgstr "Egyik sem"
+
+#: ../chirpui/importdialog.py:402
+msgid "Inverse"
+msgstr "Ellenkező"
+
+#: ../chirpui/importdialog.py:408
+msgid "Select"
+msgstr "Kiválasztás"
+
+#: ../chirpui/importdialog.py:454
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:460
+msgid "Reverse"
+msgstr "Fordított"
+
+#: ../chirpui/importdialog.py:466
+msgid "Adjust New Location"
+msgstr "Új hely megadása"
+
+#: ../chirpui/importdialog.py:476
+msgid "Confirm overwrites"
+msgstr "Felülírás jóváhagyása"
+
+#: ../chirpui/importdialog.py:482
+msgid "Options"
+msgstr "Beállítások"
+
+#: ../chirpui/importdialog.py:553
+msgid "Cannot be imported because"
+msgstr "Nem importálható, mert"
+
+#: ../chirpui/importdialog.py:571
+msgid "Import From File"
+msgstr "Importálás fájlból"
+
+#: ../chirpui/importdialog.py:572 ../chirpui/mainapp.py:1515
+msgid "Import"
+msgstr "Importálás"
+
+#: ../chirpui/importdialog.py:592
+msgid "To"
+msgstr "-ig"
+
+#: ../chirpui/importdialog.py:593
+msgid "From"
+msgstr "Forrás"
+
+#: ../chirpui/importdialog.py:596 ../chirpui/memdetail.py:274
+#: ../chirpui/memedit.py:80 ../chirpui/memedit.py:102
+#: ../chirpui/memedit.py:1068 ../chirpui/memedit.py:1124
+#: ../chirpui/memedit.py:1250
+msgid "Comment"
+msgstr "Megjegyzés"
+
+#: ../chirpui/importdialog.py:600
+msgid "Location memory will be imported into"
+msgstr "Memória helye lesz beimportálva"
+
+#: ../chirpui/importdialog.py:601
+msgid "Location of memory in the file being imported"
+msgstr "Memória hely a fájlba importálva"
+
+#: ../chirpui/importdialog.py:624
+msgid "Preparing memory list..."
+msgstr "Memória lista előkészítés..."
+
+#: ../chirpui/importdialog.py:633
+msgid "Export To File"
+msgstr "Export fájlba"
+
+#: ../chirpui/importdialog.py:634 ../chirpui/mainapp.py:1516
+msgid "Export"
+msgstr "Export"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Hiba történt"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Felülírás"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "A fájl már létezik"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "A {name} nevű fájl már létezik. Felül akarja írni?"
+
+#: ../chirpui/mainapp.py:227 ../chirpui/mainapp.py:428
+msgid "Untitled"
+msgstr "Névtelen"
+
+#: ../chirpui/mainapp.py:274 ../chirpui/mainapp.py:734
+msgid "CHIRP Radio Images"
+msgstr "CHIRP Radio adatképek"
+
+#: ../chirpui/mainapp.py:275 ../chirpui/mainapp.py:733
+#: ../chirpui/mainapp.py:1115
+msgid "CHIRP Files"
+msgstr "CHIRP fájlok"
+
+#: ../chirpui/mainapp.py:276 ../chirpui/mainapp.py:735
+#: ../chirpui/mainapp.py:1114
+msgid "CSV Files"
+msgstr "CSV fájlok"
+
+#: ../chirpui/mainapp.py:277 ../chirpui/mainapp.py:736
+msgid "EVE Files (VX5)"
+msgstr "EVE fájl (VX5)"
+
+#: ../chirpui/mainapp.py:278 ../chirpui/mainapp.py:737
+msgid "ICF Files"
+msgstr "ICF fájlok"
+
+#: ../chirpui/mainapp.py:279 ../chirpui/mainapp.py:741
+msgid "VX5 Commander Files"
+msgstr "VX5 Commander fájlok"
+
+#: ../chirpui/mainapp.py:280 ../chirpui/mainapp.py:742
+msgid "VX6 Commander Files"
+msgstr "VX6 Commander fájlok"
+
+#: ../chirpui/mainapp.py:281 ../chirpui/mainapp.py:743
+msgid "VX7 Commander Files"
+msgstr "VX7 Commander fájlok"
+
+#: ../chirpui/mainapp.py:291
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"Az ICF fájlok nem szerkeszthetők, csak megnézhetők, vagy másik fájlba "
+"importálhatók. Megnyissam olvashatóként?"
+
+#: ../chirpui/mainapp.py:325
+msgid "There was an error opening {fname}: {error}"
+msgstr "A(z) {fname} nevű fájl megnyitásakor fellépő hiba: {error}"
+
+#: ../chirpui/mainapp.py:337
+msgid "{num} errors during open:"
+msgstr "{num} hiba a megnyitás során:"
+
+#: ../chirpui/mainapp.py:344
+msgid "Note:"
+msgstr "Megjegyzés:"
+
+#: ../chirpui/mainapp.py:345
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"A {vendor} {model} <b>közvetlen kapcsolatban</b> működik. Ez azt jelenti, "
+"hogy minden elvégzett módosítás azonnal a rádióra töltődik. Emiatt Ön nem "
+"választhatja a <u>Mentés</u> vagy <u>Feltöltés</u> műveleteket. Ha Ön "
+"kapcsolat nélkül akarja a tartalmat szerkeszteni, kérem válassza az CSV-be "
+"<u>exportálást</u> a <b>Fájl menüben</b>!"
+
+#: ../chirpui/mainapp.py:354
+msgid "Don't show this again"
+msgstr "Mégegyszer ne mutassa"
+
+#: ../chirpui/mainapp.py:388
+msgid "{vendor} {model} image file"
+msgstr "{vendor} {model} képfájl"
+
+#: ../chirpui/mainapp.py:396
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:398
+msgid "VX6 Commander"
+msgstr "VX6 Commander"
+
+#: ../chirpui/mainapp.py:400
+msgid "EVE"
+msgstr "EVE"
+
+#: ../chirpui/mainapp.py:401
+msgid "VX5 Commander"
+msgstr "VX5 Commander"
+
+#: ../chirpui/mainapp.py:467
+msgid "Open recent file {name}"
+msgstr "A legutóbbi {name} fájl megnyitása"
+
+#: ../chirpui/mainapp.py:528
+msgid "Import stock configuration {name}"
+msgstr "A(z) {name} konfigurációs készlet beolvasása"
+
+#: ../chirpui/mainapp.py:544
+msgid "Open stock configuration {name}"
+msgstr "A(z) {name} konfigurációs készlet megnyitása"
+
+#: ../chirpui/mainapp.py:566
+msgid "Proceed with experimental driver?"
+msgstr "Folytassam kísérleti driver-rel?"
+
+#: ../chirpui/mainapp.py:568
+msgid "This radio's driver is experimental. Do you want to proceed?"
+msgstr "A rádió driver-e kísérleti. Folytatni akarod?"
+
+#: ../chirpui/mainapp.py:586
+msgid "{name} Instructions"
+msgstr "{name} Utasítások"
+
+#: ../chirpui/mainapp.py:588
+msgid "{instructions}"
+msgstr "{instructions}"
+
+#: ../chirpui/mainapp.py:591
+msgid "Don't show instructions for any radio again"
+msgstr "Mégegyszer ne mutasson utasításokat egy rádióhoz sem"
+
+#: ../chirpui/mainapp.py:700
+msgid "Save Changes?"
+msgstr "Menti a változásokat?"
+
+#: ../chirpui/mainapp.py:705
+msgid "File is modified, save changes before closing?"
+msgstr "A fájl megváltozott! Menti bezárás előtt?"
+
+#: ../chirpui/mainapp.py:738
+msgid "Kenwood HMK Files"
+msgstr "Kenwood HMK fájlok"
+
+#: ../chirpui/mainapp.py:739
+msgid "Kenwood ITM Files"
+msgstr "Kenwood ITM fájlok"
+
+#: ../chirpui/mainapp.py:740
+msgid "Travel Plus Files"
+msgstr "Travel Plus fájlok"
+
+#: ../chirpui/mainapp.py:805
+msgid "RepeaterBook Query"
+msgstr "RepeaterBook lekérdezés"
+
+#: ../chirpui/mainapp.py:864
+msgid "RepeaterBook query failed"
+msgstr "RepeaterBook lekérdezés hiba"
+
+#: ../chirpui/mainapp.py:934
+#, python-format
+msgid "Invalid value for %s"
+msgstr "Érvénytelen %s mezőérték"
+
+#: ../chirpui/mainapp.py:958
+msgid "Query failed"
+msgstr "Lekérdezés hiba"
+
+#: ../chirpui/mainapp.py:1055
+msgid "RadioReference.com Query"
+msgstr "RadioReference.com lekérdezés"
+
+#: ../chirpui/mainapp.py:1158
+msgid "With significant contributions from:"
+msgstr "Jelentősen hozzájárultak:"
+
+#: ../chirpui/mainapp.py:1185
+msgid "CHIRP Documentation"
+msgstr "CHIRP dokumentáció"
+
+#: ../chirpui/mainapp.py:1186
+msgid ""
+"Documentation for CHIRP, including FAQs, and help for common problems is "
+"available on the CHIRP web site, please go to\n"
+"\n"
+"<a href=\"http://chirp.danplanet.com/projects/chirp/wiki/Documentation"
+"\">http://chirp.danplanet.com/projects/chirp/wiki/Documentation</a>\n"
+msgstr ""
+"A leggyakoribb problémákhoz, GYIK-et is magába foglaló CHIRP dokumentáció és "
+"súgó a CHIRP honlapján érhető el, kérlek látogass oda!\n"
+"\n"
+"<a href=\"http://chirp.danplanet.com/projects/chirp/wiki/Documentation"
+"\">http://chirp.danplanet.com/projects/chirp/wiki/Documentation</a>\n"
+
+#: ../chirpui/mainapp.py:1202
+msgid "Select Columns"
+msgstr "Oszlopok kiválasztása"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Visible columns for {radio}"
+msgstr "A(z) {radio} látható oszlopai"
+
+#: ../chirpui/mainapp.py:1280
+msgid "Reporting is disabled"
+msgstr "Listázás letiltva"
+
+#: ../chirpui/mainapp.py:1281
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"A CHIRP jelentéskészítője a <u>minőség növelésére</u> került beépítése "
+"lehetővé téve a program fejlesztőinek, hogy a leggyakoribb rádió driver-ekre "
+"és a felhasználók által tapasztalt hibákra figyeljenek. A jelentések "
+"semmiféle személyes információt nem tartalmaznak és a programozók által, "
+"kizárólag statisztikai céllal kerülnek felhasználásra. Az Ön adatainak "
+"védelme rendkívül fontos, <u>mi mégis kérjük, engedélyezze a jelentések "
+"készítését, hogy a CHIRP egyre jobb legyen!</u>\n"
+"\n"
+"<b>Biztosan letiltja ezt a lehetőséget?</b>"
+
+#: ../chirpui/mainapp.py:1315
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+"Válasszon egy nyelvet, vagy bízza az automatikus nyelvfelismerést az "
+"Operációs rendszerből. Ahhoz, hogy a beállítás érvényre jusson, indítsa újra "
+"az CHIRP-et! "
+
+#: ../chirpui/mainapp.py:1328
+msgid "Python Modules"
+msgstr "Python modulok"
+
+#: ../chirpui/mainapp.py:1487
+msgid "_File"
+msgstr "_Fájl"
+
+#: ../chirpui/mainapp.py:1490
+msgid "Open stock config"
+msgstr "A csoportos beállítás megnyitása"
+
+#: ../chirpui/mainapp.py:1491
+msgid "_Recent"
+msgstr "Leg_utóbbi"
+
+#: ../chirpui/mainapp.py:1494
+msgid "Load Module"
+msgstr "Modul betöltése"
+
+#: ../chirpui/mainapp.py:1497
+msgid "_Edit"
+msgstr "Sz_erkesztés"
+
+#: ../chirpui/mainapp.py:1498
+msgid "_Cut"
+msgstr "_Kivágás"
+
+#: ../chirpui/mainapp.py:1499
+msgid "_Copy"
+msgstr "_Másolás"
+
+#: ../chirpui/mainapp.py:1500
+msgid "_Paste"
+msgstr "_Beillesztés"
+
+#: ../chirpui/mainapp.py:1501
+msgid "_Delete"
+msgstr "_Törlés"
+
+#: ../chirpui/mainapp.py:1502
+msgid "Move _Up"
+msgstr "Fe_lfelé"
+
+#: ../chirpui/mainapp.py:1503
+msgid "Move Dow_n"
+msgstr "Lefel_é"
+
+#: ../chirpui/mainapp.py:1504
+msgid "E_xchange"
+msgstr "Cse_re"
+
+#: ../chirpui/mainapp.py:1505
+msgid "_View"
+msgstr "Né_zet"
+
+#: ../chirpui/mainapp.py:1506
+msgid "Columns"
+msgstr "Oszlopok"
+
+#: ../chirpui/mainapp.py:1507
+msgid "Developer"
+msgstr "Fejlesztői"
+
+#: ../chirpui/mainapp.py:1508
+msgid "Show raw memory"
+msgstr "memóriasor mutatása"
+
+#: ../chirpui/mainapp.py:1509
+msgid "Diff raw memories"
+msgstr "Memóriasorok különbsége"
+
+#: ../chirpui/mainapp.py:1510
+msgid "Diff tabs"
+msgstr "Diff tabs"
+
+#: ../chirpui/mainapp.py:1511
+msgid "Change language"
+msgstr "Nyelv választás"
+
+#: ../chirpui/mainapp.py:1512
+msgid "_Radio"
+msgstr "Rá_dió"
+
+#: ../chirpui/mainapp.py:1513
+msgid "Download From Radio"
+msgstr "Letöltés a rádióról"
+
+#: ../chirpui/mainapp.py:1514
+msgid "Upload To Radio"
+msgstr "Feltöltés a rádióra"
+
+#: ../chirpui/mainapp.py:1517
+msgid "Import from data source"
+msgstr "Importálás adatforrásból"
+
+#: ../chirpui/mainapp.py:1518 ../chirpui/mainapp.py:1523
+msgid "RadioReference.com"
+msgstr "RadioReference.com"
+
+#: ../chirpui/mainapp.py:1519 ../chirpui/mainapp.py:1524
+msgid "RFinder"
+msgstr "RFinder"
+
+#: ../chirpui/mainapp.py:1520 ../chirpui/mainapp.py:1526
+msgid "RepeaterBook"
+msgstr "RepeaterBook"
+
+#: ../chirpui/mainapp.py:1521 ../chirpui/mainapp.py:1525
+msgid "przemienniki.net"
+msgstr "przemienniki.net"
+
+#: ../chirpui/mainapp.py:1522
+msgid "Query data source"
+msgstr "Lekérd. adatforrása"
+
+#: ../chirpui/mainapp.py:1527
+msgid "CHIRP Native File"
+msgstr "CHIRP natív fájl"
+
+#: ../chirpui/mainapp.py:1528
+msgid "CSV File"
+msgstr "CSV fájl"
+
+#: ../chirpui/mainapp.py:1529
+msgid "Import from stock config"
+msgstr "Importálás a csoportos beállításokból"
+
+#: ../chirpui/mainapp.py:1530
+msgid "Channel defaults"
+msgstr "Csatorna alapértékek"
+
+#: ../chirpui/mainapp.py:1532
+msgid "Help"
+msgstr "Súgó"
+
+#: ../chirpui/mainapp.py:1534
+msgid "Documentation"
+msgstr "Dokumentáció"
+
+#: ../chirpui/mainapp.py:1544
+msgid "Report statistics"
+msgstr "Statisztikai lista"
+
+#: ../chirpui/mainapp.py:1545
+msgid "Hide Unused Fields"
+msgstr "A nemhasznált mezők elrejtése"
+
+#: ../chirpui/mainapp.py:1546
+msgid "Smart Tone Modes"
+msgstr "Hang (CTCSS) mód"
+
+#: ../chirpui/mainapp.py:1547
+msgid "Enable Developer Functions"
+msgstr "Fejlesztői funkciók engedélyezése"
+
+#: ../chirpui/mainapp.py:1657
+msgid "A new version of CHIRP is available: "
+msgstr "A CHIRP egy új verziója érhető el:"
+
+#: ../chirpui/mainapp.py:1756
+msgid "Error reporting is enabled"
+msgstr "A hibajelentés engedélyezett"
+
+#: ../chirpui/mainapp.py:1759
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Ha Ön ezt a lehetőséget le kívánja tiltani, a <u>Súgóban</> megteheti"
+
+#: ../chirpui/memdetail.py:239
+msgid "Edit Memory #{num}"
+msgstr "A(z) #{num} memória"
+
+#: ../chirpui/memdetail.py:258 ../chirpui/memedit.py:67
+#: ../chirpui/memedit.py:100 ../chirpui/memedit.py:115
+#: ../chirpui/memedit.py:230 ../chirpui/memedit.py:236
+#: ../chirpui/memedit.py:269 ../chirpui/memedit.py:409
+#: ../chirpui/memedit.py:1055 ../chirpui/memedit.py:1115
+#: ../chirpui/memedit.py:1251 ../chirpui/memedit.py:1311
+msgid "Tone Mode"
+msgstr "Hang (CTCSS) mód"
+
+#: ../chirpui/memdetail.py:259 ../chirpui/memedit.py:68
+#: ../chirpui/memedit.py:89 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:165 ../chirpui/memedit.py:166
+#: ../chirpui/memedit.py:254 ../chirpui/memedit.py:284
+#: ../chirpui/memedit.py:291 ../chirpui/memedit.py:296
+#: ../chirpui/memedit.py:304 ../chirpui/memedit.py:342
+#: ../chirpui/memedit.py:407 ../chirpui/memedit.py:1056
+#: ../chirpui/memedit.py:1111 ../chirpui/memedit.py:1252
+msgid "Tone"
+msgstr "CTCSS"
+
+#: ../chirpui/memdetail.py:260 ../chirpui/memedit.py:69
+#: ../chirpui/memedit.py:90 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:258 ../chirpui/memedit.py:277
+#: ../chirpui/memedit.py:292 ../chirpui/memedit.py:297
+#: ../chirpui/memedit.py:308 ../chirpui/memedit.py:343
+#: ../chirpui/memedit.py:407 ../chirpui/memedit.py:1057
+#: ../chirpui/memedit.py:1112 ../chirpui/memedit.py:1248
+msgid "ToneSql"
+msgstr "ToneSql"
+
+#: ../chirpui/memdetail.py:261 ../chirpui/memedit.py:70
+#: ../chirpui/memedit.py:91 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:242 ../chirpui/memedit.py:278
+#: ../chirpui/memedit.py:286 ../chirpui/memedit.py:298
+#: ../chirpui/memedit.py:306 ../chirpui/memedit.py:344
+#: ../chirpui/memedit.py:403 ../chirpui/memedit.py:1058
+#: ../chirpui/memedit.py:1113 ../chirpui/memedit.py:1240
+#: ../chirpui/memedit.py:1317
+msgid "DTCS Code"
+msgstr "DTCS kód"
+
+#: ../chirpui/memdetail.py:263 ../chirpui/memedit.py:72
+#: ../chirpui/memedit.py:93 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:280
+#: ../chirpui/memedit.py:288 ../chirpui/memedit.py:300
+#: ../chirpui/memedit.py:312 ../chirpui/memedit.py:346
+#: ../chirpui/memedit.py:1060 ../chirpui/memedit.py:1117
+#: ../chirpui/memedit.py:1242 ../chirpui/memedit.py:1316
+msgid "DTCS Pol"
+msgstr "DTCS pol."
+
+#: ../chirpui/memdetail.py:264
+msgid "Cross mode"
+msgstr "Kereszt-üzem"
+
+#: ../chirpui/memdetail.py:267 ../chirpui/memedit.py:74
+#: ../chirpui/memedit.py:95 ../chirpui/memedit.py:113
+#: ../chirpui/memedit.py:139 ../chirpui/memedit.py:146
+#: ../chirpui/memedit.py:270 ../chirpui/memedit.py:340
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:1062
+#: ../chirpui/memedit.py:1118 ../chirpui/memedit.py:1253
+#: ../chirpui/memedit.py:1323
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memdetail.py:268 ../chirpui/memedit.py:75
+#: ../chirpui/memedit.py:96 ../chirpui/memedit.py:144
+#: ../chirpui/memedit.py:217 ../chirpui/memedit.py:315
+#: ../chirpui/memedit.py:341 ../chirpui/memedit.py:405
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1119
+#: ../chirpui/memedit.py:1244
+msgid "Offset"
+msgstr "Offszet"
+
+#: ../chirpui/memdetail.py:269 ../chirpui/memedit.py:76
+#: ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:158 ../chirpui/memedit.py:159
+#: ../chirpui/memedit.py:162 ../chirpui/memedit.py:393
+#: ../chirpui/memedit.py:1064 ../chirpui/memedit.py:1120
+#: ../chirpui/memedit.py:1243 ../chirpui/memedit.py:1310
+#: ../chirpui/memedit.py:1325 ../chirpui/memedit.py:1326
+#: ../chirpui/memedit.py:1490 ../chirpui/memedit.py:1508
+#: ../chirpui/memedit.py:1518
+msgid "Mode"
+msgstr "Mód"
+
+#: ../chirpui/memdetail.py:270 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:114
+#: ../chirpui/memedit.py:149 ../chirpui/memedit.py:150
+#: ../chirpui/memedit.py:155 ../chirpui/memedit.py:1066
+#: ../chirpui/memedit.py:1122 ../chirpui/memedit.py:1246
+msgid "Tune Step"
+msgstr "Lépésköz"
+
+#: ../chirpui/memdetail.py:273 ../chirpui/memedit.py:79
+#: ../chirpui/memedit.py:101 ../chirpui/memedit.py:1067
+#: ../chirpui/memedit.py:1123 ../chirpui/memedit.py:1254
+#: ../chirpui/memedit.py:1313
+msgid "Skip"
+msgstr "Ugrás"
+
+#: ../chirpui/memdetail.py:281
+msgid "RX DTCS Code"
+msgstr "RX DTCS kód"
+
+#: ../chirpui/memdetail.py:287 ../chirpui/memedit.py:77
+#: ../chirpui/memedit.py:98 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:393 ../chirpui/memedit.py:1065
+#: ../chirpui/memedit.py:1121 ../chirpui/memedit.py:1255
+#: ../chirpui/memedit.py:1314 ../chirpui/memedit.py:1321
+msgid "Power"
+msgstr "Teljesítmény"
+
+#: ../chirpui/memdetail.py:330
+msgid "Memory validation failed:"
+msgstr "Memória érvényesítési hiba:"
+
+#: ../chirpui/memdetail.py:341
+msgid "Edit Multiple Memories"
+msgstr "Több memória szerkesztése"
+
+#: ../chirpui/memdetail.py:363
+msgid "Check this to change the {name} value"
+msgstr "Ennek változtatásához ellenőrizd a {name} értékét"
+
+#: ../chirpui/memedit.py:53
+msgid "Invalid value for this field"
+msgstr "Érvénytelen mezőérték"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:246 ../chirpui/memedit.py:279
+#: ../chirpui/memedit.py:287 ../chirpui/memedit.py:294
+#: ../chirpui/memedit.py:299 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:345 ../chirpui/memedit.py:403
+#: ../chirpui/memedit.py:1059 ../chirpui/memedit.py:1114
+#: ../chirpui/memedit.py:1241 ../chirpui/memedit.py:1318
+msgid "DTCS Rx Code"
+msgstr "DTCS RX kód"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:94 ../chirpui/memedit.py:116
+#: ../chirpui/memedit.py:231 ../chirpui/memedit.py:240
+#: ../chirpui/memedit.py:262 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:281 ../chirpui/memedit.py:289
+#: ../chirpui/memedit.py:293 ../chirpui/memedit.py:301
+#: ../chirpui/memedit.py:347 ../chirpui/memedit.py:1061
+#: ../chirpui/memedit.py:1116 ../chirpui/memedit.py:1249
+#: ../chirpui/memedit.py:1312
+msgid "Cross Mode"
+msgstr "Kereszt-üzem"
+
+#: ../chirpui/memedit.py:197
+msgid "Erasing memory {loc}"
+msgstr "A(z) {loc}. memóriahely törlése"
+
+#: ../chirpui/memedit.py:326
+msgid "Unable to make changes to this model"
+msgstr "Ennél a modellnél nem változtatható"
+
+#: ../chirpui/memedit.py:332
+msgid "Editing new item, taking defaults"
+msgstr "Új elem szerkesztése az alapértelmezettek szerint"
+
+#: ../chirpui/memedit.py:354
+msgid "Bad value for {col}: {val}"
+msgstr "Hibás érték {col}: {val}"
+
+#: ../chirpui/memedit.py:378
+msgid "Error setting memory"
+msgstr "Memória beállítási hiba"
+
+#: ../chirpui/memedit.py:386 ../chirpui/memedit.py:453
+#: ../chirpui/memedit.py:728 ../chirpui/memedit.py:750
+#: ../chirpui/memedit.py:1471
+msgid "Writing memory {number}"
+msgstr "A(z) {number}. memória írása"
+
+#: ../chirpui/memedit.py:458
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Ez a művelet megköveteli, hogy minden csatorna egyetlen összefüggő, üres "
+"területre kerüljön. Ez sokáig eltarthat. Biztos, hogy elkezdjem?"
+
+#: ../chirpui/memedit.py:481
+msgid "Adding memory {number}"
+msgstr "A(z) {number}. memória hozzáadása"
+
+#: ../chirpui/memedit.py:494 ../chirpui/memedit.py:1096
+msgid "Erasing memory {number}"
+msgstr "A(z) {number}. memória törlése"
+
+#: ../chirpui/memedit.py:503 ../chirpui/memedit.py:612
+#: ../chirpui/memedit.py:658 ../chirpui/memedit.py:663
+#: ../chirpui/memedit.py:1037 ../chirpui/memedit.py:1345
+msgid "Getting memory {number}"
+msgstr "A(z) {number}. memória beolvasása"
+
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:602
+#: ../chirpui/memedit.py:650
+msgid "Moving memory from {old} to {new}"
+msgstr "Memória átmozgatás {old} -> {new}"
+
+#: ../chirpui/memedit.py:672
+msgid "Raw memory {number}"
+msgstr "{number}. memóriasor"
+
+#: ../chirpui/memedit.py:676 ../chirpui/memedit.py:704
+#: ../chirpui/memedit.py:709
+msgid "Getting raw memory {number}"
+msgstr "A(z) {number}. memóriasor kiolvasása"
+
+#: ../chirpui/memedit.py:681
+msgid "You can only diff two memories!"
+msgstr "Csak két memória hasonlítható össze!"
+
+#: ../chirpui/memedit.py:692
+msgid "Memory {number}"
+msgstr "A(z){number} memória"
+
+#: ../chirpui/memedit.py:698
+msgid "Diff of {a} and {b}"
+msgstr "{a} és {b} összehasonlítása"
+
+#: ../chirpui/memedit.py:732
+msgid "Getting original memory {number}"
+msgstr "A(z) eredeti {number}. memóriasor"
+
+#: ../chirpui/memedit.py:769
+msgid "Memories must be contiguous"
+msgstr "Egybefüggő memóriaterület szükséges"
+
+#: ../chirpui/memedit.py:856
+msgid "Edit"
+msgstr "Sz_erkesztés"
+
+#: ../chirpui/memedit.py:857
+msgid "Insert row above"
+msgstr "Memória beszúrása fölé"
+
+#: ../chirpui/memedit.py:858
+msgid "Insert row below"
+msgstr "Memória beszúrása alá"
+
+#: ../chirpui/memedit.py:859
+msgid "Delete"
+msgstr "Törlés"
+
+#: ../chirpui/memedit.py:860
+msgid "this memory"
+msgstr "ez a memória"
+
+#: ../chirpui/memedit.py:860
+msgid "these memories"
+msgstr "ezek a memóriák"
+
+#: ../chirpui/memedit.py:861
+msgid "...and shift block up"
+msgstr "... és a tömböt felfelé lépteti"
+
+#: ../chirpui/memedit.py:862
+msgid "...and shift all memories up"
+msgstr "...és minden memória felfelé lép"
+
+#: ../chirpui/memedit.py:863
+msgid "Move up"
+msgstr "Mozgatás felfelé"
+
+#: ../chirpui/memedit.py:864
+msgid "Move down"
+msgstr "Mozgatás lefelé"
+
+#: ../chirpui/memedit.py:865
+msgid "Exchange memories"
+msgstr "Memóriák cseréje"
+
+#: ../chirpui/memedit.py:866
+msgid "Cut"
+msgstr "Kivágás"
+
+#: ../chirpui/memedit.py:867
+msgid "Copy"
+msgstr "Másolás"
+
+#: ../chirpui/memedit.py:868
+msgid "Paste"
+msgstr "Beillesztés"
+
+#: ../chirpui/memedit.py:869
+msgid "Show Raw Memory"
+msgstr "Memóriasor mutatása"
+
+#: ../chirpui/memedit.py:870
+msgid "Diff Raw Memories"
+msgstr "Memóriasorok összehasonlítása"
+
+#: ../chirpui/memedit.py:1015
+msgid "Internal Error: Column {name} not found"
+msgstr "Belső hiba: nincs {name} nevű oszlop"
+
+#: ../chirpui/memedit.py:1044
+msgid "Getting channel {chan}"
+msgstr "A(z) {chan}. csatorna kiolvasása"
+
+#: ../chirpui/memedit.py:1136
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Belső hiba: Érvénytelen határ {number}"
+
+#: ../chirpui/memedit.py:1146
+msgid "Memory range:"
+msgstr "Memória tartomány:"
+
+#: ../chirpui/memedit.py:1173
+msgid "Go"
+msgstr "Ok"
+
+#: ../chirpui/memedit.py:1196
+msgid "Special Channels"
+msgstr "Spec. csatornák"
+
+#: ../chirpui/memedit.py:1203
+msgid "Show Empty"
+msgstr "Üreset is"
+
+#: ../chirpui/memedit.py:1378
+msgid "Cutting memory {number}"
+msgstr "A(z) {number}. memória kivágása"
+
+#: ../chirpui/memedit.py:1409
+msgid ""
+"Unable to paste {src} memories into {dst} rows. Increase the memory bounds "
+"or show empty memories."
+msgstr ""
+"Nem sikerült beilleszteni {src} memóriát {dst} sorokba. Növelje a memória "
+"határokat, vagy mutasson üres memóriára!"
+
+#: ../chirpui/memedit.py:1423
+msgid "Overwrite?"
+msgstr "Felülírja?"
+
+#: ../chirpui/memedit.py:1428
+msgid "Overwrite location {number}?"
+msgstr "Felülírja a(z) {number}. helyet?"
+
+#: ../chirpui/memedit.py:1453
+msgid "Incompatible Memory"
+msgstr "Nem kompatibilis memória"
+
+#: ../chirpui/memedit.py:1456
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr ""
+"A beillesztett {number}. számú memória nem kompatibilis ezzel a rádióval, "
+"mert:"
+
+#: ../chirpui/memedit.py:1510 ../chirpui/memedit.py:1525
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1510 ../chirpui/memedit.py:1526
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1510 ../chirpui/memedit.py:1527
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1511 ../chirpui/memedit.py:1528
+msgid "Digital Code"
+msgstr "Digitális kód"
+
+#: ../chirpui/settingsedit.py:67
+#, python-format
+msgid "Error in setting value: %s"
+msgstr "Hiba a(z) %s érték beállításakor"
+
+#: ../chirpui/settingsedit.py:124
+#, python-format
+msgid "Invalid setting value: %s"
+msgstr "Érvénytelen érték %s"
+
+#: ../chirpui/settingsedit.py:164
+msgid "Enabled"
+msgstr "Engedélyezve"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Eltolás"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Mozgatás {src} -> {dst}"
+
+#: ../chirpui/shiftdialog.py:83
+msgid "Looking for a free spot ({number})"
+msgstr "Üres terület keresése ({number})"
+
+#: ../chirpui/shiftdialog.py:96
+msgid "No space to insert a row"
+msgstr "Nincs hely a sor beszúrásához"
+
+#: ../chirpui/shiftdialog.py:143
+msgid "Moved {count} memories"
+msgstr "{count} memória átmozgatva"
+
+msgid "Automatic Repeater Offset"
+msgstr "Automatic Repeater Offset"
+
+msgid "Delete all"
+msgstr "_Törlés"
+
+msgid "%i errors during open, check the debug log for details"
+msgstr "%i errors during open, check the debug log for details"
diff --git a/locale/hu/LC_MESSAGES/CHIRP.mo b/locale/hu/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 263621d..0000000
--- a/locale/hu/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/it.po b/locale/it.po
new file mode 100644
index 0000000..fb2c688
--- /dev/null
+++ b/locale/it.po
@@ -0,0 +1,944 @@
+# English translations for CHIRP package.
+# Copyright (C) 2011 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dan@theine>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2014-11-08 17:58+0100\n"
+"Last-Translator: Dan Smith <dan@theine>\n"
+"Language-Team: English\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 1.6.10\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Completato"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "pronto"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Recupero informazioni bank"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Scrittura nome del bank"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Bank"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Nome"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Aggiornamento indice bank per la memoria {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Aggiornamento informazioni bank per la memoria {num}"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Acquisizione memoria {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Scrittura indice per la memoria {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Acquisizione bank per la memoria {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Pos"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Frequenza"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Indice"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Acquisizione informazioni bank per la memoria {num}"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Acquisizione informazioni bank"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Si e' verificato un errore"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Sovrascrivi"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Il File esiste"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Il file {name} esiste gia. Vuoi sovrascriverlo?"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+"La memoria numero {number} e' gia' stata importata. Scegliere un altro "
+"valore per 'Nuova memoria' prima di selezionare 'Importa'"
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Valore non valido. Deve essere un numero intero"
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "La memoria {number} e' gia' stata importata"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Aggiornamento lista URCALL"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Aggiornamento lista RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Scrittura memoria {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Importazione informazioni bank"
+
+#: ../chirpui/importdialog.py:264
+msgid "Error importing memories:"
+msgstr "Errore di importazione memorie:"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Tutto"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Nessuno"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Inverti"
+
+#: ../chirpui/importdialog.py:394
+msgid "Select"
+msgstr "Seleziona"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Rovescia"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Cambia nuova posizione"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Conferma sovrascrittura"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Opzioni"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "Non si puo' importare perche'"
+
+#: ../chirpui/importdialog.py:513
+msgid "Import From File"
+msgstr "Importa da File"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Import"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "A"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "Da"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Commento"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "La memoria verra' importata in"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Posizione della memoria nel file che viene importato"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Preparazione lista memorie..."
+
+#: ../chirpui/importdialog.py:575
+msgid "Export To File"
+msgstr "Esporta in File"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Esporta"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Senza Nome"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Immagine Radio CHIRP"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "Files CHIRP"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "Files CSV"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "Files ICF"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "Files VX7 Commander"
+
+#: ../chirpui/mainapp.py:330
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"I Files ICF non possono essere modificati, solo visualizzati o importati in "
+"un altro file. Aprire in sola lettura?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Errore durante l'apertura di {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} errori durante l'apertura:"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Note:"
+
+#: ../chirpui/mainapp.py:395
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"La radio{vendor} {model} opera in <b>live mode</b>. Questo significa che "
+"qualsiasi modifica viene immediatamente scritta nella radio. A causa di "
+"questo, non puoi utilizzare le funzioni <u>Salva</u> or <u>Scrivi</u>. Se "
+"vuoi modificare le memorie offline, per favore <u>Esporta</u> le memorie in "
+"un file CSV, usando il menu <b>File</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Non mostrarlo di nuovo"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "File immagine {vendor} {model}"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Apri file recente {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Importazione configurazione stock {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Apertura configurazione stock {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Scartare le modifiche?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "Il file e' stato modificato, salvare i cambiamenti prima di chiudere?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "Con il significativo contributo di:"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Seleziona colonne"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Colonne visibili per {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Reporting disattivato"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"La funzione reporting di CHIRP e' fatta per <u>migliorare la qualita'</u> "
+"consentendo agli autori di concentrarsi sulle radio piu' utilizzate e sugli "
+"errori piu' comuni. I report non contengono informazioni personali e sono "
+"utilizzati per soli fini statistici dagli autori. La tua provacy e' molto "
+"importante ma <u>per favore considera di lasciare attiva questa opzione per "
+"aiutarci a migliorare CHIRP!</u>\n"
+"\n"
+"<b>Sei sicuro di disabilitare questa opzione?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+"Scegli una lingua o usa Auto per utilizzare la lingua del sistema operativo. "
+"Devi riavviare l'applicazione per applicare i cambiamenti"
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "File"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Apri configurazione stock"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "Recenti"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "Modifica"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "Taglia"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "Copia"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "Incolla"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "Elimina"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Muovi Su"
+
+#: ../chirpui/mainapp.py:1184
+msgid "Move Dow_n"
+msgstr "Muovi Giu"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "Scambia"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "Vista"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Colonne"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Sviluppatore"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Mostra memorie Raw"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Differenza memorie Raw"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Differenzia tabs"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Cambia lingua"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "Radio"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Leggi da Radio"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Scrivi su Radio"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Importa da RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "File nativo CHIRP"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "File CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Importa da RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+msgid "Import from stock config"
+msgstr "Importa da Configurazione Stock"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Aiuto"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Report statistiche"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Nascondi campi inutilizzati"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Offset Ripetitori Automatico"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Abilita Funzioni Sviluppatore"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Rapporto errori abilitato"
+
+#: ../chirpui/mainapp.py:1355
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Se vuoi disabilitare questa opzione puoi farlo nel menu <u>Aiuto</u>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Progressione programmazione"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Programmazione"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Annulla"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Shift"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Spostamento da {src} a {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Ricerca di un posto libero ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "Spostate {count} memorie"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} su porta {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Rileva"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Porta"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Produttore"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Modello"
+
+#: ../chirpui/clone.py:138
+msgid "Radio"
+msgstr "Radio"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Impossibile rilevare radio sulla porta {port}"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Errore interno: impossibile caricare su {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Programmazione fallita: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Nominativo"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Il tuo nominativo"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Nominativo Ripetitore"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Il mio nominativo"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Scaricamento lista URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Scaricamento lista RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Scaricamento lista MYCALL"
+
+#: ../chirpui/editorset.py:87
+msgid "Memories"
+msgstr "Memorie"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Nomi Bank"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Bank"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "Il {vendor} {model} ha sub-device multipli indipendenti"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Scegli da dove importare:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Annullato"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Errore interno"
+
+#: ../chirpui/editorset.py:248
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+"Ci sono stati degli errori nell'apertura del file {file}. Le memorie "
+"interessate non potranno essere importate!"
+
+#: ../chirpui/editorset.py:260
+msgid "There was an error during import: {error}"
+msgstr "Errore durante l'apertura del file: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Tipo file non supportato"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+msgid "There was an error during export: {error}"
+msgstr "Errore durante l'esportazione del file: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Preparazione memoria"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Valore non valido per questo campo"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Modalita' tono"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Tone"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "ToneSql"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "DTCS Code"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Cross Mode"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Offset"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Modulazione"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Potenza"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Step sintonia"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Salta"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Cancellazione memoria {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Impossibile effettuare modifiche su questo modello"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Modifica di un nuovo elemento, verranno usati valori di default"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Valore non valido per {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Errore di scrittura della memoria"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Scrittura memoria {number}"
+
+#: ../chirpui/memedit.py:361
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Questa operazione richiede lo spostamento dei canali seguenti di un passo "
+"alla volta fino alla nuova posizione. L'operazione puo' durare MOLTO tempo. "
+"Sei sicuro di volerlo fare?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Aggiunta memoria {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Cancellatura memoria {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Acquisita memoria {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Spostata memoria da {old} a {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Memoria Raw {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Acquisizione memoria Raw {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "Puoi differenziare solo 2 memorie!"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Memoria {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Differenza di {a} e {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Le memorie devono essere contigue"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Inserisci riga sopra"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Inserisci riga sotto"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete"
+msgstr "Elimina"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete all"
+msgstr "Elimina tutto"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Elimina (e sposta sopra)"
+
+#: ../chirpui/memedit.py:704
+msgid "Move up"
+msgstr "Sposta su"
+
+#: ../chirpui/memedit.py:705
+msgid "Move down"
+msgstr "Muovi giu"
+
+#: ../chirpui/memedit.py:706
+msgid "Exchange memories"
+msgstr "Scambia memorie"
+
+#: ../chirpui/memedit.py:707
+msgid "Cut"
+msgstr "Taglia"
+
+#: ../chirpui/memedit.py:708
+msgid "Copy"
+msgstr "Copia"
+
+#: ../chirpui/memedit.py:709
+msgid "Paste"
+msgstr "Incolla"
+
+#: ../chirpui/memedit.py:710
+msgid "Show Raw Memory"
+msgstr "Mostra memorie Raw"
+
+#: ../chirpui/memedit.py:711
+msgid "Diff Raw Memories"
+msgstr "Diff memorie Raw"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Errore interno: nome colonna {name} non trovato"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Acquisizione canale {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Errore interno: limite non valido {number}"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Range memorie"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Vai"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Canali Speciali"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Mostra Vuoti"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Taglia memoria {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Sovrascrivere?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Sovrascrivere posizione {number}?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Memoria non compatibile"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr ""
+"La memoria incollata {number} non e' compatibile con questa radio perche':"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Digital Code"
+
+#~ msgid "%i errors during open, check the debug log for details"
+#~ msgstr "%i errors during open, check the debug log for details"
diff --git a/locale/it/LC_MESSAGES/CHIRP.mo b/locale/it/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index c2067fa..0000000
--- a/locale/it/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/nl.po b/locale/nl.po
new file mode 100644
index 0000000..e22e916
--- /dev/null
+++ b/locale/nl.po
@@ -0,0 +1,945 @@
+# Dutch translations for CHIRP package.
+# Copyright (C) 2012 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dsmith@danplanet.com>, 2012.
+# Michael Tel <m.tel@xs4all.nl>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2012-03-18 12:01+0100\n"
+"Last-Translator: Michael Tel <m.tel@xs4all.nl>\n"
+"Language-Team: Dutch\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Volbracht"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "luieren"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Informatie van de bank ophalen"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Naam van de bank instellen"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Bank"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Naam"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Index van de bank voor kanaal {num} bijwerken"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Informatie van de bank voor kanaal {num} bijwerken"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Ophalen kanaal {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Instellen van de index voor kanaal {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Bank voor kanaal {num} ophalen"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Plaats"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Frequentie"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Index"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Informatie van de bank voor kanaal {num} ophalen"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Informatie van de bank ophalen"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Er is een fout opgetreden"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Overschrijven"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Bestand bestaat"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Het bestand {name} bestaat al. Wilt u het overschrijven?"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr ""
+"Plaats {number} wordt al gemporteerd. Kies een andere waarde voor 'Nieuwe "
+"locatie' vr 'Importeren' te selecteren"
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Ongeldige waarde. Het moet een integer zijn."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "Plaats {number} is reeds gemporteerd"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Bijwerken URCALL lijst"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Bijwerken RPTCALL lijst"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Kanaal {number} instellen"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Importeren van informatie van de bank"
+
+#: ../chirpui/importdialog.py:264
+msgid "Error importing memories:"
+msgstr "Fout bij het importen van geheugen"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Alles"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Geen"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Tegengesteld"
+
+#: ../chirpui/importdialog.py:394
+msgid "Select"
+msgstr "Selecteren"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Omkeren"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Nieuwe locatie aanpassen"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Overschrijven bevestigen"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Opties"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "Kan niet worden gemporteerd, omdat"
+
+#: ../chirpui/importdialog.py:513
+msgid "Import From File"
+msgstr "Importeren van bestand"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Importeren"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "Aan"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "Van"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Opmerking"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "Geheugenplaatsen zullen ook gemporteerd worden naar"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Plaats van het kanaal in het bestand wordt gemporteerd"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Lijst van het kanaal wordt voorbereid..."
+
+#: ../chirpui/importdialog.py:575
+msgid "Export To File"
+msgstr "Exporteren naar bestand"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Exporteren"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Naamloos"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "CHIRP radio afbeeldingen"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "CHIRP bestanden"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "Komma gescheiden bestanden"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "ICF bestanden"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "VX7 Commander bestanden"
+
+#: ../chirpui/mainapp.py:330
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"ICF bestanden kunnen niet worden bewerkt, alleen worden weergegeven of in "
+"een ander bestand gemporteerd. Openen in de modus alleen-lezen?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Er is een fout opgetreden bij het openen van {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} fouten tijdens het openen:"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Noot:"
+
+#: ../chirpui/mainapp.py:395
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"De {vendor} {model} opereert in de <b>live modus</b>. Dit betekent dat "
+"wijzigingen die u aanbrengt onmiddellijk naar de radio verzonden worden. "
+"Hierdoor kunt u het niet <u>Opslaan</u> of <u>uploaden</u> . Als u wenst de "
+"inhoud off line te bewerken, gelieve <u>exporteren</u> naar een CSV-bestand, "
+"met behulp van het <b>menu bestand</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Deze melding niet opnieuw weergeven"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "{vendor} {model} afbeeldingsbestand"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Recent geopend bestand {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Importeren van aanwezige configuratie {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Openen van aanwezige configuratie {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Wijzigen verwerpen?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "Het bestand is aangepast. Wilt u de wijzigingen opslaan?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "Met dank aan:"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Kolommen selecteren"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Zichtbare kolommen voor {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Rapportering is uitgeschakeld"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"De rapportagefunctie van CHIRP is ontworpen om de <u>kwaliteit te helpen "
+"verbeteren</u> door de auteurs toe te staan zich te concentreren op de radio "
+"stuurprogramma's die het meest gebruikt worden en fouten ervaren door de "
+"gebruikers. De verslagen bevatten geen identificerende informatie en worden "
+"alleen voor statistische doeleinden gebruikt door de auteurs. Uw privacy is "
+"uiterst belangrijk, <u>maar kunt u overwegen deze functie ingeschakeld te "
+"laten om zo te helpen CHIRP beter maken!</u>\n"
+"\n"
+"<b>Weet u zeker dat u deze functie wilt uitschakelen?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+"Kies een taal of Auto voor het gebruik van het standaard besturingssysteem. "
+"U dient de toepassing opnieuw te starten voordat de wijziging wordt "
+"doorgevoerd"
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Bestanden"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Openen aanwezige configuratie"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Recent"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "Be_werken"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Knippen"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Kopiren"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Plakken"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Verwijderen"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Verplaats om_hoog"
+
+#: ../chirpui/mainapp.py:1184
+msgid "Move Dow_n"
+msgstr "Verplaats omlaa_g"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "W_isselen"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "Bee_ld"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Kolommen"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Ontwerper"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Toon ruw geheugen"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Verschil ruwe kanalen"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Verschillen van tabs"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Taal wijzigen"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Radio"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Download van radio"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Naar radio uploaden"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Importeren uit RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "CHIRP oorspronkelijk bestand"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "Komma gescheiden bestand"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Importeren van RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+msgid "Import from stock config"
+msgstr "Importeren van aanwezige configuratie"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Help"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Statistieken raporteren"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Ongebruikte velden verbergen"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Automatische repeater offset"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Ontwikkelaars functies inschakelen"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Foutrapportage is aangezet"
+
+#: ../chirpui/mainapp.py:1355
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr ""
+"Als u deze functie wilt uitschakelen, dan kunt u dit doen in het menu "
+"<u>Help</u>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Vooruitgang van het klonen"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Klonen"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Annuleren"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Shift"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Verplaatsen van {src} naar {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Zoeken naar een vrije plaats ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "{count} kanalen verplaatst"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} op {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Detecteren"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Poort"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Merk"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Model"
+
+#: ../chirpui/clone.py:138
+msgid "Radio"
+msgstr "Radio"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Niet in staat om de radio op {port} te detecteren"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Interne fout: Niet in staat om te uploaden naar {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Klonen mislukt: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Roepletters"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Uw roepletters"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Roepletters van de repeater"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Mijn roepletters"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Downloaden van URCALL lijst"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Downloaden van RPTCALL lijst"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Downloaden van MYCALL lijst"
+
+#: ../chirpui/editorset.py:87
+msgid "Memories"
+msgstr "Kanalen"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Banknamen"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Banken"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "De {vendor} {model} heeft meerdere onafhankelijke sub-apparaten"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Kies n om vanuit te importeren:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Geannuleerd"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Interne fout"
+
+#: ../chirpui/editorset.py:248
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+"Er zijn fouten opgetreden tijdens het openen van {file}. De getroffen "
+"kanalen zijn niet importeerbaar!"
+
+#: ../chirpui/editorset.py:260
+msgid "There was an error during import: {error}"
+msgstr "Er is een fout ontstaan tijdens het importeren: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Niet-ondersteunende bestandstype"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+msgid "There was an error during export: {error}"
+msgstr "Er is een fout opgetreden tijdens het exporteren: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Voorbereiden van geheugen"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Ongeldige waarde voor dit veld"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Toonmodus"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Toon"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "Toon squelch"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "DTCS code"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Cross-mode"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Offset"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Mode"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Vermogen"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Kanaal-afstand"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Overslaan"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Wis kanaal {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Niet in staat om wijzigingen voor dit model te maken"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Bewerken van een nieuw item. Standaardwaarden worden genomen"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Foute waarde voor {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Fout bij het instellen van het geheugen"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Schrijven kanaal {number}"
+
+#: ../chirpui/memedit.py:361
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Deze bewerking vereist het verplaatsen van alle volgende kanalen totdat een "
+"lege locatie is bereikt. Dit kan een lange tijd duren. Weet u zeker dat u "
+"dit wilt doen?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Kanaal toevoegen {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Wis kanaal {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Ophalen kanaal {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Verplaats kanaal van {old} naar {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Ruw kanaal {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Ophalen van onbewerkt kanaal {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "U kunt maar van 2 kanalen de verschillen zien"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Kanaal {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Verschil tussen {a} en {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "De kanalen moeten aangrenzend zijn"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Regel hierboven invoegen"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Regel hieronder invoegen"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete"
+msgstr "Verwijderen"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete all"
+msgstr "Alles verwijderen"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Verwijderen (en naar boven verplaatsen)"
+
+#: ../chirpui/memedit.py:704
+msgid "Move up"
+msgstr "Verplaats omhoog"
+
+#: ../chirpui/memedit.py:705
+msgid "Move down"
+msgstr "Verplaats omlaag"
+
+#: ../chirpui/memedit.py:706
+msgid "Exchange memories"
+msgstr "Kanalen wisselen"
+
+#: ../chirpui/memedit.py:707
+msgid "Cut"
+msgstr "Knippen"
+
+#: ../chirpui/memedit.py:708
+msgid "Copy"
+msgstr "Kopiëren"
+
+#: ../chirpui/memedit.py:709
+msgid "Paste"
+msgstr "Plakken"
+
+#: ../chirpui/memedit.py:710
+msgid "Show Raw Memory"
+msgstr "Toon ruw kanaal"
+
+#: ../chirpui/memedit.py:711
+msgid "Diff Raw Memories"
+msgstr "Verschillen ruwe kanalen"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Interne fout: Kolom {name} niet gevonden"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Ophalen kanaal {chan}"
+
+# You are missing the last bracket
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Interne fout: Ongeldige limiet {number}"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Geheugenbereik:"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Ga"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Speciale kanalen"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Lege tonen"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Knippen kanaal {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Overschrijven?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Plaats {number} overschrijven?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Onverenigbaar kanaal"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr "Geplakt kanaal {number} is niet compatibel met deze radio omdat:"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Digitale code"
diff --git a/locale/nl/LC_MESSAGES/CHIRP.mo b/locale/nl/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 39d703e..0000000
--- a/locale/nl/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/pl.po b/locale/pl.po
new file mode 100644
index 0000000..2e19afc
--- /dev/null
+++ b/locale/pl.po
@@ -0,0 +1,987 @@
+# Polish translations for CHIRP package.
+# Copyright (C) 2011 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <mancymonek@wp.pl>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2011-12-07 11:35+0100\n"
+"Last-Translator: Grzegorz Błoński-Kubiak <mancymonek@wp.pl>\n"
+"Language-Team: Polish\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2);\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Ukończono pomyślnie"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "bezczynny"
+
+#: ../chirpui/bankedit.py:52
+#, fuzzy
+msgid "Retrieving bank information"
+msgstr "Pobieranie listy banków pamięci"
+
+#: ../chirpui/bankedit.py:75
+#, fuzzy
+msgid "Setting name on bank"
+msgstr "Pobieranie listy banków pamięci"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Bank"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Nazwa"
+
+#: ../chirpui/bankedit.py:185
+#, fuzzy
+msgid "Updating bank index for memory {num}"
+msgstr "Pobieranie surowej pamięci {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr ""
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+#, fuzzy
+msgid "Getting memory {num}"
+msgstr "Pobieranie pamięci {num}"
+
+#: ../chirpui/bankedit.py:214
+#, fuzzy
+msgid "Setting index for memory {num}"
+msgstr "Pobieranie pamięci {num}"
+
+#: ../chirpui/bankedit.py:223
+#, fuzzy
+msgid "Getting bank for memory {num}"
+msgstr "Pobieranie surowej pamięci {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Lp."
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Częstotliwość"
+
+#: ../chirpui/bankedit.py:241
+#, fuzzy
+msgid "Index"
+msgstr "Indeks banków"
+
+#: ../chirpui/bankedit.py:302
+#, fuzzy
+msgid "Getting bank information for memory {num}"
+msgstr "Pobieranie surowej pamięci {num}"
+
+#: ../chirpui/bankedit.py:323
+#, fuzzy
+msgid "Getting bank information"
+msgstr "Pobieranie listy banków pamięci"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Wystąpił błąd"
+
+#: ../chirpui/inputdialog.py:130
+#, fuzzy
+msgid "Overwrite"
+msgstr "Nadpisać ?"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Plik już istnieje"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Plik {name} istneje.Czy chcesz nadpisać?"
+
+#: ../chirpui/importdialog.py:90
+msgid ""
+"Location {number} is already being imported. Choose another value for 'New "
+"Location' before selection 'Import'"
+msgstr "Lokalizacja {number} jest zaimportowana.Wybierz inna lokalizację."
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Błąd.Wartość musi być liczbą."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "Lokalizacja {number} jest zaimportowana."
+
+#: ../chirpui/importdialog.py:182
+#, fuzzy
+msgid "Updating URCALL list"
+msgstr "Pobieranie listy URCALL"
+
+#: ../chirpui/importdialog.py:187
+#, fuzzy
+msgid "Updating RPTCALL list"
+msgstr "Pobieranie listy RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+#, fuzzy
+msgid "Setting memory {number}"
+msgstr "Pobieranie pamięci {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr ""
+
+#: ../chirpui/importdialog.py:264
+#, fuzzy
+msgid "Error importing memories:"
+msgstr "Błąd ustawiania pamięci"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Wszystkie"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr " Żaden"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "odwrotność"
+
+#: ../chirpui/importdialog.py:394
+#, fuzzy
+msgid "Select"
+msgstr "Wybierz kolumny"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Odwrotny"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Dostosuj nową lokalizację"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Potwierdź nadpisanie"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Opcje"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr ""
+
+#: ../chirpui/importdialog.py:513
+#, fuzzy
+msgid "Import From File"
+msgstr "Importuj z RFinder"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Importuj"
+
+#: ../chirpui/importdialog.py:534
+#, fuzzy
+msgid "To"
+msgstr "Ton"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr ""
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr ""
+
+#: ../chirpui/importdialog.py:542
+#, fuzzy
+msgid "Location memory will be imported into"
+msgstr "Lokalizacja {number} jest zaimportowana."
+
+#: ../chirpui/importdialog.py:543
+#, fuzzy
+msgid "Location of memory in the file being imported"
+msgstr "Lokalizacja {number} jest zaimportowana."
+
+#: ../chirpui/importdialog.py:566
+#, fuzzy
+msgid "Preparing memory list..."
+msgstr "Kasowanie pamięci {loc}"
+
+#: ../chirpui/importdialog.py:575
+#, fuzzy
+msgid "Export To File"
+msgstr "Importuj z RFinder"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Eksportuj"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Bez nazwy"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Zrzuty z urządzeń CHIRP"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "Pliki CHIRP"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "Pliki CSV"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "Pliki ICF"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "Pliki VX7 Commander "
+
+#: ../chirpui/mainapp.py:330
+msgid ""
+"ICF files cannot be edited, only displayed or imported into another file. "
+"Open in read-only mode?"
+msgstr ""
+"Plik ICF nie może być edytowany, może być wyświetlany oraz importowany do "
+"innego pliku.Otworzyć w trybie do odczytu?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Wystąpił błąd podczas otwierania {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr ""
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Uwaga:"
+
+#: ../chirpui/mainapp.py:395
+msgid ""
+"The {vendor} {model} operates in <b>live mode</b>. This means that any "
+"changes you make are immediately sent to the radio. Because of this, you "
+"cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to "
+"edit the contents offline, please <u>Export</u> to a CSV file, using the "
+"<b>File menu</b>."
+msgstr ""
+"Urządzenie {vendor} {model} pracuje w trybie <b>na żywo</b>. To oznacza, że "
+"każda zmiana zostaje natychmiast wysłana do urządzenia. Z tego powodu nie "
+"możesz wykonać akcji <u>Zapisz</u> lub <u>Wyślij</u>.Jeśli chcesz edytować "
+"zwartość w trybie bez połączenia użyj polecenia <u>Eksportuj</u> do pliku "
+"CSV korzystając z menu <b>Plik</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Nie pokazuj tego więcej"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "{vendor} {model} plik zrzutu"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Otwórz poprzednio otwarty plik {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr ""
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr ""
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Anulować zmiany?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "Plik został zmodyfikowany, zapisać przed zakończeniem?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr ""
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Wybierz kolumny"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Widoczne kolumny dla {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Raportowanie jest wyłączone"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by "
+"allowing the authors to focus on the radio drivers used most often and "
+"errors experienced by the users. The reports contain no identifying "
+"information and are used only for statistical purposes by the authors. Your "
+"privacy is extremely important, but <u>please consider leaving this feature "
+"enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"Funkcja raportowanie programu CHIRP została zaprojektowana by pomóc "
+"<u>podnosić jakość<u/> dając autorom możliwość skupienia się na sterownikach "
+"urządzeń najczęściej używanych i błędach które napotykają użytkowników."
+"Raporty nie zawierają danych identyfikujących użytkownika i są "
+"wykorzystywane tylko w celach statystycznych przez autorów.Twoja prywatność "
+"jest najważniejsza , lecz rozważ pozostawienie tej funkcji włączonej by "
+"pomóc ulepszać oprogramowanie CHIRP!"
+
+#: ../chirpui/mainapp.py:1045
+msgid ""
+"Choose a language or Auto to use the operating system default. You will need "
+"to restart the application before the change will take effect"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Plik"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Niedawny"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Edycja"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Wytnij"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Kopiuj"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Wklej"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Usuń"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "W górę"
+
+#: ../chirpui/mainapp.py:1184
+#, fuzzy
+msgid "Move Dow_n"
+msgstr "W dół"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "Zamień"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "_Podgląd"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Kolumny"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Deweloper"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Pokaż surową pamięć"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Porównaj surowe pamięci"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr ""
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Urządzenie"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Pobierz z urządzenia"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Wyślij do urządzenia"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Importuj z RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "Natywny plik CHIRP"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "Plik CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Importuj z RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+#, fuzzy
+msgid "Import from stock config"
+msgstr "Importuj z RepeaterBook"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Pomoc"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Raport statystyk"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Ukryj nieużywane pola"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Automatyczny offset repeatera"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Włącz funkcje deweloperskie"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Raportowanie błędów jest włączone"
+
+#: ../chirpui/mainapp.py:1355
+msgid ""
+"If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Jeśli chcesz wyłączyć tą funkcję możesz to zrobić w menu <u>Pomoc</>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Postęp klonowania"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Klonowanie"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Przełącz"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Przenoszę {src} do {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Szukaj wolnego miejsca ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "Przeniesiono {count} pamięci"
+
+#: ../chirpui/clone.py:35
+#, fuzzy
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} plik zrzutu"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Wykryj"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Port"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Producent"
+
+#: ../chirpui/clone.py:125
+#, fuzzy
+msgid "Model"
+msgstr "Tryb"
+
+#: ../chirpui/clone.py:138
+#, fuzzy
+msgid "Radio"
+msgstr "_Urządzenie"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Nie mogę wykryć urządzenia na porcie {port}"
+
+#: ../chirpui/clone.py:178
+#, fuzzy
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Błąd wewnętrzny: Niewłaściwy limit {number}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Klonowanie nieudane: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Znak wywoławczy"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Znak wywoławczy korespondenta"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Znak wywoławczy repeatera"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Mój znak wywoławczy"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Pobieranie listy URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Pobieranie listy RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+#, fuzzy
+msgid "Downloading MYCALL list"
+msgstr "Pobieranie listy URCALL"
+
+#: ../chirpui/editorset.py:87
+#, fuzzy
+msgid "Memories"
+msgstr "Porównaj surowe pamięci"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+#, fuzzy
+msgid "Bank Names"
+msgstr "Bank"
+
+#: ../chirpui/editorset.py:104
+#, fuzzy
+msgid "Banks"
+msgstr "Bank"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "{vendor} {model} posiada kilka niezależnych urządzeń wbudowanych"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Wybierz do zaimportowania:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Anulowano"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Błąd wewnętrzny"
+
+#: ../chirpui/editorset.py:248
+msgid ""
+"There were errors while opening {file}. The affected memories will not be "
+"importable!"
+msgstr ""
+
+#: ../chirpui/editorset.py:260
+#, fuzzy
+msgid "There was an error during import: {error}"
+msgstr "Wystąpił błąd podczas otwierania {fname}: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Nieobsługiwany typ pliku"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+#, fuzzy
+msgid "There was an error during export: {error}"
+msgstr "Wystąpił błąd podczas otwierania {fname}: {error}"
+
+#: ../chirpui/editorset.py:313
+#, fuzzy
+msgid "Priming memory"
+msgstr "Zapisywanie pamięci {number}"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Niewłaściwa wartość"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Tryb tonu"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Ton"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "Blokada tonu"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "Kod DTCS"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "Polaryzacja DTCS"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Tryb krzyżowy"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Dupleks"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Przesunięcie"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Tryb"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Moc"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Krok strojenia"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Przeskocz"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Kasowanie pamięci {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Nie potrafię wprowadzić zmian w tym modelu"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Edycja nowej pozycji, przyjmuję wartości standardowe"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Zła wartość dla {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Błąd ustawiania pamięci"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Zapisywanie pamięci {number}"
+
+#: ../chirpui/memedit.py:361
+msgid ""
+"This operation requires moving all subsequent channels by one spot until an "
+"empty location is reached. This can take a LONG time. Are you sure you "
+"want to do this?"
+msgstr ""
+"Ta operacja wymaga przesunięcia wszystkich komórek pamięci o jeden.Może to "
+"zająć dużo czasu.Czy na pewno chcesz to zrobić?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Dodawanie pamięci {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Kasowanie pamięci {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Pobieranie pamięci {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Przenoszenie pamięci z {old} do {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Surowa pamięć {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Pobieranie surowej pamięci {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "Aby porównać wybierz dwie pamięci !"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Pamięć {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Różnice {a} i {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Pamięci muszą zachować ciągłość"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Umieść wiersz wyżej"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Umieść wiersz niżej"
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete"
+msgstr "_Usuń"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete all"
+msgstr "_Usuń wszystkie"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Skasuj (i skocz wyżej)"
+
+#: ../chirpui/memedit.py:704
+#, fuzzy
+msgid "Move up"
+msgstr "W górę"
+
+#: ../chirpui/memedit.py:705
+#, fuzzy
+msgid "Move down"
+msgstr "W dół"
+
+#: ../chirpui/memedit.py:706
+msgid "Exchange memories"
+msgstr "Zamień pamięci"
+
+#: ../chirpui/memedit.py:707
+#, fuzzy
+msgid "Cut"
+msgstr "_Wytnij"
+
+#: ../chirpui/memedit.py:708
+#, fuzzy
+msgid "Copy"
+msgstr "_Kopiuj"
+
+#: ../chirpui/memedit.py:709
+#, fuzzy
+msgid "Paste"
+msgstr "_Wklej"
+
+#: ../chirpui/memedit.py:710
+#, fuzzy
+msgid "Show Raw Memory"
+msgstr "Pokaż surową pamięć"
+
+#: ../chirpui/memedit.py:711
+#, fuzzy
+msgid "Diff Raw Memories"
+msgstr "Porównaj surowe pamięci"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Błąd wewnętrzny: Kolumna {name} nie znaleziona"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Pobieranie kanału {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Błąd wewnętrzny: Niewłaściwy limit {number}"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Zakres pamięci:"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Ok"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Kanały specjalne"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Pokaż puste"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Wycinanie pamięci {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Nadpisać ?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Nadpisać pozycję {number}?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Niekompatybilna pamięć"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr ""
+"Wklejona komórka pamięci {number} jest nie kompatybilna z tym urządzeniem:"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr ""
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr ""
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr ""
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr ""
+
+#~ msgid "Unsuppported by destination radio: {msgs}"
+#~ msgstr "Nieobsługiwany przez urządzenie: {msgs}"
+
+#~ msgid "New location"
+#~ msgstr "Nowa lokalizacja"
+
+#~ msgid "Location"
+#~ msgstr "Lokalizacja"
+
+#~ msgid "%i errors during open, check the debug log for details"
+#~ msgstr "%i błędów podczas otwierania, sprawdź log by obejrzeć szczegóły"
diff --git a/locale/pl/LC_MESSAGES/CHIRP.mo b/locale/pl/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 8bfbf9c..0000000
--- a/locale/pl/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
new file mode 100644
index 0000000..d3ba3cf
--- /dev/null
+++ b/locale/pt_BR.po
@@ -0,0 +1,897 @@
+# Language pt-BR translations for CHIRP package.
+# Copyright (C) 2013 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dsmith@danplanet.com>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2013-03-30 22:04-0300\n"
+"Last-Translator: Crezivando <crezivando@gmail.com>\n"
+"Language-Team: Language pt-BR\n"
+"Language: pt-BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.5\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Concluído"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "ocioso"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Recuperando informações do banco"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Configurando nome no banco"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Banco"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Nome"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Atualizando índice do banco para memória {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Atualizando informação do banco para memória {num}"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Obtendo memória {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Configurando índice para memória {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Obtendo banco para memória {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Loc"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Frequência"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Índice"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Obtendo informação do banco para memória {num}"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Obtendo informação do banco"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Ocorreu um erro"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Sobrescrever"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Arquivo já Existe"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "O arquivo {name} já existe. Você quer sobrescrevê-lo"
+
+#: ../chirpui/importdialog.py:90
+msgid "Location {number} is already being imported. Choose another value for 'New Location' before selection 'Import'"
+msgstr "Localização {number} está sendo importada. Escolha outro valor para 'Nova Localização' antes de selecionar 'Importar'"
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Valor inválido. Deve ser um número inteiro."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "Localização {number} está sendo importada"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Atualizando lista URCALL"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Atualizando lista RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Configurando memória {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Importando informação do banco"
+
+#: ../chirpui/importdialog.py:264
+msgid "Error importing memories:"
+msgstr "Erro ao importar memórias:"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Tudo"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Nenhum"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Inverso"
+
+#: ../chirpui/importdialog.py:394
+msgid "Select"
+msgstr "Selecione"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Auto"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Reverso"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Ajustar Nova Localização"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Confirmar sobrescrever"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Opções"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "Não pode ser importado porque"
+
+#: ../chirpui/importdialog.py:513
+msgid "Import From File"
+msgstr "Importar do Arquivo"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Importar"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "Para"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "De"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Comentário"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "Memória de localização será importada para"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Localização da memória no arquivo sendo importada"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Preparando lista de memória..."
+
+#: ../chirpui/importdialog.py:575
+msgid "Export To File"
+msgstr "Exportar Para Arquivo"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Exportar"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Sem-Título"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Rádio Imagens CHIRP"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "Arquivos CHIRP"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "Arquivos CSV"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "Arquivos ICF"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "Arquivos VX7 Commander"
+
+#: ../chirpui/mainapp.py:330
+msgid "ICF files cannot be edited, only displayed or imported into another file. Open in read-only mode?"
+msgstr "Arquivos ICF não podem ser editados, somente exibidos ou importados para outro arquivo. Abrir no modo somente-leitura?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Houve um erro ao abrir {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} erros durante abertura:"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Nota:"
+
+#: ../chirpui/mainapp.py:395
+msgid "The {vendor} {model} operates in <b>live mode</b>. This means that any changes you make are immediately sent to the radio. Because of this, you cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to edit the contents offline, please <u>Export</u> to a CSV file, using the <b>File menu</b>."
+msgstr "O {vendor} {model} opera em <b>modo ativo</b>. Isto significa que quaisquer alterações que você fizer são imediatamente enviadas para o rádio. Devido a isto você não pode executar as operações <u>Salvar</u> ou <u>Carregar</u>. Se você quiser editar o conteúdo off-line, por favor <u>Exportar</u> para um arquivo CSV, usando o <b>menu Arquivo</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Não mostrar isto novamente"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "Arquivo Imagem {vendor} {model}"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Abrir arquivo recente {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Importar configuração de estoque {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Abrir configuração de estoque {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Descartar Alterações?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "Arquivo modificado, salvar alterações antes de fechar?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "Com importantes contribuições de:"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Selecionar Colunas"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Colunas Visíveis para {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Emissão de Relatórios desabilitada"
+
+#: ../chirpui/mainapp.py:1013
+msgid ""
+"The reporting feature of CHIRP is designed to help <u>improve quality</u> by allowing the authors to focus on the radio drivers used most often and errors experienced by the users. The reports contain no identifying information and are used only for statistical purposes by the authors. Your privacy is extremely important, but <u>please consider leaving this feature enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr ""
+"O recurso de relatório do CHIRP é projetado para ajudar <u>melhorar a qualidade</u> permitindo aos autores focalizar os drivers de rádio mais frequentemente usados e erros experimentados pelos usuários. Os relatórios não contêm nenhuma informação de identificação e são utilizados apenas para fins estatísticos pelos autores. Sua privacidade é extremamente importante, mas <u>por favor considere deixar este recurso ativado para ajudar a melhorar o CHIRP!</u>\n"
+"\n"
+"<b>Você tem certeza de que quer desabilitar este recurso?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid "Choose a language or Auto to use the operating system default. You will need to restart the application before the change will take effect"
+msgstr "Escolha um idioma ou Auto para usar o sistema padrão. Você precisará reinicializar o aplicativo antes para que as mudanças tenham efeito."
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Arquivo"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Abrir config do estoque"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Recente"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Editar"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Cut"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Copiar"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Colar"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Apagar"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Mover _Acima"
+
+#: ../chirpui/mainapp.py:1184
+msgid "Move Dow_n"
+msgstr "Mover Abaix_o"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "T_roca"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "_Visualizar"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Colunas"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Desenvolvedor"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Mostrar memória raw"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Diff memórias raw"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Diff tabs"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Mudar idioma"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Rádio"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Descarregar a partir do Rádio"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Carregar para o Rádio"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Importar de RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "Arquivo Nativo CHIRP"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "Arquivo CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Importar do Catálogo de Repetidoras"
+
+#: ../chirpui/mainapp.py:1202
+msgid "Import from stock config"
+msgstr "Importar do config estoque"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Ajuda"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Relatório estatístico"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Ocultar Campos Não-utilizados"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Offset Automático Repetidoras"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Habilitar Funções de Desenvolvedor"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Relatório de Erros habilitado"
+
+#: ../chirpui/mainapp.py:1355
+msgid "If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Se você desejar desabilitar este recurso você pode fazê-lo no menu <u>Ajuda</u>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Clonagem em Progresso"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Clonando"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Shift"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Movendo {src} para {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Procurando por um ponto livre ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "Memórias {count} movidas"
+
+#: ../chirpui/clone.py:35
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} na {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Detectar"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Porta"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Fornecedor"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Modelo"
+
+#: ../chirpui/clone.py:138
+msgid "Radio"
+msgstr "Rádio"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Incapaz de detectar rádio na {port}"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Erro Interno: Incapaz de descarregar para {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Clonagem falhou: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Indicativo"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Seu indicativo"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Indicativo da Repetidora"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Meu indicativo"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Descarregando lista URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Descarregando lista RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Descarregando lista MYCALL"
+
+#: ../chirpui/editorset.py:87
+msgid "Memories"
+msgstr "Memórias"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Nomes do Banco"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Bancos"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "O {vendor} {model} tem vários sub-dispositivos independentes"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Selecionar um para importar de:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Cancelado"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Erro Interno"
+
+#: ../chirpui/editorset.py:248
+msgid "There were errors while opening {file}. The affected memories will not be importable!"
+msgstr "Houve erros ao abrir {file}. As memórias afetadas não serão importáveis!"
+
+#: ../chirpui/editorset.py:260
+msgid "There was an error during import: {error}"
+msgstr "Ocorreu um erro durante importação: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Tipo de arquivo não-suportado"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+msgid "There was an error during export: {error}"
+msgstr "Existiu um erro durante exportação: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Memória de escorva"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Valor Inválido para este campo"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Modo Tom"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Tom"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "TomSql"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "DTCS Code"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Modo Cross"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Duplex"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Offset"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Modo"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Power"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Tune Step"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Skip"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Apagando memória {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Incapaz de efetuar alterações para este modelo"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Editando novo item, tomando padrões"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Valor inválido para {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Erro gravando memória"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Gravando memória {number}"
+
+#: ../chirpui/memedit.py:361
+msgid "This operation requires moving all subsequent channels by one spot until an empty location is reached. This can take a LONG time. Are you sure you want to do this?"
+msgstr "Esta operação requer mover todos os canais subsequentes por um ponto, até que seja preenchido um local vazio. Isto pode levar MUITO tempo. Tem certeza de que quer fazer isto?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Adicionando memória {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Apagando memória {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Obtendo memória {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Movendo memória de {old} para {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Memória raw {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Obtendo memória raw {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "Você só pode diff duas memórias!"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Memória {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Diff de {a} e {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Memórias devem ser contíguas"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Inserir row acima"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Inserir row abaixo"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete"
+msgstr "Apagar"
+
+#: ../chirpui/memedit.py:702
+msgid "Delete all"
+msgstr "Apagar tudo"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Apagar (e deslocar)"
+
+#: ../chirpui/memedit.py:704
+msgid "Move up"
+msgstr "Mover acima"
+
+#: ../chirpui/memedit.py:705
+msgid "Move down"
+msgstr "Mover abaixo"
+
+#: ../chirpui/memedit.py:706
+msgid "Exchange memories"
+msgstr "Trocar memórias"
+
+#: ../chirpui/memedit.py:707
+msgid "Cut"
+msgstr "Cortar"
+
+#: ../chirpui/memedit.py:708
+msgid "Copy"
+msgstr "Copiar"
+
+#: ../chirpui/memedit.py:709
+msgid "Paste"
+msgstr "Colar"
+
+#: ../chirpui/memedit.py:710
+msgid "Show Raw Memory"
+msgstr "Mostrar Memória Raw"
+
+#: ../chirpui/memedit.py:711
+msgid "Diff Raw Memories"
+msgstr "Diff Memórias Raw"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Erro Interno: Coluna {name} não encontrada"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Obtendo canal {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Erro Interndo: limite Inválido {number}"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Intervalo de Memória"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Ir"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Canais Especiais"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Mostrar Vazias"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Cortando memória {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Sobrescrever?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Sobrescrever local {number}?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Memória Incompatível"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr "Memória colada {number} não é compatível com este rádio porque:"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Código Digital"
+
diff --git a/locale/pt_BR/LC_MESSAGES/CHIRP.mo b/locale/pt_BR/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 87bf37b..0000000
--- a/locale/pt_BR/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/ru.po b/locale/ru.po
new file mode 100644
index 0000000..24b76ef
--- /dev/null
+++ b/locale/ru.po
@@ -0,0 +1,907 @@
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: POEditor.com\n"
+"Project-Id-Version: CHIRP\n"
+"Language: ru\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Завершено"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "ожидание"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Получение информации"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Установка имени банка"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Банк"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Имя"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Обновление индекса банка в памяти {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Обновление информации банка в памяти {num}"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Получение из памяти {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Установка индекса для памяти {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Получение банка памяти {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "№"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Частота"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Индекс"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Получение информации банка для памяти {num}"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Получение информации из банка"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Ошибка"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Перезаписать"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Файл существует"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Файл {name} уже существует. Перезаписать его?"
+
+#: ../chirpui/importdialog.py:90
+msgid "Location {number} is already being imported. Choose another value for 'New Location' before selection 'Import'"
+msgstr "Позиция {number} уже импортирована. Выберите другое значение для \"Новая позиция\" перед выбором \"Импорт\""
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Неверное значение. Должно быть целое число."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "Позиция {number} уже импортирована"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Обновление URCALL"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Обновление RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Установка памяти {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Импорт информации банка"
+
+#: ../chirpui/importdialog.py:264
+#, fuzzy
+msgid "Error importing memories:"
+msgstr "Ошибка импорта памяти:"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Все"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Ничего"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Инверсия"
+
+#: ../chirpui/importdialog.py:394
+#, fuzzy
+msgid "Select"
+msgstr "Выбор"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Авто"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Обратный"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Новая позиция"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Подтверждение перезаписи"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Опции"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "Невозможно импортировать, поскольку"
+
+#: ../chirpui/importdialog.py:513
+#, fuzzy
+msgid "Import From File"
+msgstr "Импорт из файла"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Импорт"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "Для"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "От"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Комментарий"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "Позиция памяти будет импортирована в"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Позиция памяти в файле импортируется"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Подготовка списка памяти..."
+
+#: ../chirpui/importdialog.py:575
+#, fuzzy
+msgid "Export To File"
+msgstr "Экспорт в файл"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Экспорт"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Новый"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Образы памяти Chirp"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "CHIRP"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "CSV"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "ICF"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:330
+msgid "ICF files cannot be edited, only displayed or imported into another file. Open in read-only mode?"
+msgstr "Файлы ICF не могут быть отредактированы, возможно только показать или импортировать в другой файл. Открыть только для чтения?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Ошибка открытия {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} ошибки(ок) во время открытия:"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Заметка:"
+
+#: ../chirpui/mainapp.py:395
+msgid "The {vendor} {model} operates in <b>live mode</b>. This means that any changes you make are immediately sent to the radio. Because of this, you cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to edit the contents offline, please <u>Export</u> to a CSV file, using the <b>File menu</b>."
+msgstr "{vendor} {model} программируется в режиме <b>онлайн</b>. Это означает, что любые изменения немедленно загружаются в станцию. По этой причине невозможно использовать операции <u>Сохранить</u> или <u>Загрузить</u>. Если вы хотите редактировать данные офлайн, то используйте <u>Экспорт</u> в файл CSV из меню <b>Файл</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Не отображать снова"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "Изображение {vendor} {model}"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "VX7 Commander"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Открыть недавний файл {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Импорт предустановленную конфигурацию {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Открыть предустановленную конфигурацию {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Не сохранять изменения?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "Файл изменён, сохранить изменения?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "При значительном участии:"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Выбрать столбцы"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Видимые столбцы для {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Отчёты отключены"
+
+#: ../chirpui/mainapp.py:1013
+msgid "The reporting feature of CHIRP is designed to help <u>improve quality</u> by allowing the authors to focus on the radio drivers used most often and errors experienced by the users. The reports contain no identifying information and are used only for statistical purposes by the authors. Your privacy is extremely important, but <u>please consider leaving this feature enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr "Функция отправки отчётов позволяет авторам получать информацию об ошибках программы, чтобы своевремменно улучшать её для Вас. Никакой персональной информации при этом не собирается и не отправляется. Позволяя программе отправлять отчёты вы помогаете авторам в дальнейшем усовершенствовании программы.\n"
+"\n"
+"\n"
+"<b>Вы действительно хотите отключить эту функцию?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid "Choose a language or Auto to use the operating system default. You will need to restart the application before the change will take effect"
+msgstr "Выберите язык или Авто для использования языка операционной системы. Вам нужно будет перезапустить приложение, прежде чем изменения вступят в силу."
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Файл"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Открыть предустановленные конфигурации"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "_Недавние"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Правка"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Вырезать"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Копировать"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Вставить"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Удалить"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Вверх_"
+
+#: ../chirpui/mainapp.py:1184
+#, fuzzy
+msgid "Move Dow_n"
+msgstr "Вниз_"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "Обмен_"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "Вид_"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Столбцы"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Разработчик"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Show raw memory"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Diff raw memories"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Diff tabs"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Изменить язык"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Станция"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Чтение из станции"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Запись в станцию"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Импорт из RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "Файл CHIRP"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Импорт из RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+#, fuzzy
+msgid "Import from stock config"
+msgstr "Импорт из предустановленных конфигураций"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Справка"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Отправка статистики"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Скрыть неиспользуемые поля"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Авторазнос для репитера"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Режим разработчика"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Отчёты об ошибках включены"
+
+#: ../chirpui/mainapp.py:1355
+msgid "If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Отключить эту функцию можно в меню <u>Справка</u>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Загрузка"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Загрузка"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Отмена"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Сдвиг"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Перемещение {src} до {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Поиск свободной точки ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "Перемещенно {count} памяти"
+
+#: ../chirpui/clone.py:35
+#, fuzzy
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} на {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Проверка"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Порт"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Изготовитель"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Модель"
+
+#: ../chirpui/clone.py:138
+#, fuzzy
+msgid "Radio"
+msgstr "Станция"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Станция не обнаружена на {port}"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Ошибка: Невозможно загрузить в {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Ошибка загрузки {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Позывной"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Ваш позывной"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Позывной репитера"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Мой позывной"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Загрузка URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Загрузка RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Загрузка MYCALL"
+
+#: ../chirpui/editorset.py:87
+#, fuzzy
+msgid "Memories"
+msgstr "Память"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Имена банков"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Банки"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "{vendor} {model} имеет несколько различных подустройства"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Выберите один для импорта из:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Отменено"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Ошибка"
+
+#: ../chirpui/editorset.py:248
+msgid "There were errors while opening {file}. The affected memories will not be importable!"
+msgstr "Были обнаружены ошибки при открытии. Затронутая память не сможет быть импортирована."
+
+#: ../chirpui/editorset.py:260
+#, fuzzy
+msgid "There was an error during import: {error}"
+msgstr "Ошибка открытия{fname}: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Неподдерживаемый тип файла"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+#, fuzzy
+msgid "There was an error during export: {error}"
+msgstr "Ошибка открытия {fname}: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Первичная память"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Неверное значение для этого поля"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Вид субтона"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "ТонПРД"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "ТонШПД"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "DTCSПРД"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Кроссрежим"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Дуплекс"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Смещение"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Режим"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Мощность"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Шаг"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Пропуск"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Стирание памяти {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Невозможно внести изменения в эту модель"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Для новой позиции настройки по умолчанию"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Некорректное значение для {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Ошибка установки памяти"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "запись памяти {number}"
+
+#: ../chirpui/memedit.py:361
+msgid "This operation requires moving all subsequent channels by one spot until an empty location is reached. This can take a LONG time. Are you sure you want to do this?"
+msgstr "Эта операция потребует перемещения всех последующих каналов в одно место, пока свободное место не дудет достигнуто. Это может занять ОЧЕНЬ много времени. Вы уверены, что хотите это сделать?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Добавление памяти {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Стирание памяти {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Получение памяти {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Перемещение памяти из {old} в {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "Бинарная память {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Получение бинарной памяти {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "You can only diff two memories!"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Память {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Diff of {a} and {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Память должна быть непрерывной"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Вставка строки выше"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Вставка строки ниже"
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete"
+msgstr "_Удалить"
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete all"
+msgstr "_Удалить всё"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Удалить (и сдвинуть вверх)"
+
+#: ../chirpui/memedit.py:704
+#, fuzzy
+msgid "Move up"
+msgstr "Вверх"
+
+#: ../chirpui/memedit.py:705
+#, fuzzy
+msgid "Move down"
+msgstr "Вниз"
+
+#: ../chirpui/memedit.py:706
+#, fuzzy
+msgid "Exchange memories"
+msgstr "Обмен памяти"
+
+#: ../chirpui/memedit.py:707
+#, fuzzy
+msgid "Cut"
+msgstr "Вырезать"
+
+#: ../chirpui/memedit.py:708
+#, fuzzy
+msgid "Copy"
+msgstr "Копировать"
+
+#: ../chirpui/memedit.py:709
+#, fuzzy
+msgid "Paste"
+msgstr "Вставить"
+
+#: ../chirpui/memedit.py:710
+#, fuzzy
+msgid "Show Raw Memory"
+msgstr "Show Raw Memory\t"
+
+#: ../chirpui/memedit.py:711
+#, fuzzy
+msgid "Diff Raw Memories"
+msgstr "Diff raw memories"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Ошибка: Столбец {name} не найден"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Получение канала {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Ошибка: недопустимый предел {number}"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Диапазон каналов"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Ок"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Специальные каналы"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Показывать пустые"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Обрезка памяти {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Перезаписать?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Перезаписать расположение {number}?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Несовместимая память"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr "Вставленная память {number} не совместима с этой станцией, потому что:"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Цифровой код"
+
diff --git a/locale/ru/LC_MESSAGES/CHIRP.mo b/locale/ru/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index 2ddb97a..0000000
--- a/locale/ru/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/locale/uk_UA.po b/locale/uk_UA.po
new file mode 100644
index 0000000..a57ce2d
--- /dev/null
+++ b/locale/uk_UA.po
@@ -0,0 +1,917 @@
+# Ukrainian translations for CHIRP package.
+# Copyright (C) 2011 Dan Smith <dsmith@danplanet.com>
+# This file is distributed under the same license as the CHIRP package.
+# Dan Smith <dan@theine>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CHIRP\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-02-16 12:06-0800\n"
+"PO-Revision-Date: 2015-11-30 10:36+0200\n"
+"Last-Translator: laser <student.laser@gmail.com>\n"
+"Language-Team: laser <student.laser@gmail.com>\n"
+"Language: uk_UA\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../chirpui/common.py:204
+msgid "Completed"
+msgstr "Завершено"
+
+#: ../chirpui/common.py:205
+msgid "idle"
+msgstr "простоювання"
+
+#: ../chirpui/bankedit.py:52
+msgid "Retrieving bank information"
+msgstr "Отримання інформації банку"
+
+#: ../chirpui/bankedit.py:75
+msgid "Setting name on bank"
+msgstr "Настройка назви бана"
+
+#: ../chirpui/bankedit.py:85
+msgid "Bank"
+msgstr "Банк"
+
+#: ../chirpui/bankedit.py:86 ../chirpui/bankedit.py:240
+#: ../chirpui/importdialog.py:536 ../chirpui/memedit.py:65
+#: ../chirpui/memedit.py:85 ../chirpui/memedit.py:247
+#: ../chirpui/memedit.py:872 ../chirpui/memedit.py:926
+#: ../chirpui/memedit.py:1063 ../chirpui/memedit.py:1065
+msgid "Name"
+msgstr "Ім'я"
+
+#: ../chirpui/bankedit.py:185
+msgid "Updating bank index for memory {num}"
+msgstr "Оновлення індексу банку пам'яті {num}"
+
+#: ../chirpui/bankedit.py:194
+msgid "Updating bank information for memory {num}"
+msgstr "Оновлення інформації банку пам'яті {num}"
+
+#: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229
+msgid "Getting memory {num}"
+msgstr "Отримання пам'яті {num}"
+
+#: ../chirpui/bankedit.py:214
+msgid "Setting index for memory {num}"
+msgstr "Установка індексу для пам'яті {num}"
+
+#: ../chirpui/bankedit.py:223
+msgid "Getting bank for memory {num}"
+msgstr "Отримання банку пам'яті {num}"
+
+#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63
+#: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246
+#: ../chirpui/memedit.py:315 ../chirpui/memedit.py:335
+#: ../chirpui/memedit.py:349 ../chirpui/memedit.py:423
+#: ../chirpui/memedit.py:435 ../chirpui/memedit.py:459
+#: ../chirpui/memedit.py:461 ../chirpui/memedit.py:534
+#: ../chirpui/memedit.py:548 ../chirpui/memedit.py:550
+#: ../chirpui/memedit.py:591 ../chirpui/memedit.py:593
+#: ../chirpui/memedit.py:621 ../chirpui/memedit.py:822
+#: ../chirpui/memedit.py:870 ../chirpui/memedit.py:895
+#: ../chirpui/memedit.py:907 ../chirpui/memedit.py:924
+#: ../chirpui/memedit.py:1230
+msgid "Loc"
+msgstr "Loc"
+
+#: ../chirpui/bankedit.py:239 ../chirpui/importdialog.py:537
+#: ../chirpui/memedit.py:64 ../chirpui/memedit.py:86 ../chirpui/memedit.py:187
+#: ../chirpui/memedit.py:248 ../chirpui/memedit.py:271
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:304
+#: ../chirpui/memedit.py:873 ../chirpui/memedit.py:923
+msgid "Frequency"
+msgstr "Частота"
+
+#: ../chirpui/bankedit.py:241
+msgid "Index"
+msgstr "Зміст"
+
+#: ../chirpui/bankedit.py:302
+msgid "Getting bank information for memory {num}"
+msgstr "Отримання інформації банку для пам'яті {num}"
+
+#: ../chirpui/bankedit.py:323
+msgid "Getting bank information"
+msgstr "Отримання інформації банку"
+
+#: ../chirpui/inputdialog.py:81
+msgid "An error has occurred"
+msgstr "Сталася помилка"
+
+#: ../chirpui/inputdialog.py:130
+msgid "Overwrite"
+msgstr "Перезаписати"
+
+#: ../chirpui/inputdialog.py:133
+msgid "File Exists"
+msgstr "Файл існує"
+
+#: ../chirpui/inputdialog.py:136
+msgid "The file {name} already exists. Do you want to overwrite it?"
+msgstr "Файл {name} вже існує. Ви дійсно хочете перезаписати його?"
+
+#: ../chirpui/importdialog.py:90
+msgid "Location {number} is already being imported. Choose another value for 'New Location' before selection 'Import'"
+msgstr "Розташування {number} вже імпортуються. Виберіть інше значення для 'Нове розташування' перед вибором 'Імпорт'"
+
+#: ../chirpui/importdialog.py:121
+msgid "Invalid value. Must be an integer."
+msgstr "Неприпустиме значення. Повинно бути цілим числом."
+
+#: ../chirpui/importdialog.py:130
+msgid "Location {number} is already being imported"
+msgstr "Розташування {number} вже імпортованого"
+
+#: ../chirpui/importdialog.py:182
+msgid "Updating URCALL list"
+msgstr "Оновлення списку URCALL"
+
+#: ../chirpui/importdialog.py:187
+msgid "Updating RPTCALL list"
+msgstr "Оновлення списку RPTCALL"
+
+#: ../chirpui/importdialog.py:256
+msgid "Setting memory {number}"
+msgstr "Установка пам'яті {number}"
+
+#: ../chirpui/importdialog.py:260
+msgid "Importing bank information"
+msgstr "Імпортування інформації банку"
+
+#: ../chirpui/importdialog.py:264
+#, fuzzy
+msgid "Error importing memories:"
+msgstr "Помилка імпорту пам'яті:"
+
+#: ../chirpui/importdialog.py:376
+msgid "All"
+msgstr "Все"
+
+#: ../chirpui/importdialog.py:382
+msgid "None"
+msgstr "Не вказано"
+
+#: ../chirpui/importdialog.py:388
+msgid "Inverse"
+msgstr "Інверсія"
+
+#: ../chirpui/importdialog.py:394
+#, fuzzy
+msgid "Select"
+msgstr "Обрати"
+
+#: ../chirpui/importdialog.py:416
+msgid "Auto"
+msgstr "Авто"
+
+#: ../chirpui/importdialog.py:422
+msgid "Reverse"
+msgstr "Реверс"
+
+#: ../chirpui/importdialog.py:428
+msgid "Adjust New Location"
+msgstr "Настроїти нове розташування"
+
+#: ../chirpui/importdialog.py:438
+msgid "Confirm overwrites"
+msgstr "Підтвердіть заміну"
+
+#: ../chirpui/importdialog.py:444
+msgid "Options"
+msgstr "Опції"
+
+#: ../chirpui/importdialog.py:495
+msgid "Cannot be imported because"
+msgstr "Не можна імпортувати, оскільки"
+
+#: ../chirpui/importdialog.py:513
+#, fuzzy
+msgid "Import From File"
+msgstr "Імпортувати з файлу"
+
+#: ../chirpui/importdialog.py:514 ../chirpui/mainapp.py:1196
+msgid "Import"
+msgstr "Імпорт"
+
+#: ../chirpui/importdialog.py:534
+msgid "To"
+msgstr "До"
+
+#: ../chirpui/importdialog.py:535
+msgid "From"
+msgstr "З"
+
+#: ../chirpui/importdialog.py:538 ../chirpui/memedit.py:78
+#: ../chirpui/memedit.py:99 ../chirpui/memedit.py:886
+#: ../chirpui/memedit.py:940 ../chirpui/memedit.py:1068
+msgid "Comment"
+msgstr "Коментар"
+
+#: ../chirpui/importdialog.py:542
+msgid "Location memory will be imported into"
+msgstr "Розташування пам'яті буде імпортовано до"
+
+#: ../chirpui/importdialog.py:543
+msgid "Location of memory in the file being imported"
+msgstr "Розташування пам'яті у файлі, що імпортуються"
+
+#: ../chirpui/importdialog.py:566
+msgid "Preparing memory list..."
+msgstr "Підготовка списку пам'яті..."
+
+#: ../chirpui/importdialog.py:575
+#, fuzzy
+msgid "Export To File"
+msgstr "Експорт до файлу"
+
+#: ../chirpui/importdialog.py:576 ../chirpui/mainapp.py:1197
+msgid "Export"
+msgstr "Експорт"
+
+#: ../chirpui/mainapp.py:269 ../chirpui/mainapp.py:483
+msgid "Untitled"
+msgstr "Без назви"
+
+#: ../chirpui/mainapp.py:316 ../chirpui/mainapp.py:715
+msgid "CHIRP Radio Images"
+msgstr "Образи радіостанцій CHIRP"
+
+#: ../chirpui/mainapp.py:317 ../chirpui/mainapp.py:714
+#: ../chirpui/mainapp.py:880
+msgid "CHIRP Files"
+msgstr "CHIRP файли"
+
+#: ../chirpui/mainapp.py:318 ../chirpui/mainapp.py:716
+#: ../chirpui/mainapp.py:879
+msgid "CSV Files"
+msgstr "CSV-файли"
+
+#: ../chirpui/mainapp.py:319 ../chirpui/mainapp.py:717
+msgid "ICF Files"
+msgstr "ICF файли"
+
+#: ../chirpui/mainapp.py:320 ../chirpui/mainapp.py:718
+msgid "VX7 Commander Files"
+msgstr "Файли VX7 командира"
+
+#: ../chirpui/mainapp.py:330
+msgid "ICF files cannot be edited, only displayed or imported into another file. Open in read-only mode?"
+msgstr "ICF файли не можна редагувати, тільки відобразити або імпортувати. Відкрити в режимі тільки для читання?"
+
+#: ../chirpui/mainapp.py:373
+msgid "There was an error opening {fname}: {error}"
+msgstr "Сталася помилка при відкритті {fname}: {error}"
+
+#: ../chirpui/mainapp.py:388
+msgid "{num} errors during open:"
+msgstr "{num} помилки під час відкриття:"
+
+#: ../chirpui/mainapp.py:394
+msgid "Note:"
+msgstr "Примітка:"
+
+#: ../chirpui/mainapp.py:395
+msgid "The {vendor} {model} operates in <b>live mode</b>. This means that any changes you make are immediately sent to the radio. Because of this, you cannot perform the <u>Save</u> or <u>Upload</u> operations. If you wish to edit the contents offline, please <u>Export</u> to a CSV file, using the <b>File menu</b>."
+msgstr "{vendor} {model} працює в <b>режимі реального часу</b>. Це означає, що будь-які зміни негайно відправляються на радіостанцію. Через це не вдалося виконати <u>Збереження</u> або <u>Запис</u> операцій. Якщо ви хочете редагувати вміст в автономному режимі, будь ласка, <u>Експортуйте</u> файл CSV, за допомогою <b>Меню Файл</b>."
+
+#: ../chirpui/mainapp.py:404
+msgid "Don't show this again"
+msgstr "Не показувати наступного разу"
+
+#: ../chirpui/mainapp.py:448
+msgid "{vendor} {model} image file"
+msgstr "файлу образу {vendor} {model}"
+
+#: ../chirpui/mainapp.py:456
+msgid "VX7 Commander"
+msgstr "Командир VX7"
+
+#: ../chirpui/mainapp.py:518
+msgid "Open recent file {name}"
+msgstr "Відкриті останній файл {name}"
+
+#: ../chirpui/mainapp.py:579
+msgid "Import stock configuration {name}"
+msgstr "Імпорт заводської конфігурації {name}"
+
+#: ../chirpui/mainapp.py:595
+msgid "Open stock configuration {name}"
+msgstr "Відкрите заводські конфігурації {name}"
+
+#: ../chirpui/mainapp.py:681
+msgid "Discard Changes?"
+msgstr "Скасувати зміни?"
+
+#: ../chirpui/mainapp.py:686
+msgid "File is modified, save changes before closing?"
+msgstr "Файл змінено, зберегти зміни перед закриттям?"
+
+#: ../chirpui/mainapp.py:923
+msgid "With significant contributions by:"
+msgstr "Значні внески зробили:"
+
+#: ../chirpui/mainapp.py:940
+msgid "Select Columns"
+msgstr "Виберіть Стовпці"
+
+#: ../chirpui/mainapp.py:955
+msgid "Visible columns for {radio}"
+msgstr "Видимі стовпці для {radio}"
+
+#: ../chirpui/mainapp.py:1012
+msgid "Reporting is disabled"
+msgstr "Звіти вимкнуто"
+
+#: ../chirpui/mainapp.py:1013
+msgid "The reporting feature of CHIRP is designed to help <u>improve quality</u> by allowing the authors to focus on the radio drivers used most often and errors experienced by the users. The reports contain no identifying information and are used only for statistical purposes by the authors. Your privacy is extremely important, but <u>please consider leaving this feature enabled to help make CHIRP better!</u>\n"
+"\n"
+"<b>Are you sure you want to disable this feature?</b>"
+msgstr "Функцію звітування CHIRP розроблено, щоб допомогти <u>поліпшити якість</u>, дозволяючи авторам зосередитися на драйверах радіостанцій, що найчастіше використовується і помилках досвідчених користувачів. Звіти не містять ідентифікаційну інформацію і використовуються тільки для статистичних цілей авторів. Ваша конфіденційність є надзвичайно важлива, але <u>будь ласка, залиште цю функцію включеною, щоб допомогти зробити CHIRP краще!</u>\n"
+"\n"
+"<b>ви впевнені, що хочете відключити цю функцію?</b>"
+
+#: ../chirpui/mainapp.py:1045
+msgid "Choose a language or Auto to use the operating system default. You will need to restart the application before the change will take effect"
+msgstr "Виберіть мову або авто для використання в операційній системі. Вам потрібно буде перезапустити додаток до того, як зміни вступлять в силу"
+
+#: ../chirpui/mainapp.py:1169
+msgid "_File"
+msgstr "_Файл"
+
+#: ../chirpui/mainapp.py:1172
+msgid "Open stock config"
+msgstr "Відкрити заводські конфігурації"
+
+#: ../chirpui/mainapp.py:1173
+msgid "_Recent"
+msgstr "Ос_танні"
+
+#: ../chirpui/mainapp.py:1178
+msgid "_Edit"
+msgstr "_Редагувати"
+
+#: ../chirpui/mainapp.py:1179
+msgid "_Cut"
+msgstr "_Вирізати"
+
+#: ../chirpui/mainapp.py:1180
+msgid "_Copy"
+msgstr "_Копіювати"
+
+#: ../chirpui/mainapp.py:1181
+msgid "_Paste"
+msgstr "_Вставити"
+
+#: ../chirpui/mainapp.py:1182
+msgid "_Delete"
+msgstr "_Видалити"
+
+#: ../chirpui/mainapp.py:1183
+msgid "Move _Up"
+msgstr "Перемістити В_гору"
+
+#: ../chirpui/mainapp.py:1184
+#, fuzzy
+msgid "Move Dow_n"
+msgstr "Перемістити В_низ"
+
+#: ../chirpui/mainapp.py:1185
+msgid "E_xchange"
+msgstr "_Обмін"
+
+#: ../chirpui/mainapp.py:1186
+msgid "_View"
+msgstr "В_игляд"
+
+#: ../chirpui/mainapp.py:1187
+msgid "Columns"
+msgstr "Стовпці"
+
+#: ../chirpui/mainapp.py:1188
+msgid "Developer"
+msgstr "Розробник"
+
+#: ../chirpui/mainapp.py:1189
+msgid "Show raw memory"
+msgstr "Показати raw пам'ять"
+
+#: ../chirpui/mainapp.py:1190
+msgid "Diff raw memories"
+msgstr "Порівняти raw пам'ять"
+
+#: ../chirpui/mainapp.py:1191
+msgid "Diff tabs"
+msgstr "Вкладки порівняння"
+
+#: ../chirpui/mainapp.py:1192
+msgid "Change language"
+msgstr "Змінити мову"
+
+#: ../chirpui/mainapp.py:1193
+msgid "_Radio"
+msgstr "_Радіостанція"
+
+#: ../chirpui/mainapp.py:1194
+msgid "Download From Radio"
+msgstr "Скопіювати з радіостанції"
+
+#: ../chirpui/mainapp.py:1195
+msgid "Upload To Radio"
+msgstr "Записати в радіостанцію"
+
+#: ../chirpui/mainapp.py:1198
+msgid "Import from RFinder"
+msgstr "Імпорт з RFinder"
+
+#: ../chirpui/mainapp.py:1199
+msgid "CHIRP Native File"
+msgstr "Файл CHIRP"
+
+#: ../chirpui/mainapp.py:1200
+msgid "CSV File"
+msgstr "Файл CSV"
+
+#: ../chirpui/mainapp.py:1201
+msgid "Import from RepeaterBook"
+msgstr "Імпорт з RepeaterBook"
+
+#: ../chirpui/mainapp.py:1202
+#, fuzzy
+msgid "Import from stock config"
+msgstr "Імпорт з сховища конфігурацій"
+
+#: ../chirpui/mainapp.py:1204
+msgid "Help"
+msgstr "Довідка"
+
+#: ../chirpui/mainapp.py:1215
+msgid "Report statistics"
+msgstr "Звіт статистики"
+
+#: ../chirpui/mainapp.py:1216
+msgid "Hide Unused Fields"
+msgstr "Приховувати невикористовувані поля"
+
+#: ../chirpui/mainapp.py:1217
+msgid "Automatic Repeater Offset"
+msgstr "Автоматичний рознос репітера"
+
+#: ../chirpui/mainapp.py:1218
+msgid "Enable Developer Functions"
+msgstr "Увімкнення функції розробника"
+
+#: ../chirpui/mainapp.py:1352
+msgid "Error reporting is enabled"
+msgstr "Звітування про критичні помилки ввімкнуто"
+
+#: ../chirpui/mainapp.py:1355
+msgid "If you wish to disable this feature you may do so in the <u>Help</u> menu"
+msgstr "Якщо ви хочете вимкнути цю функцію, ви можете зробити це в меню <u>Довідка</u>"
+
+#: ../chirpui/cloneprog.py:43
+msgid "Clone Progress"
+msgstr "Поступ клонування"
+
+#: ../chirpui/cloneprog.py:46
+msgid "Cloning"
+msgstr "Клонування"
+
+#: ../chirpui/cloneprog.py:55
+msgid "Cancel"
+msgstr "Скасувати"
+
+#: ../chirpui/shiftdialog.py:27
+msgid "Shift"
+msgstr "Зміщення"
+
+#: ../chirpui/shiftdialog.py:63
+msgid "Moving {src} to {dst}"
+msgstr "Переміщення {src} до {dst}"
+
+#: ../chirpui/shiftdialog.py:80
+msgid "Looking for a free spot ({number})"
+msgstr "Пошук вільної точки ({number})"
+
+#: ../chirpui/shiftdialog.py:135
+msgid "Moved {count} memories"
+msgstr "Перемещенно {count} записів пам'яті"
+
+#: ../chirpui/clone.py:35
+#, fuzzy
+msgid "{vendor} {model} on {port}"
+msgstr "{vendor} {model} на {port}"
+
+#: ../chirpui/clone.py:100 ../chirpui/clone.py:162
+msgid "Detect"
+msgstr "Визначити"
+
+#: ../chirpui/clone.py:123
+msgid "Port"
+msgstr "Порт"
+
+#: ../chirpui/clone.py:124
+msgid "Vendor"
+msgstr "Виробник"
+
+#: ../chirpui/clone.py:125
+msgid "Model"
+msgstr "Модель"
+
+#: ../chirpui/clone.py:138
+#, fuzzy
+msgid "Radio"
+msgstr "Радіостанція"
+
+#: ../chirpui/clone.py:166
+msgid "Unable to detect radio on {port}"
+msgstr "Не вдалося виявити радіо на {port}"
+
+#: ../chirpui/clone.py:178
+msgid "Internal error: Unable to upload to {model}"
+msgstr "Внутрішня помилка: не вдалося записати на {model}"
+
+#: ../chirpui/clone.py:226
+msgid "Clone failed: {error}"
+msgstr "Помилка клонування: {error}"
+
+#: ../chirpui/dstaredit.py:40
+msgid "Callsign"
+msgstr "Позивний"
+
+#: ../chirpui/dstaredit.py:124
+msgid "Your callsign"
+msgstr "Ваш позивний"
+
+#: ../chirpui/dstaredit.py:132
+msgid "Repeater callsign"
+msgstr "Позивний репітера"
+
+#: ../chirpui/dstaredit.py:140
+msgid "My callsign"
+msgstr "Мій позивний"
+
+#: ../chirpui/dstaredit.py:170 ../chirpui/memedit.py:1365
+msgid "Downloading URCALL list"
+msgstr "Завантаження списку URCALL"
+
+#: ../chirpui/dstaredit.py:174 ../chirpui/memedit.py:1377
+msgid "Downloading RPTCALL list"
+msgstr "Завантаження списку RPTCALL"
+
+#: ../chirpui/dstaredit.py:178
+msgid "Downloading MYCALL list"
+msgstr "Завантаження списку MYCALL"
+
+#: ../chirpui/editorset.py:87
+#, fuzzy
+msgid "Memories"
+msgstr "Пам'ять"
+
+#: ../chirpui/editorset.py:92
+msgid "D-STAR"
+msgstr "D-STAR"
+
+#: ../chirpui/editorset.py:98
+msgid "Bank Names"
+msgstr "Імена банків"
+
+#: ../chirpui/editorset.py:104
+msgid "Banks"
+msgstr "Банки"
+
+#: ../chirpui/editorset.py:222
+msgid "The {vendor} {model} has multiple independent sub-devices"
+msgstr "{vendor} {model} має кілька незалежних суб пристроїв"
+
+#: ../chirpui/editorset.py:225
+msgid "Choose one to import from:"
+msgstr "Виберіть один для Імпорту з:"
+
+#: ../chirpui/editorset.py:230
+msgid "Cancelled"
+msgstr "Скасовано"
+
+#: ../chirpui/editorset.py:235
+msgid "Internal Error"
+msgstr "Внутрішня помилка"
+
+#: ../chirpui/editorset.py:248
+msgid "There were errors while opening {file}. The affected memories will not be importable!"
+msgstr "Там були помилки при відкритті {file}. Порушена пам'ять не буде імпортована!"
+
+#: ../chirpui/editorset.py:260
+msgid "There was an error during import: {error}"
+msgstr "Виникла помилка під час імпортування: {error}"
+
+#: ../chirpui/editorset.py:270
+msgid "Unsupported file type"
+msgstr "Файл непідтримуваного типу"
+
+#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301
+#, fuzzy
+msgid "There was an error during export: {error}"
+msgstr "Виникла помилка під час експортування: {error}"
+
+#: ../chirpui/editorset.py:313
+msgid "Priming memory"
+msgstr "Первинна пам'ять"
+
+#: ../chirpui/memedit.py:52
+msgid "Invalid value for this field"
+msgstr "Неприпустиме значення для цього поля"
+
+#: ../chirpui/memedit.py:66 ../chirpui/memedit.py:97 ../chirpui/memedit.py:111
+#: ../chirpui/memedit.py:204 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:874 ../chirpui/memedit.py:931
+#: ../chirpui/memedit.py:1069 ../chirpui/memedit.py:1133
+msgid "Tone Mode"
+msgstr "Тоновий режим"
+
+#: ../chirpui/memedit.py:67 ../chirpui/memedit.py:87 ../chirpui/memedit.py:103
+#: ../chirpui/memedit.py:214 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:220 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:875 ../chirpui/memedit.py:928
+#: ../chirpui/memedit.py:1070
+msgid "Tone"
+msgstr "Тон"
+
+#: ../chirpui/memedit.py:68 ../chirpui/memedit.py:88 ../chirpui/memedit.py:104
+#: ../chirpui/memedit.py:210 ../chirpui/memedit.py:218
+#: ../chirpui/memedit.py:221 ../chirpui/memedit.py:310
+#: ../chirpui/memedit.py:876 ../chirpui/memedit.py:929
+#: ../chirpui/memedit.py:1066
+msgid "ToneSql"
+msgstr "ToneSql"
+
+#: ../chirpui/memedit.py:69 ../chirpui/memedit.py:89 ../chirpui/memedit.py:105
+#: ../chirpui/memedit.py:211 ../chirpui/memedit.py:215
+#: ../chirpui/memedit.py:222 ../chirpui/memedit.py:306
+#: ../chirpui/memedit.py:877 ../chirpui/memedit.py:930
+#: ../chirpui/memedit.py:1059
+msgid "DTCS Code"
+msgstr "DTCS код"
+
+#: ../chirpui/memedit.py:70 ../chirpui/memedit.py:90 ../chirpui/memedit.py:106
+#: ../chirpui/memedit.py:212 ../chirpui/memedit.py:216
+#: ../chirpui/memedit.py:223 ../chirpui/memedit.py:878
+#: ../chirpui/memedit.py:933 ../chirpui/memedit.py:1060
+msgid "DTCS Pol"
+msgstr "DTCS Pol"
+
+#: ../chirpui/memedit.py:71 ../chirpui/memedit.py:91 ../chirpui/memedit.py:112
+#: ../chirpui/memedit.py:879 ../chirpui/memedit.py:932
+#: ../chirpui/memedit.py:1067 ../chirpui/memedit.py:1134
+msgid "Cross Mode"
+msgstr "Кросрежим"
+
+#: ../chirpui/memedit.py:72 ../chirpui/memedit.py:92 ../chirpui/memedit.py:109
+#: ../chirpui/memedit.py:137 ../chirpui/memedit.py:205
+#: ../chirpui/memedit.py:249 ../chirpui/memedit.py:312
+#: ../chirpui/memedit.py:880 ../chirpui/memedit.py:934
+#: ../chirpui/memedit.py:1071 ../chirpui/memedit.py:1144
+msgid "Duplex"
+msgstr "Дуплекс"
+
+#: ../chirpui/memedit.py:73 ../chirpui/memedit.py:93 ../chirpui/memedit.py:135
+#: ../chirpui/memedit.py:198 ../chirpui/memedit.py:226
+#: ../chirpui/memedit.py:250 ../chirpui/memedit.py:308
+#: ../chirpui/memedit.py:881 ../chirpui/memedit.py:935
+#: ../chirpui/memedit.py:1062
+msgid "Offset"
+msgstr "Зсув"
+
+#: ../chirpui/memedit.py:74 ../chirpui/memedit.py:94 ../chirpui/memedit.py:107
+#: ../chirpui/memedit.py:882 ../chirpui/memedit.py:936
+#: ../chirpui/memedit.py:1061 ../chirpui/memedit.py:1132
+#: ../chirpui/memedit.py:1289 ../chirpui/memedit.py:1307
+#: ../chirpui/memedit.py:1317
+msgid "Mode"
+msgstr "Режим"
+
+#: ../chirpui/memedit.py:75 ../chirpui/memedit.py:95 ../chirpui/memedit.py:108
+#: ../chirpui/memedit.py:296 ../chirpui/memedit.py:883
+#: ../chirpui/memedit.py:937 ../chirpui/memedit.py:1073
+#: ../chirpui/memedit.py:1136 ../chirpui/memedit.py:1140
+msgid "Power"
+msgstr "Потужність"
+
+#: ../chirpui/memedit.py:76 ../chirpui/memedit.py:96 ../chirpui/memedit.py:110
+#: ../chirpui/memedit.py:140 ../chirpui/memedit.py:143
+#: ../chirpui/memedit.py:884 ../chirpui/memedit.py:938
+#: ../chirpui/memedit.py:1064
+msgid "Tune Step"
+msgstr "Крок настройки"
+
+#: ../chirpui/memedit.py:77 ../chirpui/memedit.py:98 ../chirpui/memedit.py:885
+#: ../chirpui/memedit.py:939 ../chirpui/memedit.py:1072
+#: ../chirpui/memedit.py:1135
+msgid "Skip"
+msgstr "Пропустити"
+
+#: ../chirpui/memedit.py:175
+msgid "Erasing memory {loc}"
+msgstr "Стирання пам'яті {loc}"
+
+#: ../chirpui/memedit.py:236
+msgid "Unable to make changes to this model"
+msgstr "Не вдається внести зміни до цієї моделі"
+
+#: ../chirpui/memedit.py:241
+msgid "Editing new item, taking defaults"
+msgstr "Редагування нового елемента, беручи за замовчуванням"
+
+#: ../chirpui/memedit.py:257
+msgid "Bad value for {col}: {val}"
+msgstr "Погане значення для {col}: {val}"
+
+#: ../chirpui/memedit.py:281
+msgid "Error setting memory"
+msgstr "Помилка настройки пам'яті"
+
+#: ../chirpui/memedit.py:289 ../chirpui/memedit.py:356
+#: ../chirpui/memedit.py:1272
+msgid "Writing memory {number}"
+msgstr "Запис пам'яті {number}"
+
+#: ../chirpui/memedit.py:361
+msgid "This operation requires moving all subsequent channels by one spot until an empty location is reached. This can take a LONG time. Are you sure you want to do this?"
+msgstr "Ця операція вимагає переміщення всіх наступних каналів на одне місце до тих пір, поки пусте місце не буде досягнуто. Це може зайняти багато часу. Ви впевнені, що хочете це зробити?"
+
+#: ../chirpui/memedit.py:387
+msgid "Adding memory {number}"
+msgstr "Додавання пам'яті {number}"
+
+#: ../chirpui/memedit.py:400 ../chirpui/memedit.py:913
+msgid "Erasing memory {number}"
+msgstr "Стирання пам'яті {number}"
+
+#: ../chirpui/memedit.py:409 ../chirpui/memedit.py:518
+#: ../chirpui/memedit.py:564 ../chirpui/memedit.py:569
+#: ../chirpui/memedit.py:856 ../chirpui/memedit.py:1166
+msgid "Getting memory {number}"
+msgstr "Отримання пам'яті {number}"
+
+#: ../chirpui/memedit.py:497 ../chirpui/memedit.py:508
+#: ../chirpui/memedit.py:556
+msgid "Moving memory from {old} to {new}"
+msgstr "Переміщення пам'яті з {old} до {new}"
+
+#: ../chirpui/memedit.py:578
+msgid "Raw memory {number}"
+msgstr "RAW пам'ять {number}"
+
+#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610
+#: ../chirpui/memedit.py:615
+msgid "Getting raw memory {number}"
+msgstr "Отримання RAW пам'яті {number}"
+
+#: ../chirpui/memedit.py:587
+msgid "You can only diff two memories!"
+msgstr "Ви можете порівняти тільки дві пам'яті!"
+
+#: ../chirpui/memedit.py:598
+msgid "Memory {number}"
+msgstr "Пам'ять {number}"
+
+#: ../chirpui/memedit.py:604
+msgid "Diff of {a} and {b}"
+msgstr "Порівняння {a} та {b}"
+
+#: ../chirpui/memedit.py:628
+msgid "Memories must be contiguous"
+msgstr "Пам'ять має бути безперервна"
+
+#: ../chirpui/memedit.py:700
+msgid "Insert row above"
+msgstr "Додати рядок зверху"
+
+#: ../chirpui/memedit.py:701
+msgid "Insert row below"
+msgstr "Додати рядок знизу"
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete"
+msgstr "Видалити"
+
+#: ../chirpui/memedit.py:702
+#, fuzzy
+msgid "Delete all"
+msgstr "Видалити все"
+
+#: ../chirpui/memedit.py:703
+msgid "Delete (and shift up)"
+msgstr "Видалити (та зсунути вгору)"
+
+#: ../chirpui/memedit.py:704
+#, fuzzy
+msgid "Move up"
+msgstr "Перемістити вгору"
+
+#: ../chirpui/memedit.py:705
+#, fuzzy
+msgid "Move down"
+msgstr "Перемістити вниз"
+
+#: ../chirpui/memedit.py:706
+#, fuzzy
+msgid "Exchange memories"
+msgstr "Обмін пам'яттю"
+
+#: ../chirpui/memedit.py:707
+#, fuzzy
+msgid "Cut"
+msgstr "Вирізати"
+
+#: ../chirpui/memedit.py:708
+#, fuzzy
+msgid "Copy"
+msgstr "Копіювати"
+
+#: ../chirpui/memedit.py:709
+#, fuzzy
+msgid "Paste"
+msgstr "Вставити"
+
+#: ../chirpui/memedit.py:710
+#, fuzzy
+msgid "Show Raw Memory"
+msgstr "Показати Raw пам'ять"
+
+#: ../chirpui/memedit.py:711
+#, fuzzy
+msgid "Diff Raw Memories"
+msgstr "Порівняти Raw пам'ять"
+
+#: ../chirpui/memedit.py:835
+msgid "Internal Error: Column {name} not found"
+msgstr "Внутрішня помилка: не знайдено стовпець {name}"
+
+#: ../chirpui/memedit.py:863
+msgid "Getting channel {chan}"
+msgstr "Отримання каналу {chan}"
+
+#: ../chirpui/memedit.py:952
+msgid "Internal Error: Invalid limit {number}"
+msgstr "Внутрішня помилка: Неприпустиме обмеження {number}"
+
+#: ../chirpui/memedit.py:962
+msgid "Memory range:"
+msgstr "Діапазон пам'яті:"
+
+#: ../chirpui/memedit.py:989
+msgid "Go"
+msgstr "Іти"
+
+#: ../chirpui/memedit.py:1012
+msgid "Special Channels"
+msgstr "Спеціальні канали"
+
+#: ../chirpui/memedit.py:1019
+msgid "Show Empty"
+msgstr "Показувати порожні"
+
+#: ../chirpui/memedit.py:1198
+msgid "Cutting memory {number}"
+msgstr "Отримання пам'яті {number}"
+
+#: ../chirpui/memedit.py:1232
+msgid "Overwrite?"
+msgstr "Перезаписати?"
+
+#: ../chirpui/memedit.py:1237
+msgid "Overwrite location {number}?"
+msgstr "Перезаписати місце {number}?"
+
+#: ../chirpui/memedit.py:1254
+msgid "Incompatible Memory"
+msgstr "Несумісна пам'ять"
+
+#: ../chirpui/memedit.py:1257
+msgid "Pasted memory {number} is not compatible with this radio because:"
+msgstr "Вставлена пам'ять {number} несумісна із цією радіостанцією тому що:"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1324
+msgid "URCALL"
+msgstr "URCALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1325
+msgid "RPT1CALL"
+msgstr "RPT1CALL"
+
+#: ../chirpui/memedit.py:1309 ../chirpui/memedit.py:1326
+msgid "RPT2CALL"
+msgstr "RPT2CALL"
+
+#: ../chirpui/memedit.py:1310 ../chirpui/memedit.py:1327
+msgid "Digital Code"
+msgstr "Цифровий код"
+
+#~ msgid "%i errors during open, check the debug log for details"
+#~ msgstr "%i errors during open, check the debug log for details"
diff --git a/locale/uk_UA/LC_MESSAGES/CHIRP.mo b/locale/uk_UA/LC_MESSAGES/CHIRP.mo
deleted file mode 100644
index b388648..0000000
--- a/locale/uk_UA/LC_MESSAGES/CHIRP.mo
+++ /dev/null
Binary files differ
diff --git a/pylintrc b/pylintrc
new file mode 100644
index 0000000..b622882
--- /dev/null
+++ b/pylintrc
@@ -0,0 +1,249 @@
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add files or directories to the blacklist. They should be base names, not
+# paths.
+ignore=CVS
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable the message, report, category or checker with the given id(s). You can
+# either give multiple identifier separated by comma (,) or put this option
+# multiple time.
+#enable=
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifier separated by comma (,) or put this option
+# multiple time (only on the command line, not in the configuration file where
+# it should appear only once).
+#disable=
+
+
+[REPORTS]
+
+# Set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+output-format=text
+
+# Include message's id in output
+include-ids=no
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells whether to display a full report or only the messages
+reports=yes
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note). You have access to the variables errors warning, statement which
+# respectively contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (RP0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (RP0004).
+comment=no
+
+
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+
+[FORMAT]
+
+# Maximum number of characters on a single line.
+max-line-length=80
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+# tab).
+indent-string=' '
+
+
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
+
+
+[TYPECHECK]
+
+# Tells whether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamically set).
+ignored-classes=SQLObject
+
+# When zope mode is activated, add a predefined set of Zope acquired attributes
+# to generated-members.
+zope=no
+
+# List of members which are set dynamically and missed by pylint inference
+# system, and so shouldn't trigger E0201 when accessed. Python regular
+# expressions are accepted.
+generated-members=REQUEST,acl_users,aq_parent
+
+
+[VARIABLES]
+
+# Tells whether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching the beginning of the name of dummy variables
+# (i.e. not used).
+dummy-variables-rgx=_|dummy|foo
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=map,filter,apply,input
+
+# Regular expression which should only match correct module names
+module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct method names
+method-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct argument names
+argument-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct variable names
+variable-rgx=[a-z_][a-z0-9_]{1,30}$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,j,k,v,f,e,ex,Run,_
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=bar,baz,toto,tutu,tata
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+no-docstring-rgx=__.*__|_.*
+
+
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Argument names that match this expression will be ignored. Default to name
+# with leading underscore
+ignored-argument-names=_.*
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=20
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=25
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=0
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=40
+
+
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+# List of valid names for the first argument in a class method.
+valid-classmethod-first-arg=cls
+
+
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report RP0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report RP0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report RP0402 must
+# not be disabled)
+int-import-graph=
+
+
+[EXCEPTIONS]
+
+# Exceptions that will emit a warning when being caught. Defaults to
+# "Exception"
+overgeneral-exceptions=Exception
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..e7fcfa9
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,4 @@
+six
+PyGObject;python_version>="3.0"
+pyserial
+future
diff --git a/run_all_tests.bat b/run_all_tests.bat
new file mode 100644
index 0000000..399ed54
--- /dev/null
+++ b/run_all_tests.bat
@@ -0,0 +1,3 @@
+@echo off
+python tests\run_tests.py
+python tools\cpep8.py
diff --git a/setup.py b/setup.py
index 837d4e6..e403d91 100644
--- a/setup.py
+++ b/setup.py
@@ -1,30 +1,34 @@
-import sys
+from __future__ import print_function
+import sys
+import glob
import os
from chirp import CHIRP_VERSION
-from chirp.drivers import *
import chirp
+from chirp import directory
+
+directory.safe_import_drivers()
def staticify_chirp_module():
import chirp
- with file("chirp/__init__.py", "w") as init:
- print >>init, "CHIRP_VERSION = \"%s\"" % CHIRP_VERSION
- print >>init, "__all__ = %s\n" % str(chirp.__all__)
+ with open("chirp/__init__.py", "w") as init:
+ print("CHIRP_VERSION = \"%s\"" % CHIRP_VERSION, file=init)
+ print("__all__ = %s\n" % str(chirp.__all__), file=init)
- print "Set chirp/__init__.py::__all__ = %s" % str(chirp.__all__)
+ print("Set chirp/__init__.py::__all__ = %s" % str(chirp.__all__))
def staticify_drivers_module():
import chirp.drivers
with file("chirp/drivers/__init__.py", "w") as init:
- print >>init, "__all__ = %s\n" % str(chirp.drivers.__all__)
+ print("__all__ = %s\n" % str(chirp.drivers.__all__), file=init)
- print "Set chirp/drivers/__init__.py::__all__ = %s" % str(
- chirp.drivers.__all__)
+ print("Set chirp/drivers/__init__.py::__all__ = %s" % str(
+ chirp.drivers.__all__))
def win32_build():
@@ -117,15 +121,16 @@ def default_build():
for f in _locale_files:
locale_files.append(("share/chirp/%s" % os.path.dirname(f), [f]))
- print "LOC: %s" % str(locale_files)
+ print("LOC: %s" % str(locale_files))
xsd_files = glob("chirp*.xsd")
setup(
name="chirp",
- packages=["chirp", "chirp.drivers", "chirp.ui"],
+ packages=["chirp", "chirp.drivers", "chirp.ui", "tests", "tests.unit",
+ "chirp.wxui"],
version=CHIRP_VERSION,
- scripts=["chirpw", "rpttool"],
+ scripts=["chirpw", "rpttool", "chirpwx.py"],
data_files=[('share/applications', desktop_files),
('share/chirp/images', image_files),
('share/chirp', xsd_files),
@@ -146,7 +151,7 @@ def nuke_manifest(*files):
f = file("MANIFEST.in", "w")
for fn in files:
- print >>f, fn
+ print(fn, file=f)
f.close()
diff --git a/share/chirp.icns b/share/chirp.icns
new file mode 100644
index 0000000..2ac96be
--- /dev/null
+++ b/share/chirp.icns
Binary files differ
diff --git a/share/chirp.svg b/share/chirp.svg
new file mode 100644
index 0000000..38d0d05
--- /dev/null
+++ b/share/chirp.svg
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="256"
+ height="256"
+ id="svg3773"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="icon.svg"
+ inkscape:export-filename="/home/dan/chirp/share/chirp_icon.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs3775">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4534">
+ <stop
+ style="stop-color:#cccccc;stop-opacity:1;"
+ offset="0"
+ id="stop4536" />
+ <stop
+ style="stop-color:#cccccc;stop-opacity:0;"
+ offset="1"
+ id="stop4538" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective3781" />
+ <inkscape:perspective
+ id="perspective3791"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3918"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4534"
+ id="linearGradient4540"
+ x1="53.92857"
+ y1="895.57648"
+ x2="258.29047"
+ y2="978.07648"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1149719,0,0,1.1149719,-14.716407,-106.21001)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4534"
+ id="linearGradient4581"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1149719,0,0,1.1149719,-14.716407,-106.21001)"
+ x1="53.92857"
+ y1="895.57648"
+ x2="258.29047"
+ y2="978.07648" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4534"
+ id="linearGradient3870"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.1149719,0,0,1.1149719,-14.716406,-105.63857)"
+ x1="53.92857"
+ y1="895.57648"
+ x2="258.29047"
+ y2="978.07648" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.979899"
+ inkscape:cx="111.6916"
+ inkscape:cy="154.81709"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1111"
+ inkscape:window-height="898"
+ inkscape:window-x="1"
+ inkscape:window-y="51"
+ inkscape:window-maximized="0"
+ borderlayer="true" />
+ <metadata
+ id="metadata3778">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-796.36218)">
+ <rect
+ ry="15.791736"
+ y="873.21082"
+ x="1.2642059"
+ height="102.30268"
+ width="253.47159"
+ id="rect3872"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.23044455000000008;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
+ <rect
+ style="fill:url(#linearGradient3870);fill-opacity:1;stroke:#000000;stroke-width:1.23044455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect2898"
+ width="253.47159"
+ height="102.30268"
+ x="1.2642059"
+ y="873.21082"
+ ry="15.791736" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#999999;fill-opacity:1;stroke:#000000;stroke-width:1.23044455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ d="m 176.78712,885.35647 c -33.62642,0.1389 -67.25587,-0.18333 -100.880357,0.1862 -10.307609,1.15201 -19.345272,9.79377 -20.699091,20.10844 -0.734857,7.05609 0.897593,14.58458 1.473236,21.58057 0.575642,6.99598 2.096299,13.83094 4.182258,19.70411 3.479417,9.79656 6.451804,11.97487 16.555151,16.29131 7.142428,0.37214 13.943255,0.28453 21.089461,0.46476 27.657372,-0.0642 53.912612,-1.19078 81.567102,-1.59673 10.50595,-5.2167 13.89795,-6.89364 18.02695,-17.49826 1.87897,-7.32651 3.80822,-16.77839 4.02861,-24.11121 0.009,-5.82937 0.31554,-11.74161 -0.81517,-17.4877 -2.45934,-9.1155 -10.69152,-16.42239 -20.14851,-17.42617 -1.43779,-0.21495 -2.92033,-0.22722 -4.37962,-0.21532 z"
+ id="rect2830"
+ sodipodi:nodetypes="ccczscccccccc" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#59aab2;fill-opacity:1;stroke:#000000;stroke-width:1.23044455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ d="m 177.85993,889.75915 c -34.19435,0.32943 -68.39927,-0.43608 -102.586798,0.42688 -6.581373,1.02477 -12.230044,5.96703 -14.624589,12.10443 -1.284683,3.33332 -1.417022,6.99701 -1.014183,10.53154 0.538398,7.49048 1.640967,14.91401 2.648463,22.35103 1.207501,6.2585 2.930373,12.62821 6.648149,17.88864 2.721379,2.88972 6.415636,4.83199 10.246351,5.75465 4.307496,0.36597 8.637278,0.11598 12.951316,0.33184 28.885631,0.36595 57.750051,-1.08191 86.627201,-1.48002 2.83271,-1.09459 5.46743,-2.62236 8.0348,-4.2381 3.3277,-2.36475 5.74082,-5.93039 6.84205,-9.85432 2.19763,-6.55876 3.08044,-13.48374 3.81607,-20.33915 0.52396,-6.74433 0.69701,-13.6319 -0.80149,-20.26168 -2.52836,-7.83335 -10.57852,-13.40621 -18.78734,-13.21574 z"
+ id="path3672" />
+ <text
+ xml:space="preserve"
+ style="font-size:17.71840286px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:BankGothic Md BT;-inkscape-font-specification:BankGothic Md BT Bold"
+ x="77.551765"
+ y="917.85834"
+ id="text3710"><tspan
+ sodipodi:role="line"
+ id="tspan3712"
+ x="77.551765"
+ y="917.85834"
+ dx="0 0 -0.70311111 0 4.2186675 0 4.9217787 0 1.0546669"
+ style="font-size:20.91755867px">c h i r p</tspan></text>
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3716"
+ sodipodi:cx="-634.28571"
+ sodipodi:cy="583.79077"
+ sodipodi:rx="74.285713"
+ sodipodi:ry="74.285713"
+ d="m -559.99999,583.79077 a 74.285713,74.285713 0 1 1 -148.57143,0 74.285713,74.285713 0 1 1 148.57143,0 z"
+ transform="matrix(0.12304446,0,0,0.12304446,104.62155,854.11197)" />
+ <path
+ transform="matrix(0.12304446,0,0,0.12304446,309.93003,852.31903)"
+ d="m -559.99999,583.79077 a 74.285713,74.285713 0 1 1 -148.57143,0 74.285713,74.285713 0 1 1 148.57143,0 z"
+ sodipodi:ry="74.285713"
+ sodipodi:rx="74.285713"
+ sodipodi:cy="583.79077"
+ sodipodi:cx="-634.28571"
+ id="path3718"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3741"
+ sodipodi:cx="-48.57143"
+ sodipodi:cy="689.50507"
+ sodipodi:rx="28.571428"
+ sodipodi:ry="28.571428"
+ d="m -20.000002,689.50507 a 28.571428,28.571428 0 1 1 -57.142857,0 28.571428,28.571428 0 1 1 57.142857,0 z"
+ transform="matrix(0.12304446,0,0,0.12304446,100.75445,851.65107)" />
+ <path
+ transform="matrix(0.12304446,0,0,0.12304446,123.39463,851.65107)"
+ d="m -20.000002,689.50507 a 28.571428,28.571428 0 1 1 -57.142857,0 28.571428,28.571428 0 1 1 57.142857,0 z"
+ sodipodi:ry="28.571428"
+ sodipodi:rx="28.571428"
+ sodipodi:cy="689.50507"
+ sodipodi:cx="-48.57143"
+ id="path3743"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.12304446,0,0,0.12304446,168.92106,851.65107)"
+ d="m -20.000002,689.50507 a 28.571428,28.571428 0 1 1 -57.142857,0 28.571428,28.571428 0 1 1 57.142857,0 z"
+ sodipodi:ry="28.571428"
+ sodipodi:rx="28.571428"
+ sodipodi:cy="689.50507"
+ sodipodi:cx="-48.57143"
+ id="path3747"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path4566"
+ sodipodi:cx="-48.57143"
+ sodipodi:cy="689.50507"
+ sodipodi:rx="28.571428"
+ sodipodi:ry="28.571428"
+ d="m -20.000002,689.50507 a 28.571428,28.571428 0 1 1 -57.142857,0 28.571428,28.571428 0 1 1 57.142857,0 z"
+ transform="matrix(0.12304446,0,0,0.12304446,145.69407,851.65107)" />
+ </g>
+</svg>
diff --git a/share/contrib/chirp.rnc b/share/contrib/chirp.rnc
new file mode 100644
index 0000000..6ea2715
--- /dev/null
+++ b/share/contrib/chirp.rnc
@@ -0,0 +1,28 @@
+#
+# CHIRP XML Schema
+# Copyright 2008 Dan Smith <dsmith@danplanet.com>
+#
+
+include "chirp_memory.rnc"
+include "chirp_banks.rnc"
+
+start = radio
+
+radio = element radio {
+ attribute version { chirpSchemaVersionType }?,
+ comment?,
+ memories,
+ banks
+}
+
+comment = element comment { xsd:string }?
+
+memories = element memories {
+ element memory { memoryType }*
+}
+
+banks = element banks {
+ element bank { bankType }*
+}
+
+chirpSchemaVersionType = xsd:string { pattern = "[0-9][0-9]*.[0-9][0-9]*.[0-9]{1,4}" }
diff --git a/share/contrib/chirp.rng b/share/contrib/chirp.rng
new file mode 100644
index 0000000..d6020e5
--- /dev/null
+++ b/share/contrib/chirp.rng
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <!--
+
+ CHIRP XML Schema
+ Copyright 2008 Dan Smith <dsmith@danplanet.com>
+
+ -->
+ <include href="chirp_memory.rng"/>
+ <include href="chirp_banks.rng"/>
+ <start>
+ <ref name="radio"/>
+ </start>
+ <define name="radio">
+ <element name="radio">
+ <optional>
+ <attribute name="version">
+ <ref name="chirpSchemaVersionType"/>
+ </attribute>
+ </optional>
+ <optional>
+ <ref name="comment"/>
+ </optional>
+ <ref name="memories"/>
+ <ref name="banks"/>
+ </element>
+ </define>
+ <define name="comment">
+ <optional>
+ <element name="comment">
+ <data type="string"/>
+ </element>
+ </optional>
+ </define>
+ <define name="memories">
+ <element name="memories">
+ <zeroOrMore>
+ <element name="memory">
+ <ref name="memoryType"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="banks">
+ <element name="banks">
+ <zeroOrMore>
+ <element name="bank">
+ <ref name="bankType"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="chirpSchemaVersionType">
+ <data type="string">
+ <param name="pattern">[0-9][0-9]*.[0-9][0-9]*.[0-9]{1,4}</param>
+ </data>
+ </define>
+</grammar>
diff --git a/share/contrib/chirp_banks.rnc b/share/contrib/chirp_banks.rnc
new file mode 100644
index 0000000..d832539
--- /dev/null
+++ b/share/contrib/chirp_banks.rnc
@@ -0,0 +1,3 @@
+bankType =
+ attribute id { xsd:nonNegativeInteger },
+ attribute label { xsd:string }
diff --git a/share/contrib/chirp_banks.rng b/share/contrib/chirp_banks.rng
new file mode 100644
index 0000000..fa25081
--- /dev/null
+++ b/share/contrib/chirp_banks.rng
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <define name="bankType">
+ <attribute name="id">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ <attribute name="label">
+ <data type="string"/>
+ </attribute>
+ </define>
+</grammar>
diff --git a/share/contrib/chirp_memory.rnc b/share/contrib/chirp_memory.rnc
new file mode 100644
index 0000000..ad7ee2e
--- /dev/null
+++ b/share/contrib/chirp_memory.rnc
@@ -0,0 +1,64 @@
+memoryType =
+ attribute location { xsd:nonNegativeInteger }?,
+ shortName,
+ longName?,
+ frequency,
+ SquelchList,
+ squelchSetting?,
+ duplex,
+ offset,
+ mode,
+ tuningStep,
+ skip?,
+ bank?,
+ dv?
+
+shortName = element shortName { xsd:string { pattern = "[A-Z0-9/ >\-]{0,6}" } }
+
+frequencyType =
+ attribute units { "Hz" | "kHz" | "MHz" | "GHz" },
+ xsd:decimal
+
+longName = element longName { xsd:string { pattern = "[.A-Za-z0-9/ >\-]{0,16}" } }
+
+frequency = element frequency { frequencyType }
+
+SquelchList =
+ element squelch { squelchType }?,
+ element squelch { squelchType }?,
+ element squelch { squelchType }?
+
+squelchType =
+ element tone { xsd:decimal { minInclusive = "67.0" maxInclusive = "254.1" } }?, # could also use enumeration
+ element code { xsd:positiveInteger }?,
+ element polarity { xsd:string { pattern = "[RN]{2}" } }?,
+ attribute id { text }?,
+ attribute type { text }?
+
+offset = element offset { frequencyType }
+
+tuningStep = element tuningStep { frequencyType }
+
+squelchSetting = element squelchSetting { xsd:string }
+
+duplex = element duplex { "positive" | "negative" | "none" }
+
+mode = element mode { "FM" | "NFM" | "WFM" | "AM" | "NAM" | "DV" }
+
+dv = element dv {
+ element urcall { callsignType },
+ element rpt1call { callsignType },
+ element rpt2call { callsignType },
+ element digitalCode { digitalCodeType }?
+}
+
+callsignType = xsd:string { pattern = "[A-Z0-9/ ]*" }
+
+digitalCodeType = xsd:integer { minInclusive = "0" }
+
+skip = element skip { "S" | "P" | "" }
+
+bank = element bank {
+ attribute bankId { xsd:nonNegativeInteger },
+ attribute bankIndex { xsd:nonNegativeInteger }?
+}
diff --git a/share/contrib/chirp_memory.rng b/share/contrib/chirp_memory.rng
new file mode 100644
index 0000000..0d88eac
--- /dev/null
+++ b/share/contrib/chirp_memory.rng
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <define name="memoryType">
+ <optional>
+ <attribute name="location">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ </optional>
+ <ref name="shortName"/>
+ <optional>
+ <ref name="longName"/>
+ </optional>
+ <ref name="frequency"/>
+ <ref name="SquelchList"/>
+ <optional>
+ <ref name="squelchSetting"/>
+ </optional>
+ <ref name="duplex"/>
+ <ref name="offset"/>
+ <ref name="mode"/>
+ <ref name="tuningStep"/>
+ <optional>
+ <ref name="skip"/>
+ </optional>
+ <optional>
+ <ref name="bank"/>
+ </optional>
+ <optional>
+ <ref name="dv"/>
+ </optional>
+ </define>
+ <define name="shortName">
+ <element name="shortName">
+ <data type="string">
+ <param name="pattern">[A-Z0-9/ &gt;\-]{0,6}</param>
+ </data>
+ </element>
+ </define>
+ <define name="frequencyType">
+ <attribute name="units">
+ <choice>
+ <value>Hz</value>
+ <value>kHz</value>
+ <value>MHz</value>
+ <value>GHz</value>
+ </choice>
+ </attribute>
+ <data type="decimal"/>
+ </define>
+ <define name="longName">
+ <element name="longName">
+ <data type="string">
+ <param name="pattern">[.A-Za-z0-9/ &gt;\-]{0,16}</param>
+ </data>
+ </element>
+ </define>
+ <define name="frequency">
+ <element name="frequency">
+ <ref name="frequencyType"/>
+ </element>
+ </define>
+ <define name="SquelchList">
+ <optional>
+ <element name="squelch">
+ <ref name="squelchType"/>
+ </element>
+ </optional>
+ <optional>
+ <element name="squelch">
+ <ref name="squelchType"/>
+ </element>
+ </optional>
+ <optional>
+ <element name="squelch">
+ <ref name="squelchType"/>
+ </element>
+ </optional>
+ </define>
+ <define name="squelchType">
+ <optional>
+ <element name="tone">
+ <data type="decimal">
+ <param name="minInclusive">67.0</param>
+ <param name="maxInclusive">254.1</param>
+ </data>
+ </element>
+ </optional>
+ <optional>
+ <!-- could also use enumeration -->
+ <element name="code">
+ <data type="positiveInteger"/>
+ </element>
+ </optional>
+ <optional>
+ <element name="polarity">
+ <data type="string">
+ <param name="pattern">[RN]{2}</param>
+ </data>
+ </element>
+ </optional>
+ <optional>
+ <attribute name="id"/>
+ </optional>
+ <optional>
+ <attribute name="type"/>
+ </optional>
+ </define>
+ <define name="offset">
+ <element name="offset">
+ <ref name="frequencyType"/>
+ </element>
+ </define>
+ <define name="tuningStep">
+ <element name="tuningStep">
+ <ref name="frequencyType"/>
+ </element>
+ </define>
+ <define name="squelchSetting">
+ <element name="squelchSetting">
+ <data type="string"/>
+ </element>
+ </define>
+ <define name="duplex">
+ <element name="duplex">
+ <choice>
+ <value>positive</value>
+ <value>negative</value>
+ <value>none</value>
+ </choice>
+ </element>
+ </define>
+ <define name="mode">
+ <element name="mode">
+ <choice>
+ <value>FM</value>
+ <value>NFM</value>
+ <value>WFM</value>
+ <value>AM</value>
+ <value>NAM</value>
+ <value>DV</value>
+ </choice>
+ </element>
+ </define>
+ <define name="dv">
+ <element name="dv">
+ <element name="urcall">
+ <ref name="callsignType"/>
+ </element>
+ <element name="rpt1call">
+ <ref name="callsignType"/>
+ </element>
+ <element name="rpt2call">
+ <ref name="callsignType"/>
+ </element>
+ <optional>
+ <element name="digitalCode">
+ <ref name="digitalCodeType"/>
+ </element>
+ </optional>
+ </element>
+ </define>
+ <define name="callsignType">
+ <data type="string">
+ <param name="pattern">[A-Z0-9/ ]*</param>
+ </data>
+ </define>
+ <define name="digitalCodeType">
+ <data type="integer">
+ <param name="minInclusive">0</param>
+ </data>
+ </define>
+ <define name="skip">
+ <element name="skip">
+ <choice>
+ <value>S</value>
+ <value>P</value>
+ <value/>
+ </choice>
+ </element>
+ </define>
+ <define name="bank">
+ <element name="bank">
+ <attribute name="bankId">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ <optional>
+ <attribute name="bankIndex">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ </optional>
+ </element>
+ </define>
+</grammar>
diff --git a/share/make_supported.py b/share/make_supported.py
new file mode 100755
index 0000000..67ecebd
--- /dev/null
+++ b/share/make_supported.py
@@ -0,0 +1,178 @@
+#!/usr/bin/env python
+
+import sys
+import serial
+
+sys.path.insert(0, ".")
+sys.path.insert(0, "..")
+
+tmp = sys.stdout
+sys.stdout = sys.stderr
+from chirp import *
+from chirp.drivers import *
+sys.stdout = tmp
+
+RF = chirp_common.RadioFeatures()
+KEYS = [x for x in sorted(RF.__dict__.keys())
+ if "_" in x and not x.startswith("_")]
+
+RADIO_TYPES = {
+ 'Clone': chirp_common.CloneModeRadio,
+ 'File': chirp_common.FileBackedRadio,
+ 'Live': chirp_common.LiveRadio,
+}
+
+
+counter = 0
+
+def radio_type(radio):
+ for k, v in RADIO_TYPES.items():
+ if isinstance(radio, v):
+ return k
+ return ""
+
+
+def supported_row(radio):
+ global counter
+ counter += 1
+ odd = counter % 2
+
+ row = '<tr class="%s" title="%s %s %s">' % (odd and "odd" or "even",
+ radio.VENDOR,
+ radio.MODEL,
+ radio.VARIANT)
+ row += "<td><a href=\"#%s\" name=\"%s\">%s %s %s</a></td>\n" % (
+ 'row%04i' % counter,
+ 'row%04i' % counter,
+ radio.VENDOR, radio.MODEL, radio.VARIANT)
+ rf = radio.get_features()
+ for key in KEYS:
+ value = rf.__dict__[key]
+ if key == "valid_bands":
+ value = ["%s-%s MHz" % (chirp_common.format_freq(x),
+ chirp_common.format_freq(y))
+ for x, y in value]
+
+ if key in ["valid_bands", "valid_modes", "valid_power_levels",
+ "valid_tuning_steps"]:
+ try:
+ value = ", ".join([str(x) for x in value
+ if not str(x).startswith("?")])
+ except Exception, e:
+ raise
+
+ if key == "memory_bounds":
+ value = "%i-%i" % value
+
+ if key == "requires_call_lists":
+ if "DV" not in rf.valid_modes:
+ value = None
+ elif value:
+ value = "Required"
+ else:
+ value = "Optional"
+
+ if value is None:
+ row += '<td class="%s"><span class="False">N/A</span></td>' % key
+ elif isinstance(value, bool):
+ row += '<td class="%s"><span class="%s">%s</span></td>' % \
+ (key,
+ value,
+ value and "Yes" or "No")
+ else:
+ row += '<td class="%s">%s</td>' % (key, value)
+ row += '<td class="radio_type">%s</td>' % radio_type(radio)
+ row += "</tr>\n"
+ return row
+
+
+def header_row():
+ row = "<thead><tr>"
+ row += "<th>Radio</th>\n"
+ for key in KEYS:
+ Key = key.split("_", 1)[1].title().replace("_", " ")
+ row += '<th title="%s">%s</th>' % (RF.get_doc(key), Key)
+ row += '<th title="Radio programming type">Type</th>\n'
+ row += "</tr></thead>\n"
+ return row
+
+
+dest = sys.stdout
+if len(sys.argv) > 1:
+ dest = open(sys.argv[1], 'w')
+
+
+def output(string):
+ dest.write(string + '\n')
+
+
+output("""
+<style>
+td {
+ white-space: nowrap;
+ border-right: thin solid black;
+ padding: 3px;
+}
+tr.odd {
+ background: #E8E8E8;'
+}
+tr.odd:hover, tr.even:hover {
+ background-color: #FFCCFF;
+}
+th {
+ border-right: thin solid black;
+}
+table {
+ border-collapse: collapse;
+}
+th {
+ border-bottom: thick solid black;
+}
+span.false {
+ color: grey;
+}
+a {
+ text-decoration: none;
+ color: inherit;
+}
+</style>
+<table>
+""")
+
+models = {"Icom": [],
+ "Kenwood": [],
+ "Yaesu": [],
+ "Alinco": [],
+ "Baofeng": [],
+ "z_Other": [],
+ }
+
+models = []
+
+exclude = [directory.DRV_TO_RADIO["Icom_7200"]]
+
+for radio in directory.DRV_TO_RADIO.values():
+ if radio in exclude:
+ continue
+
+ models.append(radio)
+ for alias in radio.ALIASES:
+ class DynamicRadioAlias(radio):
+ VENDOR = alias.VENDOR
+ MODEL = alias.MODEL
+ VARIANT = alias.VARIANT
+ models.append(DynamicRadioAlias)
+
+
+def get_key(rc):
+ return '%s %s %s' % (rc.VENDOR, rc.MODEL, rc.VARIANT)
+
+for radio in sorted(models, cmp=lambda a, b: get_key(a) < get_key(b) and -1 or 1):
+ if counter % 10 == 0:
+ output(header_row())
+ _radio = radio(None)
+ if _radio.get_features().has_sub_devices:
+ for __radio in _radio.get_sub_devices():
+ output(supported_row(__radio))
+ else:
+ output(supported_row(_radio))
diff --git a/test-requirements.txt b/test-requirements.txt
new file mode 100644
index 0000000..1e80eb9
--- /dev/null
+++ b/test-requirements.txt
@@ -0,0 +1,4 @@
+mock
+mox3
+pytest
+pytest-xdist
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..d04e516
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,151 @@
+import glob
+import logging
+import os
+import re
+import shutil
+import sys
+import tempfile
+import unittest
+
+import six
+
+from chirp import directory
+
+from tests import run_tests
+
+
+LOG = logging.getLogger('testadapter')
+
+
+class TestAdapterMeta(type):
+ def __new__(cls, name, parents, dct):
+ return super(TestAdapterMeta, cls).__new__(cls, name, parents, dct)
+
+
+class TestAdapter(unittest.TestCase):
+ RADIO_CLASS = None
+ SOURCE_IMAGE = None
+ RADIO_INST = None
+ testwrapper = None
+
+ def shortDescription(self):
+ test = self.id().split('.')[-1].replace('test_', '').replace('_', ' ')
+ return 'Testing %s %s' % (self.RADIO_CLASS.get_name(), test)
+
+ @classmethod
+ def setUpClass(cls):
+ if not cls.testwrapper:
+ # Initialize the radio once per class invocation to save
+ # bitwise parse time
+ # Do this for things like Generic_CSV, that demand it
+ _base, ext = os.path.splitext(cls.SOURCE_IMAGE)
+ cls.testimage = tempfile.mktemp(ext)
+ shutil.copy(cls.SOURCE_IMAGE, cls.testimage)
+ cls.testwrapper = run_tests.TestWrapper(cls.RADIO_CLASS,
+ cls.testimage)
+
+ @classmethod
+ def tearDownClass(cls):
+ os.remove(cls.testimage)
+
+ def _runtest(self, test):
+ tw = run_tests.TestWrapper(self.RADIO_CLASS,
+ self.testimage,
+ dst=self.RADIO_INST)
+ testcase = test(tw)
+ testcase.prepare()
+ try:
+ failures = testcase.run()
+ if failures:
+ raise failures[0]
+ except run_tests.TestCrashError as e:
+ raise e.get_original_exception()
+ except run_tests.TestSkippedError as e:
+ raise unittest.SkipTest(str(e))
+ finally:
+ testcase.cleanup()
+
+ def test_copy_all(self):
+ self._runtest(run_tests.TestCaseCopyAll)
+
+ def test_brute_force(self):
+ self._runtest(run_tests.TestCaseBruteForce)
+
+ def test_edges(self):
+ self._runtest(run_tests.TestCaseEdges)
+
+ def test_settings(self):
+ self._runtest(run_tests.TestCaseSettings)
+
+ def test_banks(self):
+ self._runtest(run_tests.TestCaseBanks)
+
+ def test_detect(self):
+ self._runtest(run_tests.TestCaseDetect)
+
+ def test_clone(self):
+ self._runtest(run_tests.TestCaseClone)
+
+
+def _get_sub_devices(rclass, testimage):
+ try:
+ tw = run_tests.TestWrapper(rclass, None)
+ except Exception as e:
+ tw = run_tests.TestWrapper(rclass, testimage)
+
+ rf = tw.do("get_features")
+ if rf.has_sub_devices:
+ return tw.do("get_sub_devices")
+ else:
+ return [rclass]
+
+
+class RadioSkipper(unittest.TestCase):
+ def test_is_supported_by_environment(self):
+ raise unittest.SkipTest('Running in py3 and driver is not supported')
+
+
+def load_tests(loader, tests, pattern, suite=None):
+ if not suite:
+ suite = unittest.TestSuite()
+
+ base = os.path.dirname(os.path.abspath(__file__))
+ base = os.path.join(base, 'images')
+ images = glob.glob(os.path.join(base, "*"))
+ tests = {img: os.path.splitext(os.path.basename(img))[0] for img in images}
+
+ if pattern == 'test*.py':
+ # This default is meaningless for us
+ pattern = None
+
+ for image, test in tests.items():
+ try:
+ rclass = directory.get_radio(test)
+ except Exception:
+ if six.PY3 and 'CHIRP_DEBUG' in os.environ:
+ LOG.error('Failed to load %s' % test)
+ continue
+ raise
+ for device in _get_sub_devices(rclass, image):
+ class_name = 'TestCase_%s' % (
+ ''.join(filter(lambda c: c.isalnum(),
+ device.get_name())))
+ if isinstance(device, type):
+ dst = None
+ else:
+ dst = device
+ device = device.__class__
+ tc = TestAdapterMeta(
+ class_name, (TestAdapter,), dict(RADIO_CLASS=device,
+ SOURCE_IMAGE=image,
+ RADIO_INST=dst))
+ tests = loader.loadTestsFromTestCase(tc)
+
+ if pattern:
+ tests = [t for t in tests
+ if re.search(pattern, '%s.%s' % (class_name,
+ t._testMethodName))]
+
+ suite.addTests(tests)
+
+ return suite
diff --git a/tests/icom_clone_simulator.py b/tests/icom_clone_simulator.py
new file mode 100644
index 0000000..e13572a
--- /dev/null
+++ b/tests/icom_clone_simulator.py
@@ -0,0 +1,195 @@
+# Copyright 2019 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from builtins import bytes
+
+import struct
+
+from chirp.drivers import icf
+
+import logging
+
+LOG = logging.getLogger(__name__)
+
+
+import sys
+l = logging.getLogger()
+l.level = logging.ERROR
+l.addHandler(logging.StreamHandler(sys.stdout))
+
+class FakeIcomRadio(object):
+ def __init__(self, radio, mapfile=None):
+ self._buffer = bytes(b'')
+ self._radio = radio
+ if not mapfile:
+ self._memory = bytes(b'\x00') * radio.get_memsize()
+ else:
+ self.load_from_file(mapfile)
+
+ def load_from_file(self, filename):
+ with open(filename, 'rb') as f:
+ self._memory = bytes(f.read())
+ LOG.debug('Initialized %i bytes from %s' % (len(self._memory),
+ filename))
+
+ def read(self, count):
+ """read() from radio, so here we synthesize responses"""
+ chunk = self._buffer[:count]
+ self._buffer = self._buffer[count:]
+ return chunk
+
+ def queue(self, data):
+ # LOG.debug('Queuing: %r' % data)
+ self._buffer += data
+
+ def make_response(self, cmd, payload):
+ return bytes([
+ 0xFE, 0xFE,
+ 0xEF, # Radio
+ 0xEE, # PC
+ cmd,
+ ]) + payload + bytes([0xFD])
+
+ @property
+ def address_fmt(self):
+ if self._radio.get_memsize() > 0x10000:
+ return 'I'
+ else:
+ return 'H'
+
+ def do_clone_out(self):
+ LOG.debug('Clone from radio started')
+ size = 16
+ for addr in range(0, self._radio.get_memsize(), size):
+ if len(self._memory[addr:]) < 4:
+ # IC-W32E has an off-by-one hack for detection,
+ # which will cause us to send a short one-byte
+ # block of garbage, unlike the real radio. So,
+ # if we get to the end and have a few bytes
+ # left, don't be stupid.
+ break
+ header = bytes(struct.pack('>%sB' % self.address_fmt,
+ addr, size))
+ #LOG.debug('Header for %02x@%04x: %r' % (
+ # size, addr, header))
+ chunk = []
+ cs = 0
+ for byte in header:
+ chunk.extend(x for x in bytes(b'%02X' % byte))
+ cs += byte
+ #LOG.debug('Chunk so far: %r' % chunk)
+ for byte in self._memory[addr:addr + size]:
+ chunk.extend(x for x in bytes(b'%02X' % byte))
+ cs += byte
+ #LOG.debug('Chunk is %r' % chunk)
+
+ vx = ((cs ^ 0xFFFF) + 1) & 0xFF
+ chunk.extend(x for x in bytes(b'%02X' % vx))
+ self.queue(self.make_response(icf.CMD_CLONE_DAT, bytes(chunk)))
+ #LOG.debug('Stopping after first frame')
+ #break
+ self.queue(self.make_response(icf.CMD_CLONE_END, bytes([])))
+
+ def do_clone_in(self):
+ LOG.debug('Clone to radio started')
+ self._memory = bytes(b'')
+
+ def do_clone_data(self, payload_hex):
+ if self.address_fmt == 'I':
+ header_len = 5
+ else:
+ header_len = 3
+
+ def hex_to_byte(hexchars):
+ return int('%s%s' % (chr(hexchars[0]), chr(hexchars[1])), 16)
+
+ payload_bytes = bytes([hex_to_byte(payload_hex[i:i+2])
+ for i in range(0, len(payload_hex), 2)])
+
+ addr, size = struct.unpack('>%sB' % self.address_fmt, payload_bytes[:header_len])
+ data = payload_bytes[header_len:-1]
+ csum = payload_bytes[-1]
+
+ #addr_hex = payload[0:size_offset]
+ #size_hex = payload[size_offset:size_offset + 2]
+ #data_hex = payload[size_offset + 2:-2]
+ #csum_hex = payload[-2:]
+
+
+ #addr = hex_to_byte(addr_hex[0:2]) << 8 | hex_to_byte(addr_hex[2:4])
+ #size = hex_to_byte(size_hex)
+ #csum = hex_to_byte(csum_hex)
+
+ #data = []
+ #for i in range(0, len(data_hex), 2):
+ # data.append(hex_to_byte(data_hex[i:i+2]))
+
+ if len(data) != size:
+ LOG.debug('Invalid frame size: expected %i, but got %i' % (
+ size, len(data)))
+
+ expected_addr = len(self._memory)
+ if addr < expected_addr:
+ LOG.debug('Frame goes back to %04x from %04x' % (addr,
+ expected_addr))
+ if len(self._memory) != addr:
+ LOG.debug('Filling gap between %04x and %04x' % (expected_addr,
+ addr))
+ self._memory += (bytes(b'\x00') * (addr - expected_addr))
+
+ # FIXME: Check checksum
+
+ self._memory += data
+
+ def write(self, data):
+ """write() to radio, so here we process requests"""
+
+ assert isinstance(data, bytes), 'Bytes required, %s received' % data.__class__
+
+ if data[:12] == (bytes(b'\xFE') * 12):
+ LOG.debug('Got hispeed kicker')
+ data = data[12:]
+ if data[2] == 0xFE:
+ return
+
+ src = data[2]
+ dst = data[3]
+ cmd = data[4]
+ payload = data[5:-1]
+ end = data[-1]
+
+ LOG.debug('Received command: %r' % cmd)
+ LOG.debug(' Full frame: %r' % data)
+
+ model = self._radio.get_model() + bytes(b'\x00' * 20)
+
+ if cmd == 0xE0: # Ident
+ # FIXME
+ self.queue(self.make_response(0x01, # Model
+ model))
+ elif cmd == icf.CMD_CLONE_OUT:
+ self.do_clone_out()
+ elif cmd == icf.CMD_CLONE_IN:
+ self.do_clone_in()
+ elif cmd == icf.CMD_CLONE_DAT:
+ self.do_clone_data(payload)
+ else:
+ LOG.debug('Unknown command %i' % cmd)
+ self.queue(self.make_response(0x00, bytes([0x01])))
+
+ return len(data)
+
+ def flush(self):
+ return
diff --git a/tests/images/Alinco_DJ-G7EG.img b/tests/images/Alinco_DJ-G7EG.img
new file mode 100644
index 0000000..2286bc1
--- /dev/null
+++ b/tests/images/Alinco_DJ-G7EG.img
Binary files differ
diff --git a/tests/images/Alinco_DJ175.img b/tests/images/Alinco_DJ175.img
new file mode 100644
index 0000000..0c05432
--- /dev/null
+++ b/tests/images/Alinco_DJ175.img
Binary files differ
diff --git a/tests/images/Alinco_DJ596.img b/tests/images/Alinco_DJ596.img
new file mode 100644
index 0000000..d37be19
--- /dev/null
+++ b/tests/images/Alinco_DJ596.img
Binary files differ
diff --git a/tests/images/Alinco_DR235T.img b/tests/images/Alinco_DR235T.img
new file mode 100644
index 0000000..8256271
--- /dev/null
+++ b/tests/images/Alinco_DR235T.img
Binary files differ
diff --git a/tests/images/AnyTone_OBLTR-8R.img b/tests/images/AnyTone_OBLTR-8R.img
new file mode 100644
index 0000000..2f11032
--- /dev/null
+++ b/tests/images/AnyTone_OBLTR-8R.img
Binary files differ
diff --git a/tests/images/AnyTone_TERMN-8R.img b/tests/images/AnyTone_TERMN-8R.img
new file mode 100644
index 0000000..0c88931
--- /dev/null
+++ b/tests/images/AnyTone_TERMN-8R.img
Binary files differ
diff --git a/tests/images/BTECH_GMRS-50X1.img b/tests/images/BTECH_GMRS-50X1.img
new file mode 100644
index 0000000..e84780f
--- /dev/null
+++ b/tests/images/BTECH_GMRS-50X1.img
Binary files differ
diff --git a/tests/images/BTECH_GMRS-V1.img b/tests/images/BTECH_GMRS-V1.img
new file mode 100644
index 0000000..afc0a36
--- /dev/null
+++ b/tests/images/BTECH_GMRS-V1.img
Binary files differ
diff --git a/tests/images/BTECH_MURS-V1.img b/tests/images/BTECH_MURS-V1.img
new file mode 100644
index 0000000..fac635c
--- /dev/null
+++ b/tests/images/BTECH_MURS-V1.img
Binary files differ
diff --git a/tests/images/BTECH_UV-2501+220.img b/tests/images/BTECH_UV-2501+220.img
new file mode 100755
index 0000000..8bf021c
--- /dev/null
+++ b/tests/images/BTECH_UV-2501+220.img
Binary files differ
diff --git a/tests/images/BTECH_UV-25X2.img b/tests/images/BTECH_UV-25X2.img
new file mode 100755
index 0000000..aec97d8
--- /dev/null
+++ b/tests/images/BTECH_UV-25X2.img
Binary files differ
diff --git a/tests/images/BTECH_UV-25X4.img b/tests/images/BTECH_UV-25X4.img
new file mode 100755
index 0000000..12ce9f9
--- /dev/null
+++ b/tests/images/BTECH_UV-25X4.img
Binary files differ
diff --git a/tests/images/BTECH_UV-5001.img b/tests/images/BTECH_UV-5001.img
new file mode 100755
index 0000000..377be8b
--- /dev/null
+++ b/tests/images/BTECH_UV-5001.img
Binary files differ
diff --git a/tests/images/BTECH_UV-50X2.img b/tests/images/BTECH_UV-50X2.img
new file mode 100755
index 0000000..6bac4fb
--- /dev/null
+++ b/tests/images/BTECH_UV-50X2.img
Binary files differ
diff --git a/tests/images/BTECH_UV-50X3.img b/tests/images/BTECH_UV-50X3.img
new file mode 100644
index 0000000..6da4293
--- /dev/null
+++ b/tests/images/BTECH_UV-50X3.img
Binary files differ
diff --git a/tests/images/BTECH_UV-5X3.img b/tests/images/BTECH_UV-5X3.img
new file mode 100755
index 0000000..aa6ad8a
--- /dev/null
+++ b/tests/images/BTECH_UV-5X3.img
Binary files differ
diff --git a/tests/images/Baofeng_BF-888.img b/tests/images/Baofeng_BF-888.img
new file mode 100644
index 0000000..0304ddf
--- /dev/null
+++ b/tests/images/Baofeng_BF-888.img
Binary files differ
diff --git a/tests/images/Baofeng_BF-A58S.img b/tests/images/Baofeng_BF-A58S.img
new file mode 100644
index 0000000..bbcbffc
--- /dev/null
+++ b/tests/images/Baofeng_BF-A58S.img
Binary files differ
diff --git a/tests/images/Baofeng_BF-T1.img b/tests/images/Baofeng_BF-T1.img
new file mode 100644
index 0000000..849896c
--- /dev/null
+++ b/tests/images/Baofeng_BF-T1.img
Binary files differ
diff --git a/tests/images/Baofeng_F-11.img b/tests/images/Baofeng_F-11.img
new file mode 100644
index 0000000..b13f9b4
--- /dev/null
+++ b/tests/images/Baofeng_F-11.img
Binary files differ
diff --git a/tests/images/Baofeng_UV-3R.img b/tests/images/Baofeng_UV-3R.img
new file mode 100644
index 0000000..8333f02
--- /dev/null
+++ b/tests/images/Baofeng_UV-3R.img
Binary files differ
diff --git a/tests/images/Baofeng_UV-5R.img b/tests/images/Baofeng_UV-5R.img
new file mode 100644
index 0000000..dcdc3e8
--- /dev/null
+++ b/tests/images/Baofeng_UV-5R.img
Binary files differ
diff --git a/tests/images/Baofeng_UV-6R.img b/tests/images/Baofeng_UV-6R.img
new file mode 100755
index 0000000..32f5c15
--- /dev/null
+++ b/tests/images/Baofeng_UV-6R.img
Binary files differ
diff --git a/tests/images/Baofeng_UV-B5.img b/tests/images/Baofeng_UV-B5.img
new file mode 100644
index 0000000..5d69456
--- /dev/null
+++ b/tests/images/Baofeng_UV-B5.img
Binary files differ
diff --git a/tests/images/Baojie_BJ-9900.img b/tests/images/Baojie_BJ-9900.img
new file mode 100644
index 0000000..905dda3
--- /dev/null
+++ b/tests/images/Baojie_BJ-9900.img
Binary files differ
diff --git a/tests/images/Boblov_X3Plus.img b/tests/images/Boblov_X3Plus.img
new file mode 100644
index 0000000..07331e4
--- /dev/null
+++ b/tests/images/Boblov_X3Plus.img
Binary files differ
diff --git a/tests/images/Feidaxin_FD-268A.img b/tests/images/Feidaxin_FD-268A.img
new file mode 100755
index 0000000..52fc11b
--- /dev/null
+++ b/tests/images/Feidaxin_FD-268A.img
Binary files differ
diff --git a/tests/images/Feidaxin_FD-268B.img b/tests/images/Feidaxin_FD-268B.img
new file mode 100755
index 0000000..8de4949
--- /dev/null
+++ b/tests/images/Feidaxin_FD-268B.img
Binary files differ
diff --git a/tests/images/Feidaxin_FD-288B.img b/tests/images/Feidaxin_FD-288B.img
new file mode 100755
index 0000000..778ff91
--- /dev/null
+++ b/tests/images/Feidaxin_FD-288B.img
Binary files differ
diff --git a/tests/images/Generic_CSV.csv b/tests/images/Generic_CSV.csv
new file mode 100644
index 0000000..e50f849
--- /dev/null
+++ b/tests/images/Generic_CSV.csv
@@ -0,0 +1,104 @@
+Location,Name,Frequency,Duplex,Offset,Tone,rToneFreq,cToneFreq,DtcsCode,DtcsPolarity,Mode,TStep,Skip,Bank,Bank Index,URCALL,RPT1CALL,RPT2CALL
+25,H-TAC1,443.100000,+,5.000000,DTCS,88.5,88.5,032,NN,FM,5.00,,,-1,,,,
+26,H-TAC2,147.380000,+,0.600000,Tone,100.0,100.0,023,NN,FM,5.00,,,-1,,,,
+27,H-TAC3,147.440000,,0.600000,Tone,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+28,H-TAC4,441.550000,+,5.000000,Tone,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+29,H-TAC5,442.925000,+,5.000000,Tone,107.2,107.2,023,NN,FM,5.00,,,-1,,,,
+30,H-TAC6,443.350000,+,5.000000,Tone,156.7,156.7,023,NN,FM,5.00,,,-1,,,,
+31,H-TAC7,442.825000,+,5.000000,,110.9,110.9,023,NN,FM,5.00,,,-1,,,,
+50,ARESD1,147.320000,+,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+51,WAPRIR,146.900000,-,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+52,WAPRIS,147.400000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+53,WASECR,440.350000,+,5.000000,TSQL,127.3,127.3,023,NN,FM,5.00,,,-1,,,,
+54,OEMNCS,145.330000,-,0.600000,Tone,186.2,186.2,023,NN,FM,5.00,,,-1,,,,
+55,HEARTN,145.230000,-,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+56,CLACK,147.120000,+,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+57,CLATSP,146.660000,-,0.600000,Tone,118.8,118.8,023,NN,FM,5.00,,,-1,,,,
+58,COLUMB,146.880000,-,0.600000,Tone,114.8,114.8,023,NN,FM,5.00,,,-1,,,,
+59,TMOOK1,147.220000,+,0.600000,Tone,100.0,100.0,023,NN,FM,5.00,,,-1,,,,
+60,TMOOK2,147.160000,+,0.600000,Tone,118.8,118.8,023,NN,FM,5.00,,,-1,,,,
+61,TMOOK3,440.175000,+,5.000000,Tone,100.0,100.0,023,NN,FM,5.00,,,-1,,,,
+62,TMOOK4,441.250000,+,5.000000,Tone,118.8,118.8,023,NN,FM,5.00,,,-1,,,,
+63,MULTNM,146.840000,-,0.600000,Tone,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+64,CLARK,147.240000,+,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+65,ARC,146.980000,-,0.600000,Tone,123.0,123.0,023,NN,FM,5.00,,,-1,,,,
+66,VERNIA,145.250000,-,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+80,WX1,162.400000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+81,WX2,162.425000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+82,WX3,162.450000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+83,WX4,162.475000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+84,WX5,162.500000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+85,WX6,162.525000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+86,WX7,162.550000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+88,CTAF,119.300000,,0.600000,,88.5,88.5,023,NN,AM,5.00,,,-1,,,,
+89,ATIS,127.650000,,0.600000,,88.5,88.5,023,NN,AM,5.00,,,-1,,,,
+90,GROUND,121.700000,,0.600000,,88.5,88.5,023,NN,AM,5.00,,,-1,,,,
+91,TOWER,119.300000,,0.600000,,88.5,88.5,023,NN,AM,5.00,,,-1,,,,
+92,UNICOM,122.950000,,0.600000,,88.5,88.5,023,NN,AM,5.00,,,-1,,,,
+93,ACARS,131.550000,,0.600000,,88.5,88.5,023,NN,AM,5.00,,,-1,,,,
+100,ICALL,851.012500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+101,ITAC1,851.512500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+102,ITAC2,852.012500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+103,ITAC3,852.512500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+104,ITAC4,853.012500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+105,OROPS1,851.325000,,0.600000,TSQL,88.5,156.7,023,NN,FM,10.00,,,-1,,,,
+106,OROPS2,851.387500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+107,OROPS3,851.750000,,0.600000,TSQL,88.5,156.7,023,NN,FM,10.00,,,-1,,,,
+108,OROPS4,851.775000,,0.600000,TSQL,88.5,156.7,023,NN,FM,10.00,,,-1,,,,
+109,OROPS5,851.800000,,0.600000,TSQL,88.5,156.7,023,NN,FM,10.00,,,-1,,,,
+110,WAOPS1,852.537500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+111,WAOPS2,852.562500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+112,WAOPS3,852.587500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+113,WAOPS4,852.612500,,0.600000,TSQL,88.5,156.7,023,NN,FM,10.00,,,-1,,,,
+114,WAOPS5,852.637500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+115,UCAL40,453.212500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+116,UTAC41,453.462500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+117,UTAC42,453.712500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+118,UTAC43,453.862500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+119,ISIMP1,853.437500,,0.600000,DTCS,88.5,88.5,074,NN,FM,12.50,,,-1,,,,
+120,ISIMP2,851.037500,,0.600000,DTCS,88.5,88.5,114,NN,FM,12.50,,,-1,,,,
+121,ISIMP3,851.950000,,0.600000,DTCS,88.5,88.5,131,NN,FM,10.00,,,-1,,,,
+122,ISIMP4,851.175000,,0.600000,DTCS,88.5,88.5,023,NN,FM,10.00,,,-1,,,,
+123,MAYDAY,853.387500,,0.600000,DTCS,88.5,88.5,025,NN,FM,12.50,,,-1,,,,
+124,VCALL,155.750000,,0.600000,TSQL,88.5,156.7,023,NN,FM,5.00,,,-1,,,,
+125,VTAC11,151.137500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+126,VTAC12,154.452500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+127,VTAC13,158.737500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+128,VTAC14,159.472500,,0.600000,TSQL,88.5,156.7,023,NN,FM,12.50,,,-1,,,,
+129,WCCCA1,860.737500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+130,WCCCA2,860.237500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+131,WCCCA3,859.737500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+132,WCCCA4,859.737500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+133,WCCCA5,858.237500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+134,WCCCA6,857.237500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+135,WCCCA7,856.237500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+136,WCCCA8,855.962500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+137,WCCCA9,855.237500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+138,WCCCA0,854.987500,,0.600000,,88.5,88.5,023,NN,FM,12.50,,,-1,,,,
+139,OR SAR,155.805000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+140,OPEN,155.475000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+141,OSPTAC,156.030000,,0.600000,TSQL,88.5,156.7,023,NN,FM,5.00,,,-1,,,,
+142,OSPD1A,154.935000,,0.600000,TSQL,88.5,179.9,023,NN,FM,5.00,,,-1,,,,
+143,OSPD1B,156.225000,,0.600000,TSQL,88.5,179.9,023,NN,FM,5.00,,,-1,,,,
+144,OSPD1C,154.905000,,0.600000,TSQL,88.5,179.9,023,NN,FM,5.00,,,-1,,,,
+145,OSPD1D,156.150000,,0.600000,TSQL,88.5,179.9,023,NN,FM,5.00,,,-1,,,,
+146,OSPD6A,153.935000,,0.600000,TSQL,88.5,156.7,023,NN,FM,5.00,,,-1,,,,
+147,OSPD6B,154.785000,,0.600000,TSQL,88.5,156.7,023,NN,FM,5.00,,,-1,,,,
+148,OSPD6C,154.860000,,0.600000,TSQL,88.5,131.8,023,NN,FM,5.00,,,-1,,,,
+149,OSPD6D,155.910000,,0.600000,TSQL,88.5,131.8,023,NN,FM,5.00,,,-1,,,,
+150,WASP,155.370000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+151,CHP,156.075000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+152,ODFW,158.895000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+153,SARINTOP,158.905000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+160,H-DS1,147.550000,,0.600000,,88.5,88.5,023,NN,DV,5.00,,,-1,CQCQCQ,,,0
+161,H-DS2,147.580000,,0.600000,,88.5,88.5,023,NN,DV,5.00,,,-1,CQCQCQ,,,0
+162,H-DS3,446.300000,,5.000000,,88.5,88.5,023,NN,DV,5.00,,,-1,CQCQCQ,,,0
+163,H-DS4,446.400000,,5.000000,,88.5,88.5,023,NN,DV,5.00,,,-1,CQCQCQ,,,0
+164,H-DS5,1294.100000,,0.600000,,88.5,88.5,023,NN,DV,5.00,,,-1,CQCQCQ,,,0
+165,H-DS6,441.637500,+,5.000000,,88.5,88.5,023,NN,DV,12.50,,,-1,CQCQCQ,,,0
+166,H-DS7,440.550000,+,5.000000,,88.5,88.5,023,NN,DV,5.00,,,-1,CQCQCQ,,,0
+167,H-DS8,444.262500,+,5.000000,,88.5,88.5,023,NN,DV,12.50,,,-1,CQCQCQ,,,0
+168,HPAGE,145.550000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+169,APRS,144.390000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+170,H-DAT1,145.550000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
+171,H-DAT2,145.070000,,0.600000,,88.5,88.5,023,NN,FM,5.00,,,-1,,,,
diff --git a/tests/images/Icom_IC-208H.img b/tests/images/Icom_IC-208H.img
new file mode 100644
index 0000000..8917475
--- /dev/null
+++ b/tests/images/Icom_IC-208H.img
Binary files differ
diff --git a/tests/images/Icom_IC-2100H.img b/tests/images/Icom_IC-2100H.img
new file mode 100644
index 0000000..cf6ffd8
--- /dev/null
+++ b/tests/images/Icom_IC-2100H.img
Binary files differ
diff --git a/tests/images/Icom_IC-2200H.img b/tests/images/Icom_IC-2200H.img
new file mode 100644
index 0000000..56ee266
--- /dev/null
+++ b/tests/images/Icom_IC-2200H.img
Binary files differ
diff --git a/tests/images/Icom_IC-2300H.img b/tests/images/Icom_IC-2300H.img
new file mode 100644
index 0000000..cd6aad0
--- /dev/null
+++ b/tests/images/Icom_IC-2300H.img
Binary files differ
diff --git a/tests/images/Icom_IC-2720H.img b/tests/images/Icom_IC-2720H.img
new file mode 100644
index 0000000..e153ce1
--- /dev/null
+++ b/tests/images/Icom_IC-2720H.img
Binary files differ
diff --git a/tests/images/Icom_IC-2730A.img b/tests/images/Icom_IC-2730A.img
new file mode 100644
index 0000000..73b973a
--- /dev/null
+++ b/tests/images/Icom_IC-2730A.img
Binary files differ
diff --git a/tests/images/Icom_IC-2820H.img b/tests/images/Icom_IC-2820H.img
new file mode 100644
index 0000000..e845f9f
--- /dev/null
+++ b/tests/images/Icom_IC-2820H.img
Binary files differ
diff --git a/tests/images/Icom_IC-P7.img b/tests/images/Icom_IC-P7.img
new file mode 100755
index 0000000..35a0966
--- /dev/null
+++ b/tests/images/Icom_IC-P7.img
Binary files differ
diff --git a/tests/images/Icom_IC-Q7A.img b/tests/images/Icom_IC-Q7A.img
new file mode 100644
index 0000000..bad5f87
--- /dev/null
+++ b/tests/images/Icom_IC-Q7A.img
Binary files differ
diff --git a/tests/images/Icom_IC-T70.img b/tests/images/Icom_IC-T70.img
new file mode 100644
index 0000000..5c09019
--- /dev/null
+++ b/tests/images/Icom_IC-T70.img
Binary files differ
diff --git a/tests/images/Icom_IC-T7H.img b/tests/images/Icom_IC-T7H.img
new file mode 100644
index 0000000..5186620
--- /dev/null
+++ b/tests/images/Icom_IC-T7H.img
Binary files differ
diff --git a/tests/images/Icom_IC-T8A.img b/tests/images/Icom_IC-T8A.img
new file mode 100644
index 0000000..c5bcc45
--- /dev/null
+++ b/tests/images/Icom_IC-T8A.img
Binary files differ
diff --git a/tests/images/Icom_IC-V82_U82.img b/tests/images/Icom_IC-V82_U82.img
new file mode 100644
index 0000000..5a1c0a4
--- /dev/null
+++ b/tests/images/Icom_IC-V82_U82.img
Binary files differ
diff --git a/tests/images/Icom_IC-W32A.img b/tests/images/Icom_IC-W32A.img
new file mode 100644
index 0000000..b5b239c
--- /dev/null
+++ b/tests/images/Icom_IC-W32A.img
Binary files differ
diff --git a/tests/images/Icom_IC-W32E.img b/tests/images/Icom_IC-W32E.img
new file mode 100644
index 0000000..32bee84
--- /dev/null
+++ b/tests/images/Icom_IC-W32E.img
Binary files differ
diff --git a/tests/images/Icom_ID-31A.img b/tests/images/Icom_ID-31A.img
new file mode 100644
index 0000000..afdebdd
--- /dev/null
+++ b/tests/images/Icom_ID-31A.img
Binary files differ
diff --git a/tests/images/Icom_ID-51.img b/tests/images/Icom_ID-51.img
new file mode 100644
index 0000000..399c857
--- /dev/null
+++ b/tests/images/Icom_ID-51.img
Binary files differ
diff --git a/tests/images/Icom_ID-51_Plus.img b/tests/images/Icom_ID-51_Plus.img
new file mode 100755
index 0000000..07bdc7e
--- /dev/null
+++ b/tests/images/Icom_ID-51_Plus.img
Binary files differ
diff --git a/tests/images/Icom_ID-800H_v2.img b/tests/images/Icom_ID-800H_v2.img
new file mode 100644
index 0000000..113f450
--- /dev/null
+++ b/tests/images/Icom_ID-800H_v2.img
Binary files differ
diff --git a/tests/images/Icom_ID-880H.img b/tests/images/Icom_ID-880H.img
new file mode 100644
index 0000000..0a83f24
--- /dev/null
+++ b/tests/images/Icom_ID-880H.img
Binary files differ
diff --git a/tests/images/Jetstream_JT220M.img b/tests/images/Jetstream_JT220M.img
new file mode 100644
index 0000000..bb0b4a7
--- /dev/null
+++ b/tests/images/Jetstream_JT220M.img
Binary files differ
diff --git a/tests/images/Jetstream_JT270M.img b/tests/images/Jetstream_JT270M.img
new file mode 100644
index 0000000..acc95d4
--- /dev/null
+++ b/tests/images/Jetstream_JT270M.img
Binary files differ
diff --git a/tests/images/Jetstream_JT270MH.img b/tests/images/Jetstream_JT270MH.img
new file mode 100644
index 0000000..4027cb0
--- /dev/null
+++ b/tests/images/Jetstream_JT270MH.img
Binary files differ
diff --git a/tests/images/KYD_IP-620.img b/tests/images/KYD_IP-620.img
new file mode 100755
index 0000000..c088dfe
--- /dev/null
+++ b/tests/images/KYD_IP-620.img
Binary files differ
diff --git a/tests/images/KYD_NC-630A.img b/tests/images/KYD_NC-630A.img
new file mode 100755
index 0000000..2c627fa
--- /dev/null
+++ b/tests/images/KYD_NC-630A.img
Binary files differ
diff --git a/tests/images/Kenwood_HMK.hmk b/tests/images/Kenwood_HMK.hmk
new file mode 100644
index 0000000..e8ee04a
--- /dev/null
+++ b/tests/images/Kenwood_HMK.hmk
@@ -0,0 +1,71 @@
+KENWOOD MCP FOR AMATEUR MOBILE TRANSCEIVER
+[Export Software]=MCP-2A Version 3.02
+[Export File Version]=1
+[Type]=E
+[Language]=English
+
+// Comments
+!!Comments=
+
+// Memory Channels
+!!Ch,Rx Freq.,Rx Step,Offset,T/CT/DCS,TO Freq.,CT Freq.,DCS Code,Shift/Split,Rev.,L.Out,Mode,Tx Freq.,Tx Step,M.Name
+"900","00155,500000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","155,500000","025,00","MVHF L1"
+"901","00155,525000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","155,525000","025,00","MVHF L2"
+"902","00155,625000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","155,625000","025,00","MVHF F1"
+"903","00155,775000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","155,775000","025,00","MVHF F2"
+"904","00155,825000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","155,825000","025,00","MVHF F3"
+"905","00156,300000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,300000","025,00","MVHF K06"
+"906","00156,375000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,375000","025,00","MVHF K67"
+"907","00156,400000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,400000","025,00","MVHF K08"
+"908","00156,425000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,425000","025,00","MVHF K68"
+"909","00156,450000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,450000","025,00","MVHF K09"
+"910","00156,475000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,475000","025,00","MVHF K69"
+"911","00156,500000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,500000","025,00","MVHF K10"
+"912","00156,525000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,525000","025,00","MDSC K70"
+"913","00156,550000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,550000","025,00","MVHF K11"
+"914","00156,575000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,575000","025,00","MVHF K71"
+"915","00156,600000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,600000","025,00","MVHF K12"
+"916","00156,625000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,625000","025,00","MVHF K72"
+"917","00156,650000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,650000","025,00","MVHF K13"
+"918","00156,675000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,675000","025,00","MVHF K73"
+"919","00156,700000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,700000","025,00","MVHF K14"
+"920","00156,725000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,725000","025,00","MVHF K74"
+"921","00156,750000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,750000","025,00","MVHF K15"
+"922","00156,800000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,800000","025,00","MVHF K16"
+"923","00156,850000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,850000","025,00","MVHF K17"
+"924","00156,875000","025,00","00,000000","Off","88,5","88,5","023"," ","Off","Off","FM","156,875000","025,00","MVHF K77"
+"925","00160,625000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,625000","025,00","MVHF K60"
+"926","00160,650000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,650000","025,00","MVHF K01"
+"927","00160,675000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,675000","025,00","MVHF K61"
+"928","00160,700000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,700000","025,00","MVHF K02"
+"929","00160,725000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,725000","025,00","MVHF K62"
+"930","00160,750000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,750000","025,00","MVHF K03"
+"931","00160,775000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,775000","025,00","MVHF K63"
+"932","00160,800000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,800000","025,00","MVHF K04"
+"933","00160,825000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,825000","025,00","MVHF K64"
+"934","00160,850000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,850000","025,00","MVHF K05"
+"935","00160,875000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,875000","025,00","MVHF K65"
+"936","00160,925000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,925000","025,00","MVHF K66"
+"937","00160,950000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","160,950000","025,00","MVHF K07"
+"938","00161,500000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,500000","025,00","MVHF K18"
+"939","00161,525000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,525000","025,00","MVHF K78"
+"940","00161,550000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,550000","025,00","MVHF K19"
+"941","00161,575000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,575000","025,00","MVHF K79"
+"942","00161,600000","025,00","04,600000","Off","88,5","88,5","023","-","Off","Off","FM","161,600000","025,00","MVHF K20"
+"943","00161,625000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,625000","025,00","MVHF K80"
+"944","00161,650000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,650000","025,00","MVHF K21"
+"945","00161,675000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,675000","025,00","MVHF K81"
+"946","00161,700000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,700000","025,00","MVHF K22"
+"947","00161,725000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,725000","025,00","MVHF K82"
+"948","00161,750000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,750000","025,00","MVHF K23"
+"949","00161,775000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,775000","025,00","MVHF K83"
+"950","00161,800000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,800000","025,00","MVHF K24"
+"951","00161,825000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,825000","025,00","MVHF K84"
+"952","00161,850000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,850000","025,00","MVHF K25"
+"953","00161,875000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,875000","025,00","MVHF K85"
+"954","00161,900000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,900000","025,00","MVHF K26"
+"955","00161,925000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,925000","025,00","MVHF K86"
+"956","00161,950000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,950000","025,00","MVHF K27"
+"957","00161,975000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","161,975000","025,00","MAIS K87"
+"958","00162,000000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","162,000000","025,00","MVHF K28"
+"959","00162,025000","025,00","04,600000","Off","88,5","88,5","023","-","Off","On","FM","162,025000","025,00","MAIS K88"
diff --git a/tests/images/Kenwood_TH-D72_clone_mode.img b/tests/images/Kenwood_TH-D72_clone_mode.img
new file mode 100644
index 0000000..257c2a2
--- /dev/null
+++ b/tests/images/Kenwood_TH-D72_clone_mode.img
Binary files differ
diff --git a/tests/images/Kenwood_TK-272G.img b/tests/images/Kenwood_TK-272G.img
new file mode 100755
index 0000000..bdeed1f
--- /dev/null
+++ b/tests/images/Kenwood_TK-272G.img
Binary files differ
diff --git a/tests/images/Kenwood_TK-3180K2.img b/tests/images/Kenwood_TK-3180K2.img
new file mode 100644
index 0000000..b3524c9
--- /dev/null
+++ b/tests/images/Kenwood_TK-3180K2.img
Binary files differ
diff --git a/tests/images/Kenwood_TK-760G.img b/tests/images/Kenwood_TK-760G.img
new file mode 100755
index 0000000..23c883a
--- /dev/null
+++ b/tests/images/Kenwood_TK-760G.img
Binary files differ
diff --git a/tests/images/Kenwood_TK-8102.img b/tests/images/Kenwood_TK-8102.img
new file mode 100644
index 0000000..d03fbc4
--- /dev/null
+++ b/tests/images/Kenwood_TK-8102.img
Binary files differ
diff --git a/tests/images/Kenwood_TK-8180.img b/tests/images/Kenwood_TK-8180.img
new file mode 100644
index 0000000..06a5910
--- /dev/null
+++ b/tests/images/Kenwood_TK-8180.img
Binary files differ
diff --git a/tests/images/Kenwood_TS-480_CloneMode.img b/tests/images/Kenwood_TS-480_CloneMode.img
new file mode 100644
index 0000000..2e018a0
--- /dev/null
+++ b/tests/images/Kenwood_TS-480_CloneMode.img
Binary files differ
diff --git a/tests/images/LUITON_LT-725UV.img b/tests/images/LUITON_LT-725UV.img
new file mode 100755
index 0000000..537e13b
--- /dev/null
+++ b/tests/images/LUITON_LT-725UV.img
Binary files differ
diff --git a/tests/images/Leixen_VV-898.img b/tests/images/Leixen_VV-898.img
new file mode 100644
index 0000000..abeec14
--- /dev/null
+++ b/tests/images/Leixen_VV-898.img
Binary files differ
diff --git a/tests/images/Leixen_VV-898S.img b/tests/images/Leixen_VV-898S.img
new file mode 100755
index 0000000..10a264a
--- /dev/null
+++ b/tests/images/Leixen_VV-898S.img
Binary files differ
diff --git a/tests/images/Polmar_DB-50M.img b/tests/images/Polmar_DB-50M.img
new file mode 100644
index 0000000..04df657
--- /dev/null
+++ b/tests/images/Polmar_DB-50M.img
Binary files differ
diff --git a/tests/images/Puxing_PX-2R.img b/tests/images/Puxing_PX-2R.img
new file mode 100644
index 0000000..63c615c
--- /dev/null
+++ b/tests/images/Puxing_PX-2R.img
Binary files differ
diff --git a/tests/images/Puxing_PX-777.img b/tests/images/Puxing_PX-777.img
new file mode 100644
index 0000000..3fceb43
--- /dev/null
+++ b/tests/images/Puxing_PX-777.img
Binary files differ
diff --git a/tests/images/Puxing_PX-888K.img b/tests/images/Puxing_PX-888K.img
new file mode 100644
index 0000000..27d30d0
--- /dev/null
+++ b/tests/images/Puxing_PX-888K.img
Binary files differ
diff --git a/tests/images/QYT_KT7900D.img b/tests/images/QYT_KT7900D.img
new file mode 100755
index 0000000..73bfc37
--- /dev/null
+++ b/tests/images/QYT_KT7900D.img
Binary files differ
diff --git a/tests/images/QYT_KT8900D.img b/tests/images/QYT_KT8900D.img
new file mode 100755
index 0000000..e31310f
--- /dev/null
+++ b/tests/images/QYT_KT8900D.img
Binary files differ
diff --git a/tests/images/Radioddity_R2.img b/tests/images/Radioddity_R2.img
new file mode 100644
index 0000000..0bbd846
--- /dev/null
+++ b/tests/images/Radioddity_R2.img
Binary files differ
diff --git a/tests/images/Radtel_T18.img b/tests/images/Radtel_T18.img
new file mode 100755
index 0000000..f508675
--- /dev/null
+++ b/tests/images/Radtel_T18.img
Binary files differ
diff --git a/tests/images/Retevis_RT21.img b/tests/images/Retevis_RT21.img
new file mode 100644
index 0000000..030d4f7
--- /dev/null
+++ b/tests/images/Retevis_RT21.img
Binary files differ
diff --git a/tests/images/Retevis_RT22.img b/tests/images/Retevis_RT22.img
new file mode 100644
index 0000000..ffca933
--- /dev/null
+++ b/tests/images/Retevis_RT22.img
Binary files differ
diff --git a/tests/images/Retevis_RT23.img b/tests/images/Retevis_RT23.img
new file mode 100755
index 0000000..2bb0252
--- /dev/null
+++ b/tests/images/Retevis_RT23.img
Binary files differ
diff --git a/tests/images/Retevis_RT26.img b/tests/images/Retevis_RT26.img
new file mode 100644
index 0000000..fdb6141
--- /dev/null
+++ b/tests/images/Retevis_RT26.img
Binary files differ
diff --git a/tests/images/TDXone_TD-Q8A.img b/tests/images/TDXone_TD-Q8A.img
new file mode 100755
index 0000000..6bd3d07
--- /dev/null
+++ b/tests/images/TDXone_TD-Q8A.img
Binary files differ
diff --git a/tests/images/TYT_TH-350.img b/tests/images/TYT_TH-350.img
new file mode 100644
index 0000000..7d1fd3c
--- /dev/null
+++ b/tests/images/TYT_TH-350.img
Binary files differ
diff --git a/tests/images/TYT_TH-7800.img b/tests/images/TYT_TH-7800.img
new file mode 100644
index 0000000..5c9240d
--- /dev/null
+++ b/tests/images/TYT_TH-7800.img
Binary files differ
diff --git a/tests/images/TYT_TH-9800.img b/tests/images/TYT_TH-9800.img
new file mode 100644
index 0000000..a2f584b
--- /dev/null
+++ b/tests/images/TYT_TH-9800.img
Binary files differ
diff --git a/tests/images/TYT_TH-UV3R-25.img b/tests/images/TYT_TH-UV3R-25.img
new file mode 100755
index 0000000..d62a459
--- /dev/null
+++ b/tests/images/TYT_TH-UV3R-25.img
Binary files differ
diff --git a/tests/images/TYT_TH-UV3R.img b/tests/images/TYT_TH-UV3R.img
new file mode 100644
index 0000000..75b2cf6
--- /dev/null
+++ b/tests/images/TYT_TH-UV3R.img
Binary files differ
diff --git a/tests/images/TYT_TH-UV8000.img b/tests/images/TYT_TH-UV8000.img
new file mode 100644
index 0000000..71b7aa9
--- /dev/null
+++ b/tests/images/TYT_TH-UV8000.img
Binary files differ
diff --git a/tests/images/TYT_TH-UVF1.img b/tests/images/TYT_TH-UVF1.img
new file mode 100644
index 0000000..f01edd6
--- /dev/null
+++ b/tests/images/TYT_TH-UVF1.img
Binary files differ
diff --git a/tests/images/TYT_TH9000_144.img b/tests/images/TYT_TH9000_144.img
new file mode 100644
index 0000000..871e986
--- /dev/null
+++ b/tests/images/TYT_TH9000_144.img
Binary files differ
diff --git a/tests/images/Vertex_Standard_VXA-700.img b/tests/images/Vertex_Standard_VXA-700.img
new file mode 100644
index 0000000..e0dbbc0
--- /dev/null
+++ b/tests/images/Vertex_Standard_VXA-700.img
Binary files differ
diff --git a/tests/images/WACCOM_MINI-8900.img b/tests/images/WACCOM_MINI-8900.img
new file mode 100755
index 0000000..9b5737a
--- /dev/null
+++ b/tests/images/WACCOM_MINI-8900.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-816.img b/tests/images/Wouxun_KG-816.img
new file mode 100644
index 0000000..090e18d
--- /dev/null
+++ b/tests/images/Wouxun_KG-816.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-818.img b/tests/images/Wouxun_KG-818.img
new file mode 100644
index 0000000..716da73
--- /dev/null
+++ b/tests/images/Wouxun_KG-818.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-UV6.img b/tests/images/Wouxun_KG-UV6.img
new file mode 100644
index 0000000..b1a7795
--- /dev/null
+++ b/tests/images/Wouxun_KG-UV6.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-UV8D.img b/tests/images/Wouxun_KG-UV8D.img
new file mode 100644
index 0000000..1c66447
--- /dev/null
+++ b/tests/images/Wouxun_KG-UV8D.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-UV8D_Plus.img b/tests/images/Wouxun_KG-UV8D_Plus.img
new file mode 100644
index 0000000..23e6f58
--- /dev/null
+++ b/tests/images/Wouxun_KG-UV8D_Plus.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-UV8E.img b/tests/images/Wouxun_KG-UV8E.img
new file mode 100644
index 0000000..89e5e1f
--- /dev/null
+++ b/tests/images/Wouxun_KG-UV8E.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-UV9D_Plus.img b/tests/images/Wouxun_KG-UV9D_Plus.img
new file mode 100644
index 0000000..410e498
--- /dev/null
+++ b/tests/images/Wouxun_KG-UV9D_Plus.img
Binary files differ
diff --git a/tests/images/Wouxun_KG-UVD1P.img b/tests/images/Wouxun_KG-UVD1P.img
new file mode 100644
index 0000000..93df646
--- /dev/null
+++ b/tests/images/Wouxun_KG-UVD1P.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-1500M.img b/tests/images/Yaesu_FT-1500M.img
new file mode 100644
index 0000000..581e353
--- /dev/null
+++ b/tests/images/Yaesu_FT-1500M.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-1802M.img b/tests/images/Yaesu_FT-1802M.img
new file mode 100644
index 0000000..f13e34d
--- /dev/null
+++ b/tests/images/Yaesu_FT-1802M.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-1D_R.img b/tests/images/Yaesu_FT-1D_R.img
new file mode 100644
index 0000000..70190c8
--- /dev/null
+++ b/tests/images/Yaesu_FT-1D_R.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-25R.img b/tests/images/Yaesu_FT-25R.img
new file mode 100644
index 0000000..fef4b0e
--- /dev/null
+++ b/tests/images/Yaesu_FT-25R.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-2800M.img b/tests/images/Yaesu_FT-2800M.img
new file mode 100644
index 0000000..35ccf18
--- /dev/null
+++ b/tests/images/Yaesu_FT-2800M.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-2900R_1900R.img b/tests/images/Yaesu_FT-2900R_1900R.img
new file mode 100755
index 0000000..ef17a61
--- /dev/null
+++ b/tests/images/Yaesu_FT-2900R_1900R.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-450D.img b/tests/images/Yaesu_FT-450D.img
new file mode 100644
index 0000000..09873ea
--- /dev/null
+++ b/tests/images/Yaesu_FT-450D.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-4VR.img b/tests/images/Yaesu_FT-4VR.img
new file mode 100644
index 0000000..ffa6cfe
--- /dev/null
+++ b/tests/images/Yaesu_FT-4VR.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-4XE.img b/tests/images/Yaesu_FT-4XE.img
new file mode 100644
index 0000000..fb8087a
--- /dev/null
+++ b/tests/images/Yaesu_FT-4XE.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-4XR.img b/tests/images/Yaesu_FT-4XR.img
new file mode 100644
index 0000000..b45d1ae
--- /dev/null
+++ b/tests/images/Yaesu_FT-4XR.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-50.img b/tests/images/Yaesu_FT-50.img
new file mode 100755
index 0000000..77cffd7
--- /dev/null
+++ b/tests/images/Yaesu_FT-50.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-60.img b/tests/images/Yaesu_FT-60.img
new file mode 100644
index 0000000..f17d470
--- /dev/null
+++ b/tests/images/Yaesu_FT-60.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-65E.img b/tests/images/Yaesu_FT-65E.img
new file mode 100644
index 0000000..94cda1a
--- /dev/null
+++ b/tests/images/Yaesu_FT-65E.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-65R.img b/tests/images/Yaesu_FT-65R.img
new file mode 100644
index 0000000..c62c3df
--- /dev/null
+++ b/tests/images/Yaesu_FT-65R.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-70D.img b/tests/images/Yaesu_FT-70D.img
new file mode 100644
index 0000000..b557586
--- /dev/null
+++ b/tests/images/Yaesu_FT-70D.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-7100M.img b/tests/images/Yaesu_FT-7100M.img
new file mode 100644
index 0000000..30e18ce
--- /dev/null
+++ b/tests/images/Yaesu_FT-7100M.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-7800_7900.img b/tests/images/Yaesu_FT-7800_7900.img
new file mode 100644
index 0000000..c10a4fb
--- /dev/null
+++ b/tests/images/Yaesu_FT-7800_7900.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-817.img b/tests/images/Yaesu_FT-817.img
new file mode 100644
index 0000000..00e624d
--- /dev/null
+++ b/tests/images/Yaesu_FT-817.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-817ND.img b/tests/images/Yaesu_FT-817ND.img
new file mode 100644
index 0000000..c0a2bb4
--- /dev/null
+++ b/tests/images/Yaesu_FT-817ND.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-817ND_US.img b/tests/images/Yaesu_FT-817ND_US.img
new file mode 100644
index 0000000..210c5a8
--- /dev/null
+++ b/tests/images/Yaesu_FT-817ND_US.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-818.img b/tests/images/Yaesu_FT-818.img
new file mode 100644
index 0000000..59b6e62
--- /dev/null
+++ b/tests/images/Yaesu_FT-818.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-857_897.img b/tests/images/Yaesu_FT-857_897.img
new file mode 100644
index 0000000..ac66f73
--- /dev/null
+++ b/tests/images/Yaesu_FT-857_897.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-857_897_US.img b/tests/images/Yaesu_FT-857_897_US.img
new file mode 100644
index 0000000..20a1c24
--- /dev/null
+++ b/tests/images/Yaesu_FT-857_897_US.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-8800.img b/tests/images/Yaesu_FT-8800.img
new file mode 100644
index 0000000..4cbb883
--- /dev/null
+++ b/tests/images/Yaesu_FT-8800.img
Binary files differ
diff --git a/tests/images/Yaesu_FT-8900.img b/tests/images/Yaesu_FT-8900.img
new file mode 100644
index 0000000..0445467
--- /dev/null
+++ b/tests/images/Yaesu_FT-8900.img
Binary files differ
diff --git a/tests/images/Yaesu_FT2D_R.img b/tests/images/Yaesu_FT2D_R.img
new file mode 100644
index 0000000..459b0ce
--- /dev/null
+++ b/tests/images/Yaesu_FT2D_R.img
Binary files differ
diff --git a/tests/images/Yaesu_FT3D_R.img b/tests/images/Yaesu_FT3D_R.img
new file mode 100644
index 0000000..179d69e
--- /dev/null
+++ b/tests/images/Yaesu_FT3D_R.img
Binary files differ
diff --git a/tests/images/Yaesu_FTM-3200D_R.img b/tests/images/Yaesu_FTM-3200D_R.img
new file mode 100644
index 0000000..d3f3f66
--- /dev/null
+++ b/tests/images/Yaesu_FTM-3200D_R.img
Binary files differ
diff --git a/tests/images/Yaesu_FTM-350.img b/tests/images/Yaesu_FTM-350.img
new file mode 100644
index 0000000..1e19c47
--- /dev/null
+++ b/tests/images/Yaesu_FTM-350.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-2.img b/tests/images/Yaesu_VX-2.img
new file mode 100644
index 0000000..bc237fd
--- /dev/null
+++ b/tests/images/Yaesu_VX-2.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-3.img b/tests/images/Yaesu_VX-3.img
new file mode 100644
index 0000000..eedefd3
--- /dev/null
+++ b/tests/images/Yaesu_VX-3.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-5.img b/tests/images/Yaesu_VX-5.img
new file mode 100644
index 0000000..522c0f3
--- /dev/null
+++ b/tests/images/Yaesu_VX-5.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-6.img b/tests/images/Yaesu_VX-6.img
new file mode 100644
index 0000000..509099d
--- /dev/null
+++ b/tests/images/Yaesu_VX-6.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-7.img b/tests/images/Yaesu_VX-7.img
new file mode 100644
index 0000000..2542f8e
--- /dev/null
+++ b/tests/images/Yaesu_VX-7.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-8DR.img b/tests/images/Yaesu_VX-8DR.img
new file mode 100644
index 0000000..299fdc1
--- /dev/null
+++ b/tests/images/Yaesu_VX-8DR.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-8GE.img b/tests/images/Yaesu_VX-8GE.img
new file mode 100644
index 0000000..a140121
--- /dev/null
+++ b/tests/images/Yaesu_VX-8GE.img
Binary files differ
diff --git a/tests/images/Yaesu_VX-8R.img b/tests/images/Yaesu_VX-8R.img
new file mode 100644
index 0000000..0ae38f7
--- /dev/null
+++ b/tests/images/Yaesu_VX-8R.img
Binary files differ
diff --git a/tests/run_tests b/tests/run_tests
new file mode 100755
index 0000000..226de0c
--- /dev/null
+++ b/tests/run_tests
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec python $(readlink -f $0).py $*
diff --git a/tests/run_tests.py b/tests/run_tests.py
new file mode 100755
index 0000000..e13fd8c
--- /dev/null
+++ b/tests/run_tests.py
@@ -0,0 +1,1372 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import print_function
+from builtins import bytes
+import copy
+import traceback
+import sys
+import os
+import shutil
+import glob
+import tempfile
+import time
+from optparse import OptionParser
+from serial import Serial
+
+# change to the tests directory
+scriptdir = os.path.dirname(sys.argv[0])
+if scriptdir:
+ os.chdir(scriptdir)
+
+sys.path.insert(0, "../")
+
+os.environ['CHIRP_TESTENV'] = 'sigh'
+import logging
+from chirp import logger
+
+class LoggerOpts(object):
+ quiet = 2
+ verbose = 0
+ log_file = os.path.join('logs', 'debug.log')
+ log_level = logging.DEBUG
+
+if not os.path.exists("logs"):
+ os.mkdir("logs")
+logger.handle_options(LoggerOpts())
+
+from chirp import CHIRP_VERSION
+# FIXME: Not all drivers are py3 compatible in syntax, so punt on this
+# until that time, and defer to the safe import loop below.
+# from chirp.drivers import *
+from chirp import chirp_common, directory
+from chirp import import_logic, memmap, settings, errors
+from chirp import settings
+
+directory.safe_import_drivers()
+
+from chirp.drivers import generic_csv
+
+TESTS = {}
+
+time.sleep = lambda s: None
+
+
+class TestError(Exception):
+ def get_detail(self):
+ return str(self)
+
+
+class TestInternalError(TestError):
+ pass
+
+
+class TestCrashError(TestError):
+ def __init__(self, tb, exc, args):
+ Exception.__init__(self, str(exc))
+ self.__tb = tb
+ self.__exc = exc
+ self.__args = args
+ self.__mytb = "".join(traceback.format_stack())
+
+ def __str__(self):
+ return str(self.__exc)
+
+ def get_detail(self):
+ return str(self.__exc) + os.linesep + \
+ ("Args were: %s" % self.__args) + os.linesep + \
+ self.__tb + os.linesep + \
+ "Called from:" + os.linesep + self.__mytb
+
+ def get_original_exception(self):
+ return self.__exc
+
+
+class TestFailedError(TestError):
+ def __init__(self, msg, detail=""):
+ TestError.__init__(self, msg)
+ self._detail = detail
+
+ def get_detail(self):
+ return self._detail
+
+
+class TestSkippedError(TestError):
+ pass
+
+
+def get_tb():
+ return traceback.format_exc()
+
+
+class TestWrapper:
+ def __init__(self, dstclass, filename, dst=None):
+ self._ignored_exceptions = []
+ self._dstclass = dstclass
+ self._filename = filename
+ self._make_reload = False
+ self._dst = dst
+ self.open()
+
+ def pass_exception_type(self, et):
+ self._ignored_exceptions.append(et)
+
+ def nopass_exception_type(self, et):
+ self._ignored_exceptions.remove(et)
+
+ def make_reload(self):
+ self._make_reload = True
+
+ def open(self):
+ if self._dst:
+ self._dst.load_mmap(self._filename)
+ else:
+ self._dst = self._dstclass(self._filename)
+
+ def close(self):
+ self._dst.save_mmap(self._filename)
+
+ def do(self, function, *args, **kwargs):
+ if self._make_reload:
+ try:
+ self.open()
+ except Exception as e:
+ raise TestCrashError(get_tb(), e, "[Loading]")
+
+ try:
+ fn = getattr(self._dst, function)
+ except KeyError:
+ raise TestInternalError("Model lacks function `%s'" % function)
+
+ try:
+ ret = fn(*args, **kwargs)
+ except Exception as e:
+ if type(e) in self._ignored_exceptions:
+ raise e
+ details = str(args) + str(kwargs)
+ for arg in args:
+ if isinstance(arg, chirp_common.Memory):
+ details += os.linesep + \
+ os.linesep.join(["%s:%s" % (k, v) for k, v
+ in list(arg.__dict__.items())])
+ raise TestCrashError(get_tb(), e, details)
+
+ if self._make_reload:
+ try:
+ self.close()
+ except Exception as e:
+ raise TestCrashError(get_tb(), e, "[Saving]")
+
+ return ret
+
+ def get_id(self):
+ return "%s %s %s" % (self._dst.VENDOR,
+ self._dst.MODEL,
+ self._dst.VARIANT)
+
+ def get_radio(self):
+ return self._dst
+
+
+class TestCase:
+ def __init__(self, wrapper):
+ self._wrapper = wrapper
+
+ def prepare(self):
+ pass
+
+ def run(self):
+ "Return True or False for Pass/Fail"
+ pass
+
+ def cleanup(self):
+ pass
+
+ def compare_mem(self, a, b, ignore=None):
+ rf = self._wrapper.do("get_features")
+
+ if a.tmode == "Cross":
+ tx_mode, rx_mode = a.cross_mode.split("->")
+
+ for k, v in list(a.__dict__.items()):
+ if ignore and k in ignore:
+ continue
+ if k == "power":
+ continue # FIXME
+ elif k == "immutable":
+ continue
+ elif k == "name":
+ if not rf.has_name:
+ continue # Don't complain about name, if not supported
+ else:
+ # Name mismatch fair if filter_name() is right
+ v = self._wrapper.do("filter_name", v).rstrip()
+ elif k == "tuning_step" and not rf.has_tuning_step:
+ continue
+ elif k == "rtone" and not (
+ a.tmode == "Tone" or
+ (a.tmode == "TSQL" and not rf.has_ctone) or
+ (a.tmode == "Cross" and tx_mode == "Tone") or
+ (a.tmode == "Cross" and rx_mode == "Tone" and
+ not rf.has_ctone)
+ ):
+ continue
+ elif k == "ctone" and (not rf.has_ctone or
+ not (a.tmode == "TSQL" or
+ (a.tmode == "Cross" and
+ rx_mode == "Tone"))):
+ continue
+ elif k == "dtcs" and not (
+ (a.tmode == "DTCS" and not rf.has_rx_dtcs) or
+ (a.tmode == "Cross" and tx_mode == "DTCS") or
+ (a.tmode == "Cross" and rx_mode == "DTCS" and
+ not rf.has_rx_dtcs)):
+ continue
+ elif k == "rx_dtcs" and (not rf.has_rx_dtcs or
+ not (a.tmode == "Cross" and
+ rx_mode == "DTCS")):
+ continue
+ elif k == "offset" and not a.duplex:
+ continue
+ elif k == "cross_mode" and a.tmode != "Cross":
+ continue
+
+ try:
+ if b.__dict__[k] != v:
+ msg = "Field `%s' " % k + \
+ "is `%s', " % b.__dict__[k] + \
+ "expected `%s' " % v
+ # If we set a channel that came back with a duplex
+ # of 'off', we may have been outside the transmit range of
+ # the radio, so we should not fail.
+ if k == "duplex" and b.__dict__[k] == "off":
+ continue
+ details = msg
+ details += os.linesep + "### Wanted:" + os.linesep
+ details += os.linesep.join(["%s:%s" % (k, v) for k, v
+ in list(a.__dict__.items())])
+ details += os.linesep + "### Got:" + os.linesep
+ details += os.linesep.join(["%s:%s" % (k, v) for k, v
+ in list(b.__dict__.items())])
+ raise TestFailedError(msg, details)
+ except KeyError as e:
+ print(sorted(a.__dict__.keys()))
+ print(sorted(b.__dict__.keys()))
+ raise
+
+
+class TestCaseCopyAll(TestCase):
+ "Copy Memories From CSV"
+
+ def __str__(self):
+ return "CopyAll"
+
+ def prepare(self):
+ testbase = os.path.dirname(os.path.abspath(__file__))
+ source = os.path.join(testbase, 'images', 'Generic_CSV.csv')
+ self._src = generic_csv.CSVRadio(source)
+
+ def run(self):
+ src_rf = self._src.get_features()
+ bounds = src_rf.memory_bounds
+
+ dst_rf = self._wrapper.do("get_features")
+ dst_number = dst_rf.memory_bounds[0]
+
+ failures = []
+
+ for number in range(bounds[0], bounds[1]):
+ src_mem = self._src.get_memory(number)
+ if src_mem.empty:
+ continue
+
+ try:
+ dst_mem = import_logic.import_mem(self._wrapper.get_radio(),
+ src_rf, src_mem,
+ overrides={
+ "number": dst_number})
+ import_logic.import_bank(self._wrapper.get_radio(),
+ self._src,
+ dst_mem,
+ src_mem)
+ except import_logic.DestNotCompatible:
+ continue
+ except import_logic.ImportError as e:
+ failures.append(TestFailedError("<%i>: Import Failed: %s" %
+ (dst_number, e)))
+ continue
+ except Exception as e:
+ raise TestCrashError(get_tb(), e, "[Import]")
+
+ self._wrapper.do("set_memory", dst_mem)
+ ret_mem = self._wrapper.do("get_memory", dst_number)
+
+ try:
+ self.compare_mem(dst_mem, ret_mem)
+ except TestFailedError as e:
+ failures.append(
+ TestFailedError("<%i>: %s" % (number, e), e.get_detail()))
+
+ return failures
+TESTS["CopyAll"] = TestCaseCopyAll
+
+
+class TestCaseBruteForce(TestCase):
+ def __str__(self):
+ return "BruteForce"
+
+ def set_and_compare(self, m):
+ msgs = self._wrapper.do("validate_memory", m)
+ if msgs:
+ # If the radio correctly refuses memories it can't
+ # store, don't fail
+ return
+
+ self._wrapper.do("set_memory", m)
+ ret_m = self._wrapper.do("get_memory", m.number)
+
+ # Damned Baofeng radios don't seem to properly store
+ # shift and direction, so be gracious here
+ if m.duplex == "split" and ret_m.duplex in ["-", "+"]:
+ ret_m.offset = ret_m.freq + \
+ (ret_m.offset * int(ret_m.duplex + "1"))
+ ret_m.duplex = "split"
+
+ self.compare_mem(m, ret_m)
+
+ def do_tone(self, m, rf):
+ self._wrapper.pass_exception_type(errors.UnsupportedToneError)
+ for tone in chirp_common.TONES:
+ for tmode in rf.valid_tmodes:
+ if tmode not in chirp_common.TONE_MODES:
+ continue
+ elif tmode in ["DTCS", "DTCS-R", "Cross"]:
+ continue # We'll test DCS and Cross tones separately
+
+ m.tmode = tmode
+ if tmode == "":
+ pass
+ elif tmode == "Tone":
+ m.rtone = tone
+ elif tmode in ["TSQL", "TSQL-R"]:
+ if rf.has_ctone:
+ m.ctone = tone
+ else:
+ m.rtone = tone
+ else:
+ raise TestInternalError("Unknown tone mode `%s'" % tmode)
+
+ try:
+ self.set_and_compare(m)
+ except errors.UnsupportedToneError as e:
+ # If a radio doesn't support a particular tone value,
+ # don't punish it
+ pass
+ self._wrapper.nopass_exception_type(errors.UnsupportedToneError)
+
+ def do_dtcs(self, m, rf):
+ if not rf.has_dtcs:
+ return
+
+ m.tmode = "DTCS"
+ for code in rf.valid_dtcs_codes:
+ m.dtcs = code
+ self.set_and_compare(m)
+
+ if not rf.has_dtcs_polarity:
+ return
+
+ for pol in rf.valid_dtcs_pols:
+ m.dtcs_polarity = pol
+ self.set_and_compare(m)
+
+ def do_cross(self, m, rf):
+ if not rf.has_cross:
+ return
+
+ m.tmode = "Cross"
+ # No fair asking a radio to detect two identical tones as Cross instead
+ # of TSQL
+ m.rtone = 100.0
+ m.ctone = 107.2
+ m.dtcs = 506
+ m.rx_dtcs = 516
+ for cross_mode in rf.valid_cross_modes:
+ m.cross_mode = cross_mode
+ self.set_and_compare(m)
+
+ def do_duplex(self, m, rf):
+ for duplex in rf.valid_duplexes:
+ if duplex not in ["", "-", "+", "split"]:
+ continue
+ if duplex == "split" and not rf.can_odd_split:
+ raise TestFailedError("Forgot to set rf.can_odd_split!")
+ if duplex == "split":
+ m.offset = rf.valid_bands[0][1] - 100000
+ m.duplex = duplex
+ self.set_and_compare(m)
+
+ if rf.can_odd_split and "split" not in rf.valid_duplexes:
+ raise TestFailedError("Paste error: rf.can_odd_split defined, but "
+ "split duplex not supported.")
+
+ def do_skip(self, m, rf):
+ for skip in rf.valid_skips:
+ m.skip = skip
+ self.set_and_compare(m)
+
+ def do_mode(self, m, rf):
+ def ensure_urcall(call):
+ l = self._wrapper.do("get_urcall_list")
+ l[0] = call
+ self._wrapper.do("set_urcall_list", l)
+
+ def ensure_rptcall(call):
+ l = self._wrapper.do("get_repeater_call_list")
+ l[0] = call
+ self._wrapper.do("set_repeater_call_list", l)
+
+ def freq_is_ok(freq):
+ for lo, hi in rf.valid_bands:
+ if freq > lo and freq < hi:
+ return True
+ return False
+
+ successes = 0
+ for mode in rf.valid_modes:
+ tmp = copy.deepcopy(m)
+ if mode not in chirp_common.MODES:
+ continue
+ if mode == "DV":
+ tmp = chirp_common.DVMemory()
+ try:
+ ensure_urcall(tmp.dv_urcall)
+ ensure_rptcall(tmp.dv_rpt1call)
+ ensure_rptcall(tmp.dv_rpt2call)
+ except IndexError:
+ if rf.requires_call_lists:
+ raise
+ else:
+ # This radio may not do call lists at all,
+ # so let it slide
+ pass
+ if mode == "FM" and freq_is_ok(tmp.freq + 100000000):
+ # Some radios don't support FM below approximately 30MHz,
+ # so jump up by 100MHz, if they support that
+ tmp.freq += 100000000
+
+ tmp.mode = mode
+
+ if rf.validate_memory(tmp):
+ # A result (of error messages) from validate means the radio
+ # thinks this is invalid, so don't fail the test
+ print('Failed to validate %s: %s' % (tmp, rf.validate_memory(tmp)))
+ continue
+
+ self.set_and_compare(tmp)
+ successes += 1
+
+ if (not successes) and rf.valid_modes:
+ raise TestFailedError("All modes were skipped, "
+ "something went wrong")
+
+ def run(self):
+ rf = self._wrapper.do("get_features")
+
+ def clean_mem():
+ m = chirp_common.Memory()
+ m.number = rf.memory_bounds[0]
+ try:
+ m.mode = rf.valid_modes[0]
+ except IndexError:
+ pass
+ if rf.valid_bands:
+ m.freq = rf.valid_bands[0][0] + 600000
+ else:
+ m.freq = 146520000
+ if m.freq < 30000000 and "AM" in rf.valid_modes:
+ m.mode = "AM"
+ return m
+
+ tests = [
+ self.do_tone,
+ self.do_dtcs,
+ self.do_cross,
+ self.do_duplex,
+ self.do_skip,
+ self.do_mode,
+ ]
+ for test in tests:
+ test(clean_mem(), rf)
+
+ if 12.5 in rf.valid_tuning_steps and \
+ "split" in rf.valid_duplexes:
+ m = clean_mem()
+ if rf.valid_bands:
+ m.offset = rf.valid_bands[0][1] - 12500
+ else:
+ m.offset = 151137500
+ m.duplex = "split"
+ self.set_and_compare(m)
+
+ return []
+TESTS["BruteForce"] = TestCaseBruteForce
+
+
+class TestCaseEdges(TestCase):
+ def __str__(self):
+ return "Edges"
+
+ def _mem(self, rf):
+ m = chirp_common.Memory()
+ m.freq = rf.valid_bands[0][0] + 1000000
+ if m.freq < 30000000 and "AM" in rf.valid_modes:
+ m.mode = "AM"
+ else:
+ try:
+ m.mode = rf.valid_modes[0]
+ except IndexError:
+ pass
+
+ for i in range(*rf.memory_bounds):
+ m.number = i
+ if not self._wrapper.do("validate_memory", m):
+ return m
+
+ raise TestSkippedError("No mutable memory locations found")
+
+ def do_longname(self, rf):
+ m = self._mem(rf)
+ m.name = ("X" * 256) # Should be longer than any radio can handle
+ m.name = self._wrapper.do("filter_name", m.name)
+
+ self._wrapper.do("set_memory", m)
+ n = self._wrapper.do("get_memory", m.number)
+
+ self.compare_mem(m, n)
+
+ def do_badname(self, rf):
+ m = self._mem(rf)
+
+ ascii = "".join([chr(x) for x in range(ord(" "), ord("~")+1)])
+ for i in range(0, len(ascii), 4):
+ m.name = self._wrapper.do("filter_name", ascii[i:i+4])
+ self._wrapper.do("set_memory", m)
+ n = self._wrapper.do("get_memory", m.number)
+ self.compare_mem(m, n)
+
+ def do_bandedges(self, rf):
+ m = self._mem(rf)
+ min_step = min(rf.has_tuning_step and rf.valid_tuning_steps or [10])
+
+ for low, high in rf.valid_bands:
+ for freq in (low, high - int(min_step * 1000)):
+ m.freq = freq
+ if self._wrapper.do("validate_memory", m):
+ # Radio doesn't like it, so skip
+ continue
+
+ self._wrapper.do("set_memory", m)
+ n = self._wrapper.do("get_memory", m.number)
+ self.compare_mem(m, n)
+
+ def do_oddsteps(self, rf):
+ odd_steps = {
+ 145000000: [145856250, 145862500],
+ 445000000: [445856250, 445862500],
+ 862000000: [862731250, 862737500],
+ }
+
+ m = self._mem(rf)
+
+ for low, high in rf.valid_bands:
+ for band, totest in list(odd_steps.items()):
+ if band < low or band > high:
+ continue
+ for testfreq in totest:
+ step = chirp_common.required_step(testfreq)
+ if step not in rf.valid_tuning_steps:
+ continue
+
+ m.freq = testfreq
+ m.tuning_step = step
+ self._wrapper.do("set_memory", m)
+ n = self._wrapper.do("get_memory", m.number)
+ self.compare_mem(m, n, ignore=['tuning_step'])
+
+ def do_empty_to_not(self, rf):
+ firstband = rf.valid_bands[0]
+ testfreq = firstband[0]
+ for loc in range(*rf.memory_bounds):
+ m = self._wrapper.do('get_memory', loc)
+ if m.empty:
+ m.empty = False
+ m.freq = testfreq
+ self._wrapper.do('set_memory', m)
+ m = self._wrapper.do('get_memory', loc)
+ if m.freq == testfreq:
+ return
+ else:
+ raise TestFailedError('Radio failed to set an empty '
+ 'location (%i)' % loc)
+
+ def do_delete_memory(self, rf):
+ firstband = rf.valid_bands[0]
+ testfreq = firstband[0]
+ for loc in range(*rf.memory_bounds):
+ if loc == rf.memory_bounds[0]:
+ # Some radios will not allow you to delete the first memory
+ # /me glares at yaesu
+ continue
+ m = self._wrapper.do('get_memory', loc)
+ if not m.empty:
+ m.empty = True
+ self._wrapper.do('set_memory', m)
+ m = self._wrapper.do('get_memory', loc)
+ if not m.empty:
+ raise TestFailedError('Radio refused to delete a memory '
+ 'location (%i)' % loc)
+ else:
+ return
+
+ def run(self):
+ rf = self._wrapper.do("get_features")
+
+ if not rf.valid_bands:
+ raise TestFailedError("Radio does not provide valid bands!")
+
+ self.do_longname(rf)
+ self.do_bandedges(rf)
+ self.do_oddsteps(rf)
+ self.do_badname(rf)
+ if rf.can_delete:
+ self.do_empty_to_not(rf)
+ self.do_delete_memory(rf)
+
+ return []
+
+TESTS["Edges"] = TestCaseEdges
+
+
+class TestCaseSettings(TestCase):
+ def __str__(self):
+ return "Settings"
+
+ def do_get_settings(self, rf):
+ lst = self._wrapper.do("get_settings")
+ if not isinstance(lst, list):
+ raise TestFailedError("Invalid Radio Settings")
+
+ def do_same_settings(self, rf):
+ o = self._wrapper.do("get_settings")
+ self._wrapper.do("set_settings", o)
+ n = self._wrapper.do("get_settings")
+ list(map(self.compare_settings, o, n))
+
+ @staticmethod
+ def compare_settings(a, b):
+ try:
+ if isinstance(a, settings.RadioSettingValue):
+ raise TypeError('Hit bottom')
+ list(map(TestCaseSettings.compare_settings, a, b))
+ except TypeError:
+ if a.get_value() != b.get_value():
+ msg = "Field is `%s', " % b + \
+ "expected `%s' " % a
+ details = msg
+ raise TestFailedError(msg, details)
+
+ def run(self):
+ rf = self._wrapper.do("get_features")
+
+ if not rf.has_settings:
+ raise TestSkippedError("Settings not supported")
+
+ self.do_get_settings(rf)
+ self.do_same_settings(rf)
+
+ return []
+
+TESTS["Settings"] = TestCaseSettings
+
+
+class TestCaseBanks(TestCase):
+ def __str__(self):
+ return "Banks"
+
+ def _do_bank_names(self, rf, testname):
+ bm = self._wrapper.do("get_bank_model")
+ banks = bm.get_mappings()
+
+ for bank in banks:
+ name = bank.get_name()
+ try:
+ bank.set_name(testname)
+ except AttributeError:
+ return [], []
+ except Exception as e:
+ if str(e) == "Not implemented":
+ return [], []
+ else:
+ raise e
+
+ return banks, bm.get_mappings()
+
+ def do_bank_names(self, rf):
+ banks, newbanks = self._do_bank_names(rf, "T")
+
+ for i in range(0, len(banks)):
+ if banks[i].get_name() != newbanks[i].get_name():
+ raise TestFailedError("Bank names not preserved",
+ "Tried %s on %i\nGot %s" % (banks[i],
+ i,
+ newbanks[i]))
+
+ def do_bank_names_toolong(self, rf):
+ testname = "Not possibly this long"
+ banks, newbanks = self._do_bank_names(rf, testname)
+
+ for i in range(0, len(newbanks)):
+ # Truncation is allowed, but not failure
+ if not testname.lower().startswith(str(newbanks[i]).lower()):
+ raise TestFailedError("Bank names not properly truncated",
+ "Tried: %s on %i\nGot: %s" %
+ (testname, i, newbanks[i]))
+
+ def do_bank_names_no_trailing_whitespace(self, rf):
+ banks, newbanks = self._do_bank_names(rf, "foo ")
+
+ for bank in newbanks:
+ if str(bank) != str(bank).rstrip():
+ raise TestFailedError("Bank names stored with " +
+ "trailing whitespace")
+
+ def do_bank_store(self, rf):
+ loc = rf.memory_bounds[0]
+ mem = chirp_common.Memory()
+ mem.number = loc
+ mem.freq = rf.valid_bands[0][0] + 100000
+
+ # Make sure the memory is empty and we create it from scratch
+ mem.empty = True
+ self._wrapper.do("set_memory", mem)
+
+ mem.empty = False
+ self._wrapper.do("set_memory", mem)
+
+ model = self._wrapper.do("get_bank_model")
+
+ # If in your bank model every channel has to be tied to a bank, just
+ # add a variable named channelAlwaysHasBank to it and make it True
+ try:
+ channelAlwaysHasBank = model.channelAlwaysHasBank
+ except:
+ channelAlwaysHasBank = False
+
+ mem_banks = model.get_memory_mappings(mem)
+ if channelAlwaysHasBank:
+ if len(mem_banks) == 0:
+ raise TestFailedError("Freshly-created memory has no banks " +
+ "and it should", "Bank: %s" %
+ str(mem_banks))
+ else:
+ if len(mem_banks) != 0:
+ raise TestFailedError("Freshly-created memory has banks " +
+ "and should not", "Bank: %s" %
+ str(mem_banks))
+
+ banks = model.get_mappings()
+
+ def verify(bank):
+ if bank not in model.get_memory_mappings(mem):
+ return "Memory does not claim bank"
+
+ if loc not in [x.number for x in model.get_mapping_memories(bank)]:
+ return "Bank does not claim memory"
+
+ return None
+
+ model.add_memory_to_mapping(mem, banks[0])
+ reason = verify(banks[0])
+ if reason is not None:
+ raise TestFailedError("Setting memory bank does not persist",
+ "%s\nMemory banks:%s\nBank memories:%s" %
+ (reason,
+ model.get_memory_mappings(mem),
+ model.get_mapping_memories(banks[0])))
+
+ model.remove_memory_from_mapping(mem, banks[0])
+ reason = verify(banks[0])
+ if reason is None and not channelAlwaysHasBank:
+ raise TestFailedError("Memory remains in bank after remove",
+ reason)
+
+ try:
+ model.remove_memory_from_mapping(mem, banks[0])
+ did_error = False
+ except Exception:
+ did_error = True
+
+ if not did_error and not channelAlwaysHasBank:
+ raise TestFailedError("Removing memory from non-member bank " +
+ "did not raise Exception")
+
+ def do_bank_index(self, rf):
+ if not rf.has_bank_index:
+ return
+
+ loc = rf.memory_bounds[0]
+ mem = chirp_common.Memory()
+ mem.number = loc
+ mem.freq = rf.valid_bands[0][0] + 100000
+
+ self._wrapper.do("set_memory", mem)
+
+ model = self._wrapper.do("get_bank_model")
+ banks = model.get_mappings()
+ index_bounds = model.get_index_bounds()
+
+ model.add_memory_to_mapping(mem, banks[0])
+ for i in range(0, *index_bounds):
+ model.set_memory_index(mem, banks[0], i)
+ if model.get_memory_index(mem, banks[0]) != i:
+ raise TestFailedError("Bank index not persisted")
+
+ suggested_index = model.get_next_mapping_index(banks[0])
+ if suggested_index not in list(range(*index_bounds)):
+ raise TestFailedError("Suggested bank index not in valid range",
+ "Got %i, range is %s" % (suggested_index,
+ index_bounds))
+
+ def run(self):
+ rf = self._wrapper.do("get_features")
+
+ if not rf.has_bank:
+ raise TestSkippedError("Banks not supported")
+
+ self.do_bank_names(rf)
+ self.do_bank_names_toolong(rf)
+ self.do_bank_names_no_trailing_whitespace(rf)
+ self.do_bank_store(rf)
+ # Again to make sure we clear bank info on delete
+ self.do_bank_store(rf)
+ self.do_bank_index(rf)
+
+ return []
+
+TESTS["Banks"] = TestCaseBanks
+
+
+class TestCaseDetect(TestCase):
+ def __str__(self):
+ return "Detect"
+
+ def run(self):
+ if isinstance(self._wrapper._dst, chirp_common.LiveRadio):
+ raise TestSkippedError("This is a live radio")
+
+ filename = self._wrapper._filename
+
+ try:
+ radio = directory.get_radio_by_image(filename)
+ except Exception as e:
+ raise TestFailedError("Failed to detect", str(e))
+
+ if radio.__class__.__name__ == 'DynamicRadioAlias':
+ # This was detected via metadata and wrapped, which means
+ # we found the appropriate class.
+ pass
+ elif issubclass(self._wrapper._dstclass, radio.__class__):
+ pass
+ elif issubclass(radio.__class__, self._wrapper._dstclass):
+ pass
+ elif radio.__class__ != self._wrapper._dstclass:
+ raise TestFailedError("%s detected as %s" %
+ (self._wrapper._dstclass, radio.__class__))
+ return []
+
+TESTS["Detect"] = TestCaseDetect
+
+
+class TestCaseClone(TestCase):
+ class SerialNone:
+ def __init__(self, isbytes):
+ self.isbytes = isbytes
+ self.mismatch = False
+ self.mismatch_at = None
+
+ def read(self, size):
+ if self.isbytes:
+ return b""
+ else:
+ return ""
+
+ def write(self, data):
+ expected = self.isbytes and bytes or str
+ if six.PY2:
+ # One driver uses bytearray() which will trigger this
+ # check even though it works fine on py2. So, only
+ # do this check for PY3 which is where it matters
+ # anyway.
+ pass
+ elif not self.mismatch and not isinstance(data, expected):
+ self.mismatch = True
+ self.mismatch_at = ''.join(traceback.format_stack())
+ pass
+
+ def setBaudrate(self, rate):
+ pass
+
+ def setTimeout(self, timeout):
+ pass
+
+ def setParity(self, parity):
+ pass
+
+ def __str__(self):
+ return self.__class__.__name__.replace("Serial", "")
+
+ class SerialError(SerialNone):
+ def read(self, size):
+ raise Exception("Foo")
+
+ def write(self, data):
+ raise Exception("Bar")
+
+ class SerialGarbage(SerialNone):
+ def read(self, size):
+ if self.isbytes:
+ buf = []
+ for i in range(0, size):
+ buf += i % 256
+ return bytes(buf)
+ else:
+ buf = ""
+ for i in range(0, size):
+ buf += chr(i % 256)
+ return buf
+
+ class SerialShortGarbage(SerialNone):
+ def read(self, size):
+ if self.isbytes:
+ return b'\x00' * (size - 1)
+ else:
+ return "\x00" * (size - 1)
+
+ def __str__(self):
+ return "Clone"
+
+ def _run(self, serial):
+ error = None
+ live = isinstance(self._wrapper._dst, chirp_common.LiveRadio)
+ clone = isinstance(self._wrapper._dst, chirp_common.CloneModeRadio)
+
+ if not clone and not live:
+ raise TestSkippedError('Does not support clone')
+
+ try:
+ radio = self._wrapper._dst.__class__(serial)
+ radio.status_fn = lambda s: True
+ except Exception as e:
+ error = e
+
+ if not live:
+ if error is not None:
+ raise TestFailedError("Clone radio tried to read from " +
+ "serial on init")
+ else:
+ if not isinstance(error, errors.RadioError):
+ raise TestFailedError("Live radio didn't notice serial " +
+ "was dead on init")
+ return [] # Nothing more to test on an error'd live radio
+
+ error = None
+ try:
+ radio.sync_in()
+ except Exception as e:
+ error = e
+
+ if error is None:
+ raise TestFailedError("Radio did not raise exception " +
+ "with %s data" % serial,
+ "On sync_in()")
+ elif not isinstance(error, errors.RadioError):
+ raise TestFailedError("Radio did not raise RadioError " +
+ "with %s data" % serial,
+ "sync_in() Got: %s (%s)\n%s" %
+ (error.__class__.__name__,
+ error, get_tb()))
+
+ if radio.NEEDS_COMPAT_SERIAL:
+ radio._mmap = memmap.MemoryMap("\x00" * (1024 * 128))
+ else:
+ radio._mmap = memmap.MemoryMapBytes(bytes(b"\x00") * (1024 * 128))
+
+ error = None
+ try:
+ radio.sync_out()
+ except Exception as e:
+ error = e
+
+ if error is None:
+ raise TestFailedError("Radio did not raise exception " +
+ "with %s data" % serial,
+ "On sync_out()")
+ elif not isinstance(error, errors.RadioError):
+ raise TestFailedError("Radio did not raise RadioError " +
+ "with %s data" % serial,
+ "sync_out(): Got: %s (%s)" %
+ (error.__class__.__name__, error))
+
+ if serial.mismatch:
+ raise TestFailedError("Radio tried to write the wrong "
+ "type of data to the %s pipe." % (
+ serial.__class__.__name__),
+ "TestClone:%s\n%s" % (
+ serial.__class__.__name__,
+ serial.mismatch_at))
+
+ return []
+
+ def run(self):
+ isbytes = not self._wrapper._dst.NEEDS_COMPAT_SERIAL
+ self._run(self.SerialError(isbytes))
+ self._run(self.SerialNone(isbytes))
+ self._run(self.SerialGarbage(isbytes))
+ self._run(self.SerialShortGarbage(isbytes))
+ return []
+
+TESTS["Clone"] = TestCaseClone
+
+
+class TestOutput:
+ def __init__(self, output=None):
+ if not output:
+ output = sys.stdout
+ self._out = output
+
+ def prepare(self):
+ pass
+
+ def cleanup(self):
+ pass
+
+ def _print(self, string):
+ print(string, file=self._out)
+
+ def report(self, rclass, tc, msg, e):
+ name = ("%s %s" % (rclass.MODEL, rclass.VARIANT))[:13]
+ self._print("%9s %-13s %-10s %s %s" % (rclass.VENDOR.split(" ")[0],
+ name,
+ tc,
+ msg, e))
+
+
+class TestOutputANSI(TestOutput):
+ def __init__(self, output=None):
+ TestOutput.__init__(self, output)
+ self.__counts = {
+ "PASSED": 0,
+ "FAILED": 0,
+ "CRASHED": 0,
+ "SKIPPED": 0,
+ }
+ self.__total = 0
+
+ def report(self, rclass, tc, msg, e):
+ self.__total += 1
+ self.__counts[msg] += 1
+ msg += ":"
+ if os.isatty(1):
+ if msg == "PASSED:":
+ msg = "\033[1;32m%8s\033[0m" % msg
+ elif msg == "FAILED:":
+ msg = "\033[1;41m%8s\033[0m" % msg
+ elif msg == "CRASHED:":
+ msg = "\033[1;45m%8s\033[0m" % msg
+ elif msg == "SKIPPED:":
+ msg = "\033[1;32m%8s\033[0m" % msg
+ else:
+ msg = "%8s" % msg
+
+ TestOutput.report(self, rclass, tc, msg, e)
+
+ def cleanup(self):
+ self._print("-" * 70)
+ self._print("Results:")
+ self._print(" %-7s: %i" % ("TOTAL", self.__total))
+ for t, c in list(self.__counts.items()):
+ self._print(" %-7s: %i" % (t, c))
+
+
+class TestOutputHTML(TestOutput):
+ def __init__(self, filename):
+ self._filename = filename
+
+ def prepare(self):
+ print("Writing to %s" % self._filename, end=' ')
+ sys.stdout.flush()
+ self._out = file(self._filename, "w")
+ s = """
+<html>
+<head>
+<title>Test report for CHIRP version %s</title>
+<style>
+table.testlist {
+ border: thin solid black;
+ border-collapse: collapse;
+}
+td {
+ border: thin solid black;
+ padding: 2px;
+}
+th {
+ background-color: silver;
+ border: thin solid black;
+ padding: 2px;
+}
+td.PASSED {
+ background-color: green;
+}
+td.FAILED {
+ background-color: red;
+}
+td.CRASHED {
+ background-color: purple;
+}
+td.SKIPPED {
+ background-color: green;
+}
+</style>
+</head>
+<body>
+<h1>Test report for CHIRP version %s</h1>
+<h3>Generated on %s (%s)</h3>
+<table class="testlist">
+<tr>
+ <th>Vendor</th><th>Model</th><th>Test Case</th>
+ <th>Status</th><th>Message</th>
+</tr>
+""" % (CHIRP_VERSION, CHIRP_VERSION, time.strftime("%x at %X"), os.name)
+ print(s, file=self._out)
+
+ def cleanup(self):
+ print("</table></body>", file=self._out)
+ self._out.close()
+ print("Done")
+
+ def report(self, rclass, tc, msg, e):
+ s = ("<tr class='%s'>" % msg) + \
+ ("<td class='vendor'>%s</td>" % rclass.VENDOR) + \
+ ("<td class='model'>%s %s</td>" %
+ (rclass.MODEL, rclass.VARIANT)) + \
+ ("<td class='tc'>%s</td>" % tc) + \
+ ("<td class='%s'>%s</td>" % (msg, msg)) + \
+ ("<td class='error'>%s</td>" % e) + \
+ "</tr>"
+ print(s, file=self._out)
+ sys.stdout.write(".")
+ sys.stdout.flush()
+
+
+class TestRunner:
+ def __init__(self, images_dir, test_list, test_out):
+ self._images_dir = images_dir
+ self._test_list = test_list
+ self._test_out = test_out
+ if not os.path.exists("tmp"):
+ os.mkdir("tmp")
+
+ def _make_list(self):
+ run_list = []
+ images = glob.glob(os.path.join(self._images_dir, "*.img"))
+ for image in sorted(images):
+ drv_name, _ = os.path.splitext(os.path.basename(image))
+ run_list.append((directory.get_radio(drv_name), image))
+ return run_list
+
+ def report(self, rclass, tc, msg, e):
+ self._test_out.report(rclass, tc, msg, e)
+
+ def log(self, rclass, tc, e):
+ fn = "logs/%s_%s.log" % (directory.radio_class_id(rclass), tc)
+ log = file(fn, "a")
+ print("---- Begin test %s ----" % tc, file=log)
+ log.write(e.get_detail())
+ print(file=log)
+ print("---- End test %s ----" % tc, file=log)
+ log.close()
+
+ def nuke_log(self, rclass, tc):
+ fn = "logs/%s_%s.log" % (directory.radio_class_id(rclass), tc)
+ if os.path.exists(fn):
+ os.remove(fn)
+
+ def _run_one(self, rclass, parm, dst=None):
+ nfailed = 0
+ for tcclass in self._test_list:
+ nprinted = 0
+ tw = TestWrapper(rclass, parm, dst=dst)
+ tc = tcclass(tw)
+
+ self.nuke_log(rclass, tc)
+
+ tc.prepare()
+
+ try:
+ failures = tc.run()
+ for e in failures:
+ self.report(rclass, tc, "FAILED", e)
+ if e.get_detail():
+ self.log(rclass, tc, e)
+ nfailed += 1
+ nprinted += 1
+ except TestFailedError as e:
+ self.report(rclass, tc, "FAILED", e)
+ if e.get_detail():
+ self.log(rclass, tc, e)
+ nfailed += 1
+ nprinted += 1
+ except TestCrashError as e:
+ self.report(rclass, tc, "CRASHED", e)
+ self.log(rclass, tc, e)
+ nfailed += 1
+ nprinted += 1
+ except TestSkippedError as e:
+ self.report(rclass, tc, "SKIPPED", e)
+ self.log(rclass, tc, e)
+ nprinted += 1
+
+ tc.cleanup()
+
+ if not nprinted:
+ self.report(rclass, tc, "PASSED", "All tests")
+
+ return nfailed
+
+ def run_rclass_image(self, rclass, image, dst=None):
+ rid = "%s_%s_" % (rclass.VENDOR, rclass.MODEL)
+ rid = rid.replace("/", "_")
+ # Do this for things like Generic_CSV, that demand it
+ _base, ext = os.path.splitext(image)
+ testimage = tempfile.mktemp(ext, rid)
+ shutil.copy(image, testimage)
+
+ try:
+ tw = TestWrapper(rclass, testimage, dst=dst)
+ rf = tw.do("get_features")
+ if rf.has_sub_devices:
+ devices = tw.do("get_sub_devices")
+ failed = 0
+ for dev in devices:
+ failed += self.run_rclass_image(dev.__class__, image, dst=dev)
+ return failed
+ else:
+ return self._run_one(rclass, image, dst=dst)
+ finally:
+ os.remove(testimage)
+
+ def run_list(self, run_list):
+ def _key(pair):
+ return pair[0].VENDOR + pair[0].MODEL + pair[0].VARIANT
+ failed = 0
+ for rclass, image in sorted(run_list, key=_key):
+ failed += self.run_rclass_image(rclass, image)
+ return failed
+
+ def run_all(self):
+ run_list = self._make_list()
+ return self.run_list(run_list)
+
+ def run_one(self, drv_name):
+ return self.run_rclass_image(directory.get_radio(drv_name),
+ os.path.join("images",
+ "%s.img" % drv_name))
+
+ def run_one_live(self, drv_name, port):
+ rclass = directory.get_radio(drv_name)
+ pipe = Serial(port=port, baudrate=rclass.BAUD_RATE, timeout=0.5)
+ tw = TestWrapper(rclass, pipe)
+ rf = tw.do("get_features")
+ if rf.has_sub_devices:
+ devices = tw.do("get_sub_devices")
+ failed = 0
+ for device in devices:
+ failed += self._run_one(device.__class__, pipe)
+ return failed
+ else:
+ return self._run_one(rclass, pipe)
+
+if __name__ == "__main__":
+ import sys
+
+ images = glob.glob("images/*.img")
+ tests = [os.path.splitext(os.path.basename(img))[0] for img in images]
+
+ op = OptionParser()
+ op.add_option("-d", "--driver", dest="driver", default=None,
+ help="Driver to test (omit for all)")
+ op.add_option("-t", "--test", dest="test", default=None,
+ help="Test to run (omit for all)")
+ op.add_option("-e", "--exclude", dest="exclude", default=None,
+ help="Test to exclude")
+ op.add_option("", "--html", dest="html", default=None,
+ help="Output to HTML file")
+ op.add_option("-l", "--live", dest="live", default=None,
+ help="Live radio on this port (requires -d)")
+ op.usage = """
+Available drivers:
+%s
+Available tests:
+%s
+""" % ("\n".join([" %s" % x for x in sorted(tests)]),
+ "\n".join([" %s" % x for x in sorted(TESTS.keys())]))
+
+ (options, args) = op.parse_args()
+
+ if options.html:
+ test_out = TestOutputHTML(options.html)
+ else:
+ stdout = sys.stdout
+ if not os.path.exists("logs"):
+ os.mkdir("logs")
+ sys.stdout = file("logs/verbose", "w")
+ test_out = TestOutputANSI(stdout)
+
+ test_out.prepare()
+
+ if options.exclude:
+ del TESTS[options.exclude]
+
+ if options.test:
+ tr = TestRunner("images", [TESTS[options.test]], test_out)
+ else:
+ tr = TestRunner("images", list(TESTS.values()), test_out)
+
+ if options.live:
+ if not options.driver:
+ print("Live mode requires a driver to be specified")
+ sys.exit(1)
+ failed = tr.run_one_live(options.driver, options.live)
+ elif options.driver:
+ failed = tr.run_one(options.driver)
+ else:
+ failed = tr.run_all()
+
+ test_out.cleanup()
+
+ sys.exit(failed)
diff --git a/tests/test_drivers.py b/tests/test_drivers.py
new file mode 100644
index 0000000..ba8aaf9
--- /dev/null
+++ b/tests/test_drivers.py
@@ -0,0 +1,24 @@
+import sys
+import unittest
+
+from chirp import directory
+from tests import load_tests
+
+
+class TestSuiteAdapter(object):
+ """Adapter for pytest since it doesn't support the loadTests() protocol"""
+
+ def __init__(self, locals):
+ self.locals = locals
+
+ def loadTestsFromTestCase(self, test_cls):
+ self.locals[test_cls.__name__] = test_cls
+
+ @staticmethod
+ def addTests(tests):
+ pass
+
+
+directory.safe_import_drivers()
+adapter = TestSuiteAdapter(locals())
+load_tests(adapter, None, None, suite=adapter)
diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/unit/__init__.py
diff --git a/tests/unit/base.py b/tests/unit/base.py
new file mode 100644
index 0000000..1e112ce
--- /dev/null
+++ b/tests/unit/base.py
@@ -0,0 +1,50 @@
+import sys
+import unittest
+
+import mock
+
+try:
+ import mox
+except ImportError:
+ from mox3 import mox
+
+import warnings
+warnings.simplefilter('ignore', Warning)
+
+
+class BaseTest(unittest.TestCase):
+ def setUp(self):
+ __builtins__['_'] = lambda s: s
+ self.mox = mox.Mox()
+
+ def tearDown(self):
+ self.mox.UnsetStubs()
+ self.mox.VerifyAll()
+
+
+pygtk_mocks = ('gtk', 'pango', 'gobject')
+pygtk_base_classes = ('gobject.GObject', 'gtk.HBox', 'gtk.Dialog')
+
+
+class DummyBase(object):
+ def __init__(self, *a, **k):
+ # gtk.Dialog
+ self.vbox = mock.MagicMock()
+
+ # gtk.Dialog
+ def set_position(self, pos):
+ pass
+
+
+def mock_gtk():
+ for module in pygtk_mocks:
+ sys.modules[module] = mock.MagicMock()
+
+ for path in pygtk_base_classes:
+ module, base_class = path.split('.')
+ setattr(sys.modules[module], base_class, DummyBase)
+
+
+def unmock_gtk():
+ for module in pygtk_mocks:
+ del sys.modules[module]
diff --git a/tests/unit/test_bitwise.py b/tests/unit/test_bitwise.py
new file mode 100644
index 0000000..2b674e8
--- /dev/null
+++ b/tests/unit/test_bitwise.py
@@ -0,0 +1,341 @@
+# Copyright 2013 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from builtins import bytes
+
+import struct
+import unittest
+
+import six
+
+from chirp import bitwise
+from chirp import memmap
+
+
+class BaseTest(unittest.TestCase):
+ def _compare_structure(self, obj, primitive):
+ for key, value in primitive.items():
+ if isinstance(value, dict):
+ self._compare_structure(getattr(obj, key), value)
+ else:
+ self.assertEqual(type(value)(getattr(obj, key)), value)
+
+
+class TestMemoryMapCoherence(BaseTest):
+ def test_byte_char_coherence(self):
+ charmmap = memmap.MemoryMap('00')
+ # This will to a get_byte_compatible() from chars
+ obj = bitwise.parse('char foo[2];', charmmap)
+ self.assertEqual('00', str(obj.foo))
+ obj.foo = '11'
+ # The above assignment happens on the byte-compatible mmap,
+ # make sure it is still visible in the charmmap we know about.
+ # This confirms that get_byte_compatible() links the backing
+ # store of the original mmap to the new one.
+ self.assertEqual('11', charmmap.get_packed())
+
+
+class TestBitwiseBaseIntTypes(BaseTest):
+ def _test_type(self, datatype, _data, value):
+ data = memmap.MemoryMapBytes(bytes(_data))
+ obj = bitwise.parse("%s foo;" % datatype, data)
+ self.assertEqual(int(obj.foo), value)
+ self.assertEqual(obj.foo.size(), len(data) * 8)
+
+ obj.foo = 0
+ self.assertEqual(int(obj.foo), 0)
+ self.assertEqual(data.get_packed(), (b"\x00" * (obj.size() // 8)))
+
+ obj.foo = value
+ self.assertEqual(int(obj.foo), value)
+ self.assertEqual(data.get_packed(), _data)
+
+ obj.foo = 7
+ # Compare against the equivalent real division so we get consistent
+ # results on py2 and py3
+ self.assertEqual(7 // 2, obj.foo // 2)
+ self.assertEqual(7 / 2, obj.foo / 2)
+ self.assertEqual(7 / 2.0, obj.foo / 2.0)
+
+ def test_type_u8(self):
+ self._test_type("u8", b"\x80", 128)
+
+ def test_type_u16(self):
+ self._test_type("u16", b"\x01\x00", 256)
+
+ def test_type_u24(self):
+ self._test_type("u24", b"\x80\x00\x00", 2**23)
+
+ def test_type_u32(self):
+ self._test_type("u32", b"\x80\x00\x00\x00", 2**31)
+
+ def test_type_ul16(self):
+ self._test_type("ul16", b"\x00\x01", 256)
+
+ def test_type_ul24(self):
+ self._test_type("ul24", b"\x00\x00\x80", 2**23)
+
+ def test_type_ul32(self):
+ self._test_type("ul32", b"\x00\x00\x00\x80", 2**31)
+
+ def test_int_array(self):
+ data = memmap.MemoryMapBytes(bytes(b'\x00\x01\x02\x03'))
+ obj = bitwise.parse('u8 foo[4];', data)
+ for i in range(4):
+ self.assertEqual(i, obj.foo[i])
+ obj.foo[i] = i * 2
+ self.assertEqual(b'\x00\x02\x04\x06', data.get_packed())
+
+ def test_int_array(self):
+ data = memmap.MemoryMapBytes(bytes(b'\x00\x01\x02\x03'))
+ obj = bitwise.parse('u8 foo[4];', data)
+ for i in range(4):
+ self.assertEqual(i, obj.foo[i])
+ obj.foo[i] = i * 2
+ self.assertEqual(b'\x00\x02\x04\x06', data.get_packed())
+
+
+class TestBitfieldTypes(BaseTest):
+ def test_bitfield_u8(self):
+ defn = "u8 foo:4, bar:4;"
+ data = memmap.MemoryMapBytes(bytes(b"\x12"))
+ obj = bitwise.parse(defn, data)
+ self.assertEqual(obj.foo, 1)
+ self.assertEqual(obj.bar, 2)
+ self.assertEqual(obj.foo.size(), 4)
+ self.assertEqual(obj.bar.size(), 4)
+ obj.foo = 0x8
+ obj.bar = 0x1
+ self.assertEqual(data.get_packed(), b"\x81")
+
+ def _test_bitfield_16(self, variant, data):
+ defn = "u%s16 foo:4, bar:8, baz:4;" % variant
+ data = memmap.MemoryMapBytes(bytes(data))
+ obj = bitwise.parse(defn, data)
+ self.assertEqual(int(obj.foo), 1)
+ self.assertEqual(int(obj.bar), 0x23)
+ self.assertEqual(int(obj.baz), 4)
+ self.assertEqual(obj.foo.size(), 4)
+ self.assertEqual(obj.bar.size(), 8)
+ self.assertEqual(obj.baz.size(), 4)
+ obj.foo = 0x2
+ obj.bar = 0x11
+ obj.baz = 0x3
+ if variant == "l":
+ self.assertEqual(data.get_packed(), b"\x13\x21")
+ else:
+ self.assertEqual(data.get_packed(), b"\x21\x13")
+
+ def test_bitfield_u16(self):
+ self._test_bitfield_16("", b"\x12\x34")
+
+ def test_bitfield_ul16(self):
+ self._test_bitfield_16('l', b"\x34\x12")
+
+ def _test_bitfield_24(self, variant, data):
+ defn = "u%s24 foo:12, bar:6, baz:6;" % variant
+ data = memmap.MemoryMapBytes(bytes(data))
+ obj = bitwise.parse(defn, data)
+ self.assertEqual(int(obj.foo), 4)
+ self.assertEqual(int(obj.bar), 3)
+ self.assertEqual(int(obj.baz), 2)
+ self.assertEqual(obj.foo.size(), 12)
+ self.assertEqual(obj.bar.size(), 6)
+ self.assertEqual(obj.baz.size(), 6)
+ obj.foo = 1
+ obj.bar = 2
+ obj.baz = 3
+ if variant == 'l':
+ self.assertEqual(data.get_packed(), b"\x83\x10\x00")
+ else:
+ self.assertEqual(data.get_packed(), b"\x00\x10\x83")
+
+ def test_bitfield_u24(self):
+ self._test_bitfield_24("", b"\x00\x40\xC2")
+
+ def test_bitfield_ul24(self):
+ self._test_bitfield_24("l", b"\xC2\x40\x00")
+
+
+class TestBitType(BaseTest):
+ def test_bit_array(self):
+ defn = "bit foo[24];"
+ data = memmap.MemoryMapBytes(bytes(b"\x00\x80\x01"))
+ obj = bitwise.parse(defn, data)
+ for i, v in [(0, False), (8, True), (23, True)]:
+ self.assertEqual(bool(obj.foo[i]), v)
+ for i in range(0, 24):
+ obj.foo[i] = i % 2
+ self.assertEqual(data.get_packed(), b"\x55\x55\x55")
+
+ def test_bit_array_fail(self):
+ self.assertRaises(ValueError, bitwise.parse, "bit foo[23];", b"000")
+
+
+class TestBitwiseBCDTypes(BaseTest):
+ def _test_def(self, definition, name, _data, value):
+ data = memmap.MemoryMapBytes(bytes(_data))
+ obj = bitwise.parse(definition, data)
+ self.assertEqual(int(getattr(obj, name)), value)
+ self.assertEqual(getattr(obj, name).size(), len(_data) * 8)
+ setattr(obj, name, 0)
+ self.assertEqual(data.get_packed(), (b"\x00" * len(_data)))
+ setattr(obj, name, 42)
+ if definition.startswith("b"):
+ expected = (len(_data) == 2 and b"\x00" or b"") + b"\x42"
+ else:
+ expected = b"\x42" + (len(_data) == 2 and b"\x00" or b"")
+ raw = data.get_packed()
+ self.assertEqual(raw, expected)
+
+ def test_bbcd(self):
+ self._test_def("bbcd foo;", "foo", b"\x12", 12)
+
+ def test_lbcd(self):
+ self._test_def("lbcd foo;", "foo", b"\x12", 12)
+
+ def test_bbcd_array(self):
+ self._test_def("bbcd foo[2];", "foo", b"\x12\x34", 1234)
+
+ def test_lbcd_array(self):
+ self._test_def("lbcd foo[2];", "foo", b"\x12\x34", 3412)
+
+
+class TestBitwiseCharTypes(BaseTest):
+ def test_char(self):
+ data = memmap.MemoryMapBytes(bytes(b"c"))
+ obj = bitwise.parse("char foo;", data)
+ self.assertEqual(str(obj.foo), "c")
+ self.assertEqual(obj.foo.size(), 8)
+ obj.foo = "d"
+ self.assertEqual(data.get_packed(), b"d")
+
+ def test_string(self):
+ data = memmap.MemoryMapBytes(bytes(b"foobar"))
+ obj = bitwise.parse("char foo[6];", data)
+ self.assertEqual(str(obj.foo), "foobar")
+ self.assertEqual(obj.foo.size(), 8 * 6)
+ obj.foo = "bazfoo"
+ self.assertEqual(data.get_packed(), b"bazfoo")
+
+ def test_string_invalid_chars(self):
+ data = memmap.MemoryMapBytes(bytes(b"\xFFoobar1"))
+ obj = bitwise.parse("struct {char foo[7];} bar;", data)
+
+ if six.PY3:
+ expected = '\xffoobar1'
+ else:
+ expected = '\\xffoobar1'
+
+ self.assertIn(expected, repr(obj.bar))
+
+ def test_string_wrong_length(self):
+ data = memmap.MemoryMapBytes(bytes(b"foobar"))
+ obj = bitwise.parse("char foo[6];", data)
+ self.assertRaises(ValueError, setattr, obj, "foo", "bazfo")
+ self.assertRaises(ValueError, setattr, obj, "foo", "bazfooo")
+
+ def test_string_with_various_input_types(self):
+ data = memmap.MemoryMapBytes(bytes(b"foobar"))
+ obj = bitwise.parse("char foo[6];", data)
+ self.assertEqual('foobar', str(obj.foo))
+ self.assertEqual(6, len(b'barfoo'))
+ obj.foo = b'barfoo'
+ self.assertEqual('barfoo', str(obj.foo))
+ obj.foo = [ord(c) for c in 'fffbbb']
+ self.assertEqual('fffbbb', str(obj.foo))
+
+ def test_string_get_raw(self):
+ data = memmap.MemoryMapBytes(bytes(b"foobar"))
+ obj = bitwise.parse("char foo[6];", data)
+ self.assertEqual('foobar', obj.foo.get_raw())
+ self.assertEqual(b'foobar', obj.foo.get_raw(asbytes=True))
+
+
+class TestBitwiseStructTypes(BaseTest):
+ def _test_def(self, definition, data, primitive):
+ obj = bitwise.parse(definition, data)
+ self._compare_structure(obj, primitive)
+ self.assertEqual(obj.size(), len(data) * 8)
+
+ def test_struct_one_element(self):
+ defn = "struct { u8 bar; } foo;"
+ value = {"foo": {"bar": 128}}
+ self._test_def(defn, b"\x80", value)
+
+ def test_struct_two_elements(self):
+ defn = "struct { u8 bar; u16 baz; } foo;"
+ value = {"foo": {"bar": 128, "baz": 256}}
+ self._test_def(defn, b"\x80\x01\x00", value)
+
+ def test_struct_writes(self):
+ data = memmap.MemoryMapBytes(bytes(b".."))
+ defn = "struct { u8 bar; u8 baz; } foo;"
+ obj = bitwise.parse(defn, data)
+ obj.foo.bar = 0x12
+ obj.foo.baz = 0x34
+ self.assertEqual(data.get_packed(), b"\x12\x34")
+
+ def test_struct_get_raw(self):
+ data = memmap.MemoryMapBytes(bytes(b".."))
+ defn = "struct { u8 bar; u8 baz; } foo;"
+ obj = bitwise.parse(defn, data)
+ self.assertEqual('..', obj.get_raw())
+ self.assertEqual(b'..', obj.get_raw(asbytes=True))
+
+ def test_struct_get_raw_small(self):
+ data = memmap.MemoryMapBytes(bytes(b"."))
+ defn = "struct { u8 bar; } foo;"
+ obj = bitwise.parse(defn, data)
+ self.assertEqual('.', obj.get_raw())
+ self.assertEqual(b'.', obj.get_raw(asbytes=True))
+
+
+class TestBitwiseSeek(BaseTest):
+ def test_seekto(self):
+ defn = "#seekto 4; char foo;"
+ obj = bitwise.parse(defn, b"abcdZ")
+ self.assertEqual(str(obj.foo), "Z")
+
+ def test_seek(self):
+ defn = "char foo; #seek 3; char bar;"
+ obj = bitwise.parse(defn, b"AbcdZ")
+ self.assertEqual(str(obj.foo), "A")
+ self.assertEqual(str(obj.bar), "Z")
+
+
+class TestBitwiseErrors(BaseTest):
+ def test_missing_semicolon(self):
+ self.assertRaises(SyntaxError, bitwise.parse, "u8 foo", "")
+
+
+class TestBitwiseComments(BaseTest):
+ def test_comment_inline_cppstyle(self):
+ obj = bitwise.parse('u8 foo; // test', b'\x10')
+ self.assertEqual(16, obj.foo)
+
+ def test_comment_cppstyle(self):
+ obj = bitwise.parse('// Test this\nu8 foo;', b'\x10')
+ self.assertEqual(16, obj.foo)
+
+
+class TestBitwiseStringEncoders(BaseTest):
+ def test_encode_bytes(self):
+ self.assertEqual(b'foobar\x00',
+ bitwise.string_straight_encode('foobar\x00'))
+
+ def test_decode_bytes(self):
+ self.assertEqual('foobar\x00',
+ bitwise.string_straight_decode(b'foobar\x00'))
diff --git a/tests/unit/test_chirp_common.py b/tests/unit/test_chirp_common.py
new file mode 100644
index 0000000..400c469
--- /dev/null
+++ b/tests/unit/test_chirp_common.py
@@ -0,0 +1,415 @@
+import base64
+import json
+import os
+import tempfile
+
+import mock
+
+from tests.unit import base
+from chirp import CHIRP_VERSION
+from chirp import chirp_common
+from chirp import errors
+
+
+class TestUtilityFunctions(base.BaseTest):
+ def test_parse_freq_whole(self):
+ self.assertEqual(chirp_common.parse_freq("146.520000"), 146520000)
+ self.assertEqual(chirp_common.parse_freq("146.5200"), 146520000)
+ self.assertEqual(chirp_common.parse_freq("146.52"), 146520000)
+ self.assertEqual(chirp_common.parse_freq("146"), 146000000)
+ self.assertEqual(chirp_common.parse_freq("1250"), 1250000000)
+ self.assertEqual(chirp_common.parse_freq("123456789"),
+ 123456789000000)
+
+ def test_parse_freq_decimal(self):
+ self.assertEqual(chirp_common.parse_freq("1.0"), 1000000)
+ self.assertEqual(chirp_common.parse_freq("1.000000"), 1000000)
+ self.assertEqual(chirp_common.parse_freq("1.1"), 1100000)
+ self.assertEqual(chirp_common.parse_freq("1.100"), 1100000)
+ self.assertEqual(chirp_common.parse_freq("0.6"), 600000)
+ self.assertEqual(chirp_common.parse_freq("0.600"), 600000)
+ self.assertEqual(chirp_common.parse_freq("0.060"), 60000)
+ self.assertEqual(chirp_common.parse_freq(".6"), 600000)
+
+ def test_parse_freq_whitespace(self):
+ self.assertEqual(chirp_common.parse_freq("1 "), 1000000)
+ self.assertEqual(chirp_common.parse_freq(" 1"), 1000000)
+ self.assertEqual(chirp_common.parse_freq(" 1 "), 1000000)
+
+ self.assertEqual(chirp_common.parse_freq("1.0 "), 1000000)
+ self.assertEqual(chirp_common.parse_freq(" 1.0"), 1000000)
+ self.assertEqual(chirp_common.parse_freq(" 1.0 "), 1000000)
+ self.assertEqual(chirp_common.parse_freq(""), 0)
+ self.assertEqual(chirp_common.parse_freq(" "), 0)
+
+ def test_parse_freq_bad(self):
+ self.assertRaises(ValueError, chirp_common.parse_freq, "a")
+ self.assertRaises(ValueError, chirp_common.parse_freq, "1.a")
+ self.assertRaises(ValueError, chirp_common.parse_freq, "a.b")
+ self.assertRaises(ValueError, chirp_common.parse_freq,
+ "1.0000001")
+
+ def test_format_freq(self):
+ self.assertEqual(chirp_common.format_freq(146520000), "146.520000")
+ self.assertEqual(chirp_common.format_freq(54000000), "54.000000")
+ self.assertEqual(chirp_common.format_freq(1800000), "1.800000")
+ self.assertEqual(chirp_common.format_freq(1), "0.000001")
+ self.assertEqual(chirp_common.format_freq(1250000000), "1250.000000")
+
+ @mock.patch('chirp.CHIRP_VERSION', new='daily-20151021')
+ def test_compare_version_to_current(self):
+ self.assertTrue(chirp_common.is_version_newer('daily-20180101'))
+ self.assertFalse(chirp_common.is_version_newer('daily-20140101'))
+ self.assertFalse(chirp_common.is_version_newer('0.3.0'))
+ self.assertFalse(chirp_common.is_version_newer('0.3.0dev'))
+
+ @mock.patch('chirp.CHIRP_VERSION', new='0.3.0dev')
+ def test_compare_version_to_current_dev(self):
+ self.assertTrue(chirp_common.is_version_newer('daily-20180101'))
+
+ def test_from_Hz(self):
+ # FIXME: These are wrong! Adding them here purely to test the
+ # python3 conversion, but they should be fixed.
+ self.assertEqual(140, chirp_common.from_GHz(14000000001))
+ self.assertEqual(140, chirp_common.from_MHz(14000001))
+ self.assertEqual(140, chirp_common.from_kHz(14001))
+
+
+class TestSplitTone(base.BaseTest):
+ def _test_split_tone_decode(self, tx, rx, **vals):
+ mem = chirp_common.Memory()
+ chirp_common.split_tone_decode(mem, tx, rx)
+ for key, value in list(vals.items()):
+ self.assertEqual(getattr(mem, key), value)
+
+ def test_split_tone_decode_none(self):
+ self._test_split_tone_decode((None, None, None),
+ (None, None, None),
+ tmode='')
+
+ def test_split_tone_decode_tone(self):
+ self._test_split_tone_decode(('Tone', 100.0, None),
+ ('', 0, None),
+ tmode='Tone',
+ rtone=100.0)
+
+ def test_split_tone_decode_tsql(self):
+ self._test_split_tone_decode(('Tone', 100.0, None),
+ ('Tone', 100.0, None),
+ tmode='TSQL',
+ ctone=100.0)
+
+ def test_split_tone_decode_dtcs(self):
+ self._test_split_tone_decode(('DTCS', 23, None),
+ ('DTCS', 23, None),
+ tmode='DTCS',
+ dtcs=23)
+
+ def test_split_tone_decode_cross_tone_tone(self):
+ self._test_split_tone_decode(('Tone', 100.0, None),
+ ('Tone', 123.0, None),
+ tmode='Cross',
+ cross_mode='Tone->Tone',
+ rtone=100.0,
+ ctone=123.0)
+
+ def test_split_tone_decode_cross_tone_dtcs(self):
+ self._test_split_tone_decode(('Tone', 100.0, None),
+ ('DTCS', 32, 'R'),
+ tmode='Cross',
+ cross_mode='Tone->DTCS',
+ rtone=100.0,
+ rx_dtcs=32,
+ dtcs_polarity='NR')
+
+ def test_split_tone_decode_cross_dtcs_tone(self):
+ self._test_split_tone_decode(('DTCS', 32, 'R'),
+ ('Tone', 100.0, None),
+ tmode='Cross',
+ cross_mode='DTCS->Tone',
+ ctone=100.0,
+ dtcs=32,
+ dtcs_polarity='RN')
+
+ def test_split_tone_decode_cross_dtcs_dtcs(self):
+ self._test_split_tone_decode(('DTCS', 32, 'R'),
+ ('DTCS', 25, 'R'),
+ tmode='Cross',
+ cross_mode='DTCS->DTCS',
+ dtcs=32,
+ rx_dtcs=25,
+ dtcs_polarity='RR')
+
+ def test_split_tone_decode_cross_none_dtcs(self):
+ self._test_split_tone_decode((None, None, None),
+ ('DTCS', 25, 'R'),
+ tmode='Cross',
+ cross_mode='->DTCS',
+ rx_dtcs=25,
+ dtcs_polarity='NR')
+
+ def test_split_tone_decode_cross_none_tone(self):
+ self._test_split_tone_decode((None, None, None),
+ ('Tone', 100.0, None),
+ tmode='Cross',
+ cross_mode='->Tone',
+ ctone=100.0)
+
+ def _set_mem(self, **vals):
+ mem = chirp_common.Memory()
+ for key, value in list(vals.items()):
+ setattr(mem, key, value)
+ return chirp_common.split_tone_encode(mem)
+
+ def split_tone_encode_test_none(self):
+ self.assertEqual(self._set_mem(tmode=''),
+ (('', None, None),
+ ('', None, None)))
+
+ def split_tone_encode_test_tone(self):
+ self.assertEqual(self._set_mem(tmode='Tone', rtone=100.0),
+ (('Tone', 100.0, None),
+ ('', None, None)))
+
+ def split_tone_encode_test_tsql(self):
+ self.assertEqual(self._set_mem(tmode='TSQL', ctone=100.0),
+ (('Tone', 100.0, None),
+ ('Tone', 100.0, None)))
+
+ def split_tone_encode_test_dtcs(self):
+ self.assertEqual(self._set_mem(tmode='DTCS', dtcs=23,
+ dtcs_polarity='RN'),
+ (('DTCS', 23, 'R'),
+ ('DTCS', 23, 'N')))
+
+ def split_tone_encode_test_cross_tone_tone(self):
+ self.assertEqual(self._set_mem(tmode='Cross', cross_mode='Tone->Tone',
+ rtone=100.0, ctone=123.0),
+ (('Tone', 100.0, None),
+ ('Tone', 123.0, None)))
+
+ def split_tone_encode_test_cross_tone_dtcs(self):
+ self.assertEqual(self._set_mem(tmode='Cross', cross_mode='Tone->DTCS',
+ rtone=100.0, rx_dtcs=25),
+ (('Tone', 100.0, None),
+ ('DTCS', 25, 'N')))
+
+ def split_tone_encode_test_cross_dtcs_tone(self):
+ self.assertEqual(self._set_mem(tmode='Cross', cross_mode='DTCS->Tone',
+ ctone=100.0, dtcs=25),
+ (('DTCS', 25, 'N'),
+ ('Tone', 100.0, None)))
+
+ def split_tone_encode_test_cross_none_dtcs(self):
+ self.assertEqual(self._set_mem(tmode='Cross', cross_mode='->DTCS',
+ rx_dtcs=25),
+ (('', None, None),
+ ('DTCS', 25, 'N')))
+
+ def split_tone_encode_test_cross_none_tone(self):
+ self.assertEqual(self._set_mem(tmode='Cross', cross_mode='->Tone',
+ ctone=100.0),
+ (('', None, None),
+ ('Tone', 100.0, None)))
+
+
+class TestStepFunctions(base.BaseTest):
+ _625 = [145856250,
+ 445856250,
+ 862731250,
+ 146118750,
+ ]
+ _125 = [145862500,
+ 445862500,
+ 862737500,
+ ]
+ _005 = [145005000,
+ 445005000,
+ 850005000,
+ ]
+ _025 = [145002500,
+ 445002500,
+ 850002500,
+ ]
+
+ def test_is_fractional_step(self):
+ for freq in self._125 + self._625:
+ print(freq)
+ self.assertTrue(chirp_common.is_fractional_step(freq))
+
+ def test_is_6_25(self):
+ for freq in self._625:
+ self.assertTrue(chirp_common.is_6_25(freq))
+
+ def test_is_12_5(self):
+ for freq in self._125:
+ self.assertTrue(chirp_common.is_12_5(freq))
+
+ def test_is_5_0(self):
+ for freq in self._005:
+ self.assertTrue(chirp_common.is_5_0(freq))
+
+ def test_is_2_5(self):
+ for freq in self._025:
+ self.assertTrue(chirp_common.is_2_5(freq))
+
+ def test_required_step(self):
+ steps = {2.5: self._025,
+ 5.0: self._005,
+ 6.25: self._625,
+ 12.5: self._125,
+ }
+ for step, freqs in list(steps.items()):
+ for freq in freqs:
+ self.assertEqual(step, chirp_common.required_step(freq))
+
+ def test_required_step_fail(self):
+ self.assertRaises(errors.InvalidDataError,
+ chirp_common.required_step,
+ 146520500)
+
+ def test_fix_rounded_step_250(self):
+ self.assertEqual(146106250,
+ chirp_common.fix_rounded_step(146106000))
+
+ def test_fix_rounded_step_500(self):
+ self.assertEqual(146112500,
+ chirp_common.fix_rounded_step(146112000))
+
+ def test_fix_rounded_step_750(self):
+ self.assertEqual(146118750,
+ chirp_common.fix_rounded_step(146118000))
+
+
+class TestImageMetadata(base.BaseTest):
+ def test_make_metadata(self):
+ class TestRadio(chirp_common.FileBackedRadio):
+ VENDOR = 'Dan'
+ MODEL = 'Foomaster 9000'
+ VARIANT = 'R'
+
+ raw_metadata = TestRadio._make_metadata()
+ metadata = json.loads(base64.b64decode(raw_metadata).decode())
+ expected = {
+ 'vendor': 'Dan',
+ 'model': 'Foomaster 9000',
+ 'variant': 'R',
+ 'rclass': 'TestRadio',
+ 'chirp_version': CHIRP_VERSION,
+ }
+ self.assertEqual(expected, metadata)
+
+ def test_strip_metadata(self):
+ class TestRadio(chirp_common.FileBackedRadio):
+ VENDOR = 'Dan'
+ MODEL = 'Foomaster 9000'
+ VARIANT = 'R'
+
+ raw_metadata = TestRadio._make_metadata()
+ raw_data = (b'foooooooooooooooooooooo' + TestRadio.MAGIC +
+ TestRadio._make_metadata())
+ data, metadata = chirp_common.FileBackedRadio._strip_metadata(raw_data)
+ self.assertEqual(b'foooooooooooooooooooooo', data)
+ expected = {
+ 'vendor': 'Dan',
+ 'model': 'Foomaster 9000',
+ 'variant': 'R',
+ 'rclass': 'TestRadio',
+ 'chirp_version': CHIRP_VERSION,
+ }
+ self.assertEqual(expected, metadata)
+
+ def test_load_mmap_no_metadata(self):
+ f = tempfile.NamedTemporaryFile()
+ f.write(b'thisisrawdata')
+ f.flush()
+
+ with mock.patch('chirp.memmap.MemoryMap') as mock_mmap:
+ chirp_common.FileBackedRadio(None).load_mmap(f.name)
+ mock_mmap.assert_called_once_with(b'thisisrawdata')
+
+ def test_load_mmap_bad_metadata(self):
+ f = tempfile.NamedTemporaryFile()
+ f.write(b'thisisrawdata')
+ f.write(chirp_common.FileBackedRadio.MAGIC + b'bad')
+ f.flush()
+
+ with mock.patch('chirp.memmap.MemoryMap') as mock_mmap:
+ chirp_common.FileBackedRadio(None).load_mmap(f.name)
+ mock_mmap.assert_called_once_with(b'thisisrawdata')
+
+ def test_save_mmap_includes_metadata(self):
+ # Make sure that a file saved with a .img extension includes
+ # the metadata blob
+ class TestRadio(chirp_common.FileBackedRadio):
+ VENDOR = 'Dan'
+ MODEL = 'Foomaster 9000'
+ VARIANT = 'R'
+
+ with tempfile.NamedTemporaryFile(suffix='.Img') as f:
+ fn = f.name
+ r = TestRadio(None)
+ r._mmap = mock.Mock()
+ r._mmap.get_byte_compatible.return_value.get_packed.return_value = (
+ b'thisisrawdata')
+ r.save_mmap(fn)
+ with open(fn, 'rb') as f:
+ filedata = f.read()
+ os.remove(fn)
+ data, metadata = chirp_common.FileBackedRadio._strip_metadata(filedata)
+ self.assertEqual(b'thisisrawdata', data)
+ expected = {
+ 'vendor': 'Dan',
+ 'model': 'Foomaster 9000',
+ 'variant': 'R',
+ 'rclass': 'TestRadio',
+ 'chirp_version': CHIRP_VERSION,
+ }
+ self.assertEqual(expected, metadata)
+
+ def test_save_mmap_no_metadata_not_img_file(self):
+ # Make sure that if we save without a .img extension we do
+ # not include the metadata blob
+ class TestRadio(chirp_common.FileBackedRadio):
+ VENDOR = 'Dan'
+ MODEL = 'Foomaster 9000'
+ VARIANT = 'R'
+
+ with tempfile.NamedTemporaryFile(suffix='.txt') as f:
+ fn = f.name
+ r = TestRadio(None)
+ r._mmap = mock.Mock()
+ r._mmap.get_byte_compatible.return_value.get_packed.return_value = (
+ b'thisisrawdata')
+ r.save_mmap(fn)
+ with open(fn, 'rb') as f:
+ filedata = f.read()
+ os.remove(fn)
+ data, metadata = chirp_common.FileBackedRadio._strip_metadata(filedata)
+ self.assertEqual(b'thisisrawdata', data)
+ self.assertEqual({}, metadata)
+
+ def test_load_mmap_saves_metadata_on_radio(self):
+ class TestRadio(chirp_common.FileBackedRadio):
+ VENDOR = 'Dan'
+ MODEL = 'Foomaster 9000'
+ VARIANT = 'R'
+
+ with tempfile.NamedTemporaryFile(suffix='.img') as f:
+ fn = f.name
+ r = TestRadio(None)
+ r._mmap = mock.Mock()
+ r._mmap.get_byte_compatible.return_value.get_packed.return_value = (
+ b'thisisrawdata')
+ r.save_mmap(fn)
+
+ newr = TestRadio(None)
+ newr.load_mmap(fn)
+ expected = {
+ 'vendor': 'Dan',
+ 'model': 'Foomaster 9000',
+ 'variant': 'R',
+ 'rclass': 'TestRadio',
+ 'chirp_version': CHIRP_VERSION,
+ }
+ self.assertEqual(expected, newr.metadata)
diff --git a/tests/unit/test_directory.py b/tests/unit/test_directory.py
new file mode 100644
index 0000000..d48bb48
--- /dev/null
+++ b/tests/unit/test_directory.py
@@ -0,0 +1,69 @@
+import base64
+import json
+import tempfile
+
+from tests.unit import base
+from chirp import chirp_common
+from chirp import directory
+
+
+class TestDirectory(base.BaseTest):
+ def setUp(self):
+ super(TestDirectory, self).setUp()
+
+ directory.enable_reregistrations()
+
+ class FakeAlias(chirp_common.Alias):
+ VENDOR = 'Taylor'
+ MODEL = 'Barmaster 2000'
+ VARIANT = 'A'
+
+ @directory.register
+ class FakeRadio(chirp_common.FileBackedRadio):
+ VENDOR = 'Dan'
+ MODEL = 'Foomaster 9000'
+ VARIANT = 'R'
+ ALIASES = [FakeAlias]
+
+ @classmethod
+ def match_model(cls, file_data, image_file):
+ return file_data == b'thisisrawdata'
+
+ self.test_class = FakeRadio
+
+ def _test_detect_finds_our_class(self, tempfn):
+ radio = directory.get_radio_by_image(tempfn)
+ self.assertTrue(isinstance(radio, self.test_class))
+ return radio
+
+ def test_detect_with_no_metadata(self):
+ with tempfile.NamedTemporaryFile() as f:
+ f.write(b'thisisrawdata')
+ f.flush()
+ self._test_detect_finds_our_class(f.name)
+
+ def test_detect_with_metadata_base_class(self):
+ with tempfile.NamedTemporaryFile() as f:
+ f.write(b'thisisrawdata')
+ f.write(self.test_class.MAGIC + b'-')
+ f.write(self.test_class._make_metadata())
+ f.flush()
+ self._test_detect_finds_our_class(f.name)
+
+ def test_detect_with_metadata_alias_class(self):
+ with tempfile.NamedTemporaryFile() as f:
+ f.write(b'thisisrawdata')
+ f.write(self.test_class.MAGIC + b'-')
+ FakeAlias = self.test_class.ALIASES[0]
+ fake_metadata = base64.b64encode(json.dumps(
+ {'vendor': FakeAlias.VENDOR,
+ 'model': FakeAlias.MODEL,
+ 'variant': FakeAlias.VARIANT,
+ }).encode())
+ f.write(fake_metadata)
+ f.flush()
+ radio = self._test_detect_finds_our_class(f.name)
+ self.assertEqual('Taylor', radio.VENDOR)
+ self.assertEqual('Barmaster 2000', radio.MODEL)
+ self.assertEqual('A', radio.VARIANT)
+
diff --git a/tests/unit/test_icom_clone.py b/tests/unit/test_icom_clone.py
new file mode 100644
index 0000000..9ade954
--- /dev/null
+++ b/tests/unit/test_icom_clone.py
@@ -0,0 +1,117 @@
+# Copyright 2019 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from builtins import bytes
+
+import glob
+import os
+import logging
+import unittest
+
+from chirp import directory
+directory.safe_import_drivers()
+from chirp.drivers import icf
+from chirp import memmap
+from tests import icom_clone_simulator
+
+
+class BaseIcomCloneTest():
+ def setUp(self):
+ self.radio = directory.get_radio(self.RADIO_IDENT)(None)
+ self.simulator = icom_clone_simulator.FakeIcomRadio(self.radio)
+ self.radio.set_pipe(self.simulator)
+
+ def image_filename(self, filename):
+ tests_base = os.path.dirname(os.path.abspath(__file__))
+ return os.path.join(tests_base, 'images', filename)
+
+ def load_from_test_image(self, filename):
+ self.simulator.load_from_file(self.image_filename(filename))
+
+ def image_version(self, filename):
+ end = self.radio.get_memsize()
+
+ with open(self.image_filename(filename), 'rb') as f:
+ data = f.read()
+ if data[-8:-6] == b'%02x' % self.radio.get_model()[0]:
+ return 2
+ elif data[end-16:end] == b'IcomCloneFormat3':
+ return 3
+
+
+ def test_sync_in(self):
+ test_file = self.IMAGE_FILE
+ self.load_from_test_image(test_file)
+ self.radio.sync_in()
+
+ img_ver = self.image_version(test_file)
+ if img_ver == 2:
+ endstring = b''.join(b'%02x' % ord(c)
+ for c in self.radio._model[:2])
+ self.assertEqual(endstring + b'0001', self.radio._mmap[-8:])
+ elif img_ver == 3:
+ self.assertEqual(b'IcomCloneFormat3', self.radio._mmap[-16:])
+ elif img_ver is None:
+ self.assertEqual(self.radio.get_memsize(), len(self.radio._mmap))
+
+ def test_sync_out(self):
+ self.radio._mmap = memmap.MemoryMapBytes(
+ bytes(b'\x00') * self.radio.get_memsize())
+ self.radio._mmap[50] = bytes(b'abcdefgh')
+ self.radio.sync_out()
+ self.assertEqual(b'abcdefgh', self.simulator._memory[50:58])
+
+
+class TestRawRadioData(unittest.TestCase):
+ def test_get_payload(self):
+ radio = directory.get_radio('Icom_IC-2730A')(None)
+ payload = radio.get_payload(bytes(b'\x00\x10\xFE\x00'), True, True)
+ self.assertEqual(b'\x00\x10\xFF\x0E\x00\xF2', payload)
+
+ payload = radio.get_payload(bytes(b'\x00\x10\xFE\x00'), True, False)
+ self.assertEqual(b'\x00\x10\xFF\x0E\x00', payload)
+
+ def test_process_frame_payload(self):
+ radio = directory.get_radio('Icom_IC-2730A')(None)
+ data = radio.process_frame_payload(bytes(b'\x00\x10\xFF\x0E\x00'))
+ self.assertEqual(b'\x00\x10\xFE\x00', data)
+
+
+class TestAdapterMeta(type):
+ def __new__(cls, name, parents, dct):
+ return super(TestAdapterMeta, cls).__new__(cls, name, parents, dct)
+
+
+test_file_glob = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ '..', 'images',
+ 'Icom_*.img')
+import sys
+for image_file in glob.glob(test_file_glob):
+ base, _ext = os.path.splitext(os.path.basename(image_file))
+
+ try:
+ radio = directory.get_radio(base)
+ except Exception:
+ continue
+
+ if issubclass(radio, icf.IcomRawCloneModeRadio):
+ # The simulator does not behave like a raw radio
+ continue
+
+ class_name = 'Test_%s' % base
+ sys.modules[__name__].__dict__[class_name] = \
+ TestAdapterMeta(class_name,
+ (BaseIcomCloneTest, unittest.TestCase),
+ dict(RADIO_IDENT=base, IMAGE_FILE=image_file))
diff --git a/tests/unit/test_import_logic.py b/tests/unit/test_import_logic.py
new file mode 100644
index 0000000..ecd9aa9
--- /dev/null
+++ b/tests/unit/test_import_logic.py
@@ -0,0 +1,373 @@
+from tests.unit import base
+from chirp import import_logic
+from chirp import chirp_common
+from chirp import errors
+
+
+class FakeRadio(chirp_common.Radio):
+ def __init__(self, arg):
+ self.POWER_LEVELS = list([chirp_common.PowerLevel('lo', watts=5),
+ chirp_common.PowerLevel('hi', watts=50)])
+ self.TMODES = list(['', 'Tone', 'TSQL'])
+ self.HAS_CTONE = True
+ self.HAS_RX_DTCS = False
+ self.MODES = list(['FM', 'AM', 'DV'])
+ self.DUPLEXES = list(['', '-', '+'])
+
+ def filter_name(self, name):
+ return 'filtered-name'
+
+ def get_features(self):
+ rf = chirp_common.RadioFeatures()
+ rf.valid_power_levels = self.POWER_LEVELS
+ rf.valid_tmodes = self.TMODES
+ rf.valid_modes = self.MODES
+ rf.valid_duplexes = self.DUPLEXES
+ rf.has_ctone = self.HAS_CTONE
+ rf.has_rx_dtcs = self.HAS_RX_DTCS
+ return rf
+
+
+class FakeDstarRadio(FakeRadio, chirp_common.IcomDstarSupport):
+ pass
+
+
+class DstarTests(base.BaseTest):
+ def _test_ensure_has_calls(self, mem,
+ ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls):
+ radio = FakeDstarRadio(None)
+ self.mox.StubOutWithMock(radio, 'get_urcall_list')
+ self.mox.StubOutWithMock(radio, 'get_repeater_call_list')
+ radio.get_urcall_list().AndReturn(ini_urcalls)
+ radio.get_repeater_call_list().AndReturn(ini_rptcalls)
+ self.mox.ReplayAll()
+ import_logic.ensure_has_calls(radio, mem)
+ self.assertEqual(sorted(ini_urcalls), sorted(exp_urcalls))
+ self.assertEqual(sorted(ini_rptcalls), sorted(exp_rptcalls))
+
+ def test_ensure_has_calls_empty(self):
+ mem = chirp_common.DVMemory()
+ mem.dv_urcall = 'KK7DS'
+ mem.dv_rpt1call = 'KD7RFI B'
+ mem.dv_rpt2call = 'KD7RFI G'
+ ini_urcalls = ['', '', '', '', '']
+ ini_rptcalls = ['', '', '', '', '']
+ exp_urcalls = list(ini_urcalls)
+ exp_rptcalls = list(ini_rptcalls)
+ exp_urcalls[0] = mem.dv_urcall
+ exp_rptcalls[0] = mem.dv_rpt1call
+ exp_rptcalls[1] = mem.dv_rpt2call
+ self._test_ensure_has_calls(mem, ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls)
+
+ def test_ensure_has_calls_partial(self):
+ mem = chirp_common.DVMemory()
+ mem.dv_urcall = 'KK7DS'
+ mem.dv_rpt1call = 'KD7RFI B'
+ mem.dv_rpt2call = 'KD7RFI G'
+ ini_urcalls = ['FOO', 'BAR', '', '', '']
+ ini_rptcalls = ['FOO', 'BAR', '', '', '']
+ exp_urcalls = list(ini_urcalls)
+ exp_rptcalls = list(ini_rptcalls)
+ exp_urcalls[2] = mem.dv_urcall
+ exp_rptcalls[2] = mem.dv_rpt1call
+ exp_rptcalls[3] = mem.dv_rpt2call
+ self._test_ensure_has_calls(mem, ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls)
+
+ def test_ensure_has_calls_almost_full(self):
+ mem = chirp_common.DVMemory()
+ mem.dv_urcall = 'KK7DS'
+ mem.dv_rpt1call = 'KD7RFI B'
+ mem.dv_rpt2call = 'KD7RFI G'
+ ini_urcalls = ['FOO', 'BAR', 'BAZ', 'BAT', '']
+ ini_rptcalls = ['FOO', 'BAR', 'BAZ', '', '']
+ exp_urcalls = list(ini_urcalls)
+ exp_rptcalls = list(ini_rptcalls)
+ exp_urcalls[4] = mem.dv_urcall
+ exp_rptcalls[3] = mem.dv_rpt1call
+ exp_rptcalls[4] = mem.dv_rpt2call
+ self._test_ensure_has_calls(mem, ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls)
+
+ def test_ensure_has_calls_urcall_full(self):
+ mem = chirp_common.DVMemory()
+ mem.dv_urcall = 'KK7DS'
+ mem.dv_rpt1call = 'KD7RFI B'
+ mem.dv_rpt2call = 'KD7RFI G'
+ ini_urcalls = ['FOO', 'BAR', 'BAZ', 'BAT', 'BOOM']
+ ini_rptcalls = ['FOO', 'BAR', 'BAZ', '', '']
+ exp_urcalls = list(ini_urcalls)
+ exp_rptcalls = list(ini_rptcalls)
+ exp_urcalls[4] = mem.dv_urcall
+ exp_rptcalls[3] = mem.dv_rpt1call
+ exp_rptcalls[4] = mem.dv_rpt2call
+ self.assertRaises(errors.RadioError,
+ self._test_ensure_has_calls,
+ mem, ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls)
+
+ def test_ensure_has_calls_rptcall_full1(self):
+ mem = chirp_common.DVMemory()
+ mem.dv_urcall = 'KK7DS'
+ mem.dv_rpt1call = 'KD7RFI B'
+ mem.dv_rpt2call = 'KD7RFI G'
+ ini_urcalls = ['FOO', 'BAR', 'BAZ', 'BAT', '']
+ ini_rptcalls = ['FOO', 'BAR', 'BAZ', 'BAT', '']
+ exp_urcalls = list(ini_urcalls)
+ exp_rptcalls = list(ini_rptcalls)
+ exp_urcalls[4] = mem.dv_urcall
+ exp_rptcalls[3] = mem.dv_rpt1call
+ exp_rptcalls[4] = mem.dv_rpt2call
+ self.assertRaises(errors.RadioError,
+ self._test_ensure_has_calls,
+ mem, ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls)
+
+ def test_ensure_has_calls_rptcall_full2(self):
+ mem = chirp_common.DVMemory()
+ mem.dv_urcall = 'KK7DS'
+ mem.dv_rpt1call = 'KD7RFI B'
+ mem.dv_rpt2call = 'KD7RFI G'
+ ini_urcalls = ['FOO', 'BAR', 'BAZ', 'BAT', '']
+ ini_rptcalls = ['FOO', 'BAR', 'BAZ', 'BAT', 'BOOM']
+ exp_urcalls = list(ini_urcalls)
+ exp_rptcalls = list(ini_rptcalls)
+ exp_urcalls[4] = mem.dv_urcall
+ exp_rptcalls[3] = mem.dv_rpt1call
+ exp_rptcalls[4] = mem.dv_rpt2call
+ self.assertRaises(errors.RadioError,
+ self._test_ensure_has_calls,
+ mem, ini_urcalls, ini_rptcalls,
+ exp_urcalls, exp_rptcalls)
+
+
+class ImportFieldTests(base.BaseTest):
+ def test_import_name(self):
+ mem = chirp_common.Memory()
+ mem.name = 'foo'
+ import_logic._import_name(FakeRadio(None), None, mem)
+ self.assertEqual(mem.name, 'filtered-name')
+
+ def test_import_power_same(self):
+ radio = FakeRadio(None)
+ same_rf = radio.get_features()
+ mem = chirp_common.Memory()
+ mem.power = same_rf.valid_power_levels[0]
+ import_logic._import_power(radio, same_rf, mem)
+ self.assertEqual(mem.power, same_rf.valid_power_levels[0])
+
+ def test_import_power_no_src(self):
+ radio = FakeRadio(None)
+ src_rf = chirp_common.RadioFeatures()
+ mem = chirp_common.Memory()
+ mem.power = None
+ import_logic._import_power(radio, src_rf, mem)
+ self.assertEqual(mem.power, radio.POWER_LEVELS[0])
+
+ def test_import_power_no_dst(self):
+ radio = FakeRadio(None)
+ src_rf = radio.get_features() # Steal a copy before we stub out
+ self.mox.StubOutWithMock(radio, 'get_features')
+ radio.get_features().AndReturn(chirp_common.RadioFeatures())
+ self.mox.ReplayAll()
+ mem = chirp_common.Memory()
+ mem.power = src_rf.valid_power_levels[0]
+ import_logic._import_power(radio, src_rf, mem)
+ self.assertEqual(mem.power, None)
+
+ def test_import_power_closest(self):
+ radio = FakeRadio(None)
+ src_rf = chirp_common.RadioFeatures()
+ src_rf.valid_power_levels = [
+ chirp_common.PowerLevel('foo', watts=7),
+ chirp_common.PowerLevel('bar', watts=51),
+ chirp_common.PowerLevel('baz', watts=1),
+ ]
+ mem = chirp_common.Memory()
+ mem.power = src_rf.valid_power_levels[0]
+ import_logic._import_power(radio, src_rf, mem)
+ self.assertEqual(mem.power, radio.POWER_LEVELS[0])
+
+ def test_import_tone_diffA_tsql(self):
+ radio = FakeRadio(None)
+ src_rf = chirp_common.RadioFeatures()
+ src_rf.has_ctone = False
+ mem = chirp_common.Memory()
+ mem.tmode = 'TSQL'
+ mem.rtone = 100.0
+ import_logic._import_tone(radio, src_rf, mem)
+ self.assertEqual(mem.ctone, 100.0)
+
+ def test_import_tone_diffB_tsql(self):
+ radio = FakeRadio(None)
+ radio.HAS_CTONE = False
+ src_rf = chirp_common.RadioFeatures()
+ src_rf.has_ctone = True
+ mem = chirp_common.Memory()
+ mem.tmode = 'TSQL'
+ mem.ctone = 100.0
+ import_logic._import_tone(radio, src_rf, mem)
+ self.assertEqual(mem.rtone, 100.0)
+
+ def test_import_dtcs_diffA_dtcs(self):
+ radio = FakeRadio(None)
+ src_rf = chirp_common.RadioFeatures()
+ src_rf.has_rx_dtcs = True
+ mem = chirp_common.Memory()
+ mem.tmode = 'DTCS'
+ mem.rx_dtcs = 32
+ import_logic._import_dtcs(radio, src_rf, mem)
+ self.assertEqual(mem.dtcs, 32)
+
+ def test_import_dtcs_diffB_dtcs(self):
+ radio = FakeRadio(None)
+ radio.HAS_RX_DTCS = True
+ src_rf = chirp_common.RadioFeatures()
+ src_rf.has_rx_dtcs = False
+ mem = chirp_common.Memory()
+ mem.tmode = 'DTCS'
+ mem.dtcs = 32
+ import_logic._import_dtcs(radio, src_rf, mem)
+ self.assertEqual(mem.rx_dtcs, 32)
+
+ def test_import_mode_valid_fm(self):
+ radio = FakeRadio(None)
+ mem = chirp_common.Memory()
+ mem.mode = 'Auto'
+ mem.freq = 146000000
+ import_logic._import_mode(radio, None, mem)
+ self.assertEqual(mem.mode, 'FM')
+
+ def test_import_mode_valid_am(self):
+ radio = FakeRadio(None)
+ mem = chirp_common.Memory()
+ mem.mode = 'Auto'
+ mem.freq = 18000000
+ import_logic._import_mode(radio, None, mem)
+ self.assertEqual(mem.mode, 'AM')
+
+ def test_import_mode_invalid(self):
+ radio = FakeRadio(None)
+ radio.MODES.remove('AM')
+ mem = chirp_common.Memory()
+ mem.mode = 'Auto'
+ mem.freq = 1800000
+ self.assertRaises(import_logic.DestNotCompatible,
+ import_logic._import_mode, radio, None, mem)
+
+ def test_import_duplex_vhf(self):
+ radio = FakeRadio(None)
+ mem = chirp_common.Memory()
+ mem.freq = 146000000
+ mem.offset = 146600000
+ mem.duplex = 'split'
+ import_logic._import_duplex(radio, None, mem)
+ self.assertEqual(mem.duplex, '+')
+ self.assertEqual(mem.offset, 600000)
+
+ def test_import_duplex_negative(self):
+ radio = FakeRadio(None)
+ mem = chirp_common.Memory()
+ mem.freq = 146600000
+ mem.offset = 146000000
+ mem.duplex = 'split'
+ import_logic._import_duplex(radio, None, mem)
+ self.assertEqual(mem.duplex, '-')
+ self.assertEqual(mem.offset, 600000)
+
+ def test_import_duplex_uhf(self):
+ radio = FakeRadio(None)
+ mem = chirp_common.Memory()
+ mem.freq = 431000000
+ mem.offset = 441000000
+ mem.duplex = 'split'
+ import_logic._import_duplex(radio, None, mem)
+ self.assertEqual(mem.duplex, '+')
+ self.assertEqual(mem.offset, 10000000)
+
+ def test_import_duplex_too_big_vhf(self):
+ radio = FakeRadio(None)
+ mem = chirp_common.Memory()
+ mem.freq = 146000000
+ mem.offset = 246000000
+ mem.duplex = 'split'
+ self.assertRaises(import_logic.DestNotCompatible,
+ import_logic._import_duplex, radio, None, mem)
+
+ def test_import_mem(self, errors=[]):
+ radio = FakeRadio(None)
+ src_rf = chirp_common.RadioFeatures()
+ mem = chirp_common.Memory()
+
+ self.mox.StubOutWithMock(mem, 'dupe')
+ self.mox.StubOutWithMock(import_logic, '_import_name')
+ self.mox.StubOutWithMock(import_logic, '_import_power')
+ self.mox.StubOutWithMock(import_logic, '_import_tone')
+ self.mox.StubOutWithMock(import_logic, '_import_dtcs')
+ self.mox.StubOutWithMock(import_logic, '_import_mode')
+ self.mox.StubOutWithMock(import_logic, '_import_duplex')
+ self.mox.StubOutWithMock(radio, 'validate_memory')
+
+ mem.dupe().AndReturn(mem)
+ import_logic._import_name(radio, src_rf, mem)
+ import_logic._import_power(radio, src_rf, mem)
+ import_logic._import_tone(radio, src_rf, mem)
+ import_logic._import_dtcs(radio, src_rf, mem)
+ import_logic._import_mode(radio, src_rf, mem)
+ import_logic._import_duplex(radio, src_rf, mem)
+ radio.validate_memory(mem).AndReturn(errors)
+
+ self.mox.ReplayAll()
+
+ import_logic.import_mem(radio, src_rf, mem)
+
+ def test_import_mem_with_warnings(self):
+ self.test_import_mem([chirp_common.ValidationWarning('Test')])
+
+ def test_import_mem_with_errors(self):
+ self.assertRaises(import_logic.DestNotCompatible,
+ self.test_import_mem,
+ [chirp_common.ValidationError('Test')])
+
+ def test_import_bank(self):
+ dst_mem = chirp_common.Memory()
+ dst_mem.number = 1
+ src_mem = chirp_common.Memory()
+ src_mem.number = 2
+ dst_radio = FakeRadio(None)
+ src_radio = FakeRadio(None)
+ dst_bm = chirp_common.BankModel(dst_radio)
+ src_bm = chirp_common.BankModel(src_radio)
+
+ dst_banks = [chirp_common.Bank(dst_bm, 0, 'A'),
+ chirp_common.Bank(dst_bm, 1, 'B'),
+ chirp_common.Bank(dst_bm, 2, 'C'),
+ ]
+ src_banks = [chirp_common.Bank(src_bm, 1, '1'),
+ chirp_common.Bank(src_bm, 2, '2'),
+ chirp_common.Bank(src_bm, 3, '3'),
+ ]
+
+ self.mox.StubOutWithMock(dst_radio, 'get_mapping_models')
+ self.mox.StubOutWithMock(src_radio, 'get_mapping_models')
+ self.mox.StubOutWithMock(dst_bm, 'get_mappings')
+ self.mox.StubOutWithMock(src_bm, 'get_mappings')
+ self.mox.StubOutWithMock(dst_bm, 'get_memory_mappings')
+ self.mox.StubOutWithMock(src_bm, 'get_memory_mappings')
+ self.mox.StubOutWithMock(dst_bm, 'remove_memory_from_mapping')
+ self.mox.StubOutWithMock(dst_bm, 'add_memory_to_mapping')
+
+ dst_radio.get_mapping_models().AndReturn([dst_bm])
+ dst_bm.get_mappings().AndReturn(dst_banks)
+ src_radio.get_mapping_models().AndReturn([src_bm])
+ src_bm.get_mappings().AndReturn(src_banks)
+ src_bm.get_memory_mappings(src_mem).AndReturn([src_banks[0]])
+ dst_bm.get_memory_mappings(dst_mem).AndReturn([dst_banks[1]])
+ dst_bm.remove_memory_from_mapping(dst_mem, dst_banks[1])
+ dst_bm.add_memory_to_mapping(dst_mem, dst_banks[0])
+
+ self.mox.ReplayAll()
+
+ import_logic.import_bank(dst_radio, src_radio, dst_mem, src_mem)
diff --git a/tests/unit/test_mappingmodel.py b/tests/unit/test_mappingmodel.py
new file mode 100644
index 0000000..2f263d7
--- /dev/null
+++ b/tests/unit/test_mappingmodel.py
@@ -0,0 +1,283 @@
+# Copyright 2013 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from tests.unit import base
+from chirp import chirp_common
+from chirp.drivers import icf
+
+
+class TestBaseMapping(base.BaseTest):
+ CLS = chirp_common.MemoryMapping
+
+ def test_mapping(self):
+ model = chirp_common.MappingModel(None, 'Foo')
+ mapping = self.CLS(model, 1, 'Foo')
+ self.assertEqual(str(mapping), 'Foo')
+ self.assertEqual(mapping.get_name(), 'Foo')
+ self.assertEqual(mapping.get_index(), 1)
+ self.assertEqual(repr(mapping), '%s-1' % self.CLS.__name__)
+ self.assertEqual(mapping._model, model)
+
+ def test_mapping_eq(self):
+ mapping1 = self.CLS(None, 1, 'Foo')
+ mapping2 = self.CLS(None, 1, 'Bar')
+ mapping3 = self.CLS(None, 2, 'Foo')
+
+ self.assertEqual(mapping1, mapping2)
+ self.assertNotEqual(mapping1, mapping3)
+
+
+class TestBaseBank(TestBaseMapping):
+ CLS = chirp_common.Bank
+
+
+class _TestBaseClass(base.BaseTest):
+ ARGS = tuple()
+
+ def setUp(self):
+ super(_TestBaseClass, self).setUp()
+ self.model = self.CLS(*self.ARGS)
+
+ def _test_base(self, method, *args):
+ self.assertRaises(NotImplementedError,
+ getattr(self.model, method), *args)
+
+
+class TestBaseMappingModel(_TestBaseClass):
+ CLS = chirp_common.MappingModel
+ ARGS = tuple([None, 'Foo'])
+
+ def test_base_class(self):
+ methods = [('get_num_mappings', ()),
+ ('get_mappings', ()),
+ ('add_memory_to_mapping', (None, None)),
+ ('remove_memory_from_mapping', (None, None)),
+ ('get_mapping_memories', (None,)),
+ ('get_memory_mappings', (None,)),
+ ]
+ for method, args in methods:
+ self._test_base(method, *args)
+
+ def test_get_name(self):
+ self.assertEqual(self.model.get_name(), 'Foo')
+
+
+class TestBaseBankModel(TestBaseMappingModel):
+ ARGS = tuple([None])
+ CLS = chirp_common.BankModel
+
+ def test_get_name(self):
+ self.assertEqual(self.model.get_name(), 'Banks')
+
+
+class TestBaseMappingModelIndexInterface(_TestBaseClass):
+ CLS = chirp_common.MappingModelIndexInterface
+
+ def test_base_class(self):
+ methods = [('get_index_bounds', ()),
+ ('get_memory_index', (None, None)),
+ ('set_memory_index', (None, None, None)),
+ ('get_next_mapping_index', (None,)),
+ ]
+ for method, args in methods:
+ self._test_base(method, *args)
+
+
+class TestIcomBanks(TestBaseMapping):
+ def test_icom_bank(self):
+ bank = icf.IcomBank(None, 1, 'Foo')
+ # IcomBank has an index attribute used by IcomBankModel
+ self.assertTrue(hasattr(bank, 'index'))
+
+
+class TestIcomBankModel(base.BaseTest):
+ CLS = icf.IcomBankModel
+
+ def _get_rf(self):
+ rf = chirp_common.RadioFeatures()
+ rf.memory_bounds = (1, 10)
+ return rf
+
+ def setUp(self):
+ super(TestIcomBankModel, self).setUp()
+
+ class FakeRadio(icf.IcomCloneModeRadio):
+ _num_banks = 10
+ _bank_index_bounds = (0, 10)
+
+ def get_features(the_radio):
+ return self._get_rf()
+
+ def _set_bank(self, number, index):
+ pass
+
+ def _get_bank(self, number):
+ pass
+
+ def _get_bank_index(self, number):
+ pass
+
+ def _set_bank_index(self, number, index):
+ pass
+
+ def get_memory(self, number):
+ pass
+
+ self._radio = FakeRadio(None)
+ self._model = self.CLS(self._radio)
+ self.mox.StubOutWithMock(self._radio, '_set_bank')
+ self.mox.StubOutWithMock(self._radio, '_get_bank')
+ self.mox.StubOutWithMock(self._radio, '_set_bank_index')
+ self.mox.StubOutWithMock(self._radio, '_get_bank_index')
+ self.mox.StubOutWithMock(self._radio, 'get_memory')
+
+ def test_get_num_mappings(self):
+ self.assertEqual(self._model.get_num_mappings(), 10)
+
+ def test_get_mappings(self):
+ banks = self._model.get_mappings()
+ self.assertEqual(len(banks), 10)
+ i = 0
+ for bank in banks:
+ index = chr(ord("A") + i)
+ self.assertEqual(bank.get_index(), index)
+ self.assertEqual(bank.get_name(), 'BANK-%s' % index)
+ self.assertEqual(bank.index, i)
+ i += 1
+
+ def test_add_memory_to_mapping(self):
+ mem = chirp_common.Memory()
+ mem.number = 5
+ banks = self._model.get_mappings()
+ bank = banks[2]
+ self._radio._set_bank(5, 2)
+ self.mox.ReplayAll()
+ self._model.add_memory_to_mapping(mem, bank)
+
+ def _setup_test_remove_memory_from_mapping(self, curbank):
+ mem = chirp_common.Memory()
+ mem.number = 5
+ banks = self._model.get_mappings()
+ bank = banks[2]
+ self._radio._get_bank(5).AndReturn(curbank)
+ if curbank == 2:
+ self._radio._set_bank(5, None)
+ self.mox.ReplayAll()
+ return mem, bank
+
+ def test_remove_memory_from_mapping(self):
+ mem, bank = self._setup_test_remove_memory_from_mapping(2)
+ self._model.remove_memory_from_mapping(mem, bank)
+
+ def test_remove_memory_from_mapping_wrong_bank(self):
+ mem, bank = self._setup_test_remove_memory_from_mapping(3)
+ self.assertRaises(Exception,
+ self._model.remove_memory_from_mapping, mem, bank)
+
+ def test_remove_memory_from_mapping_no_bank(self):
+ mem, bank = self._setup_test_remove_memory_from_mapping(None)
+ self.assertRaises(Exception,
+ self._model.remove_memory_from_mapping, mem, bank)
+
+ def test_get_mapping_memories(self):
+ banks = self._model.get_mappings()
+ expected = []
+ for i in range(1, 10):
+ should_include = bool(i % 2)
+ self._radio._get_bank(i).AndReturn(
+ should_include and banks[1].index or None)
+ if should_include:
+ self._radio.get_memory(i).AndReturn(i)
+ expected.append(i)
+ self.mox.ReplayAll()
+ members = self._model.get_mapping_memories(banks[1])
+ self.assertEqual(members, expected)
+
+ def test_get_memory_mappings(self):
+ banks = self._model.get_mappings()
+ mem1 = chirp_common.Memory()
+ mem1.number = 5
+ mem2 = chirp_common.Memory()
+ mem2.number = 6
+ self._radio._get_bank(mem1.number).AndReturn(2)
+ self._radio._get_bank(mem2.number).AndReturn(None)
+ self.mox.ReplayAll()
+ self.assertEqual(self._model.get_memory_mappings(mem1)[0], banks[2])
+ self.assertEqual(self._model.get_memory_mappings(mem2), [])
+
+
+class TestIcomIndexedBankModel(TestIcomBankModel):
+ CLS = icf.IcomIndexedBankModel
+
+ def _get_rf(self):
+ rf = super(TestIcomIndexedBankModel, self)._get_rf()
+ rf.has_bank_index = True
+ return rf
+
+ def test_get_index_bounds(self):
+ self.assertEqual(self._model.get_index_bounds(), (0, 10))
+
+ def test_get_memory_index(self):
+ mem = chirp_common.Memory()
+ mem.number = 5
+ self._radio._get_bank_index(mem.number).AndReturn(1)
+ self.mox.ReplayAll()
+ self.assertEqual(self._model.get_memory_index(mem, None), 1)
+
+ def test_set_memory_index(self):
+ mem = chirp_common.Memory()
+ mem.number = 5
+ banks = self._model.get_mappings()
+ self.mox.StubOutWithMock(self._model, 'get_memory_mappings')
+ self._model.get_memory_mappings(mem).AndReturn([banks[3]])
+ self._radio._set_bank_index(mem.number, 1)
+ self.mox.ReplayAll()
+ self._model.set_memory_index(mem, banks[3], 1)
+
+ def test_set_memory_index_bad_bank(self):
+ mem = chirp_common.Memory()
+ mem.number = 5
+ banks = self._model.get_mappings()
+ self.mox.StubOutWithMock(self._model, 'get_memory_mappings')
+ self._model.get_memory_mappings(mem).AndReturn([banks[4]])
+ self.mox.ReplayAll()
+ self.assertRaises(Exception,
+ self._model.set_memory_index, mem, banks[3], 1)
+
+ def test_set_memory_index_bad_index(self):
+ mem = chirp_common.Memory()
+ mem.number = 5
+ banks = self._model.get_mappings()
+ self.mox.StubOutWithMock(self._model, 'get_memory_mappings')
+ self._model.get_memory_mappings(mem).AndReturn([banks[3]])
+ self.mox.ReplayAll()
+ self.assertRaises(Exception,
+ self._model.set_memory_index, mem, banks[3], 99)
+
+ def test_get_next_mapping_index(self):
+ banks = self._model.get_mappings()
+ for i in range(*self._radio.get_features().memory_bounds):
+ self._radio._get_bank(i).AndReturn((i % 2) and banks[1].index)
+ if bool(i % 2):
+ self._radio._get_bank_index(i).AndReturn(i)
+ idx = 0
+ for i in range(*self._radio.get_features().memory_bounds):
+ self._radio._get_bank(i).AndReturn((i % 2) and banks[2].index)
+ if i % 2:
+ self._radio._get_bank_index(i).AndReturn(idx)
+ idx += 1
+ self.mox.ReplayAll()
+ self.assertEqual(self._model.get_next_mapping_index(banks[1]), 0)
+ self.assertEqual(self._model.get_next_mapping_index(banks[2]), 5)
diff --git a/tests/unit/test_memedit_edits.py b/tests/unit/test_memedit_edits.py
new file mode 100644
index 0000000..fdf971c
--- /dev/null
+++ b/tests/unit/test_memedit_edits.py
@@ -0,0 +1,82 @@
+try:
+ import mox
+except ImportError:
+ from mox3 import mox
+from tests.unit import base
+
+__builtins__["_"] = lambda s: s
+
+memedit = None
+
+
+class TestEdits(base.BaseTest):
+ def setUp(self):
+ global memedit
+ super(TestEdits, self).setUp()
+ base.mock_gtk()
+ from chirp.ui import memedit as memedit_module
+ memedit = memedit_module
+
+ def tearDown(self):
+ super(TestEdits, self).tearDown()
+ base.unmock_gtk()
+
+ def _test_tone_column_change(self, col,
+ ini_tmode='', ini_cmode='',
+ exp_tmode=None, exp_cmode=None):
+ editor = self.mox.CreateMock(memedit.MemoryEditor)
+ editor._config = self.mox.CreateMockAnything()
+ editor._config.get_bool("no_smart_tmode").AndReturn(False)
+ editor.col = lambda x: x
+ editor.store = self.mox.CreateMockAnything()
+ editor.store.get_iter('path').AndReturn('iter')
+ editor.store.get('iter', 'Tone Mode', 'Cross Mode').AndReturn(
+ (ini_tmode, ini_cmode))
+ if exp_tmode:
+ editor.store.set('iter', 'Tone Mode', exp_tmode)
+ if exp_cmode and col != 'Cross Mode':
+ editor.store.set('iter', 'Cross Mode', exp_cmode)
+ self.mox.ReplayAll()
+ memedit.MemoryEditor.ed_tone_field(editor, None, 'path', None, col)
+
+ def _test_auto_tone_mode(self, col, exp_tmode, exp_cmode):
+ cross_exp_cmode = (exp_tmode == "Cross" and exp_cmode or None)
+
+ # No tmode -> expected tmode, maybe requires cross mode change
+ self._test_tone_column_change(col, exp_tmode=exp_tmode,
+ exp_cmode=cross_exp_cmode)
+
+ # Expected tmode does not re-set tmode, may change cmode
+ self._test_tone_column_change(col, ini_tmode=exp_tmode,
+ exp_cmode=cross_exp_cmode)
+
+ # Invalid tmode -> expected, may change cmode
+ self._test_tone_column_change(col, ini_tmode="foo",
+ exp_tmode=exp_tmode,
+ exp_cmode=cross_exp_cmode)
+
+ # Expected cmode does not re-set cmode
+ self._test_tone_column_change(col, ini_tmode="Cross",
+ ini_cmode=exp_cmode)
+
+ # Invalid cmode -> expected
+ self._test_tone_column_change(col, ini_tmode="Cross",
+ ini_cmode="foo", exp_cmode=exp_cmode)
+
+ def test_auto_tone_mode_tone(self):
+ self._test_auto_tone_mode('Tone', 'Tone', 'Tone->Tone')
+
+ def test_auto_tone_mode_tsql(self):
+ self._test_auto_tone_mode('ToneSql', 'TSQL', 'Tone->Tone')
+
+ def test_auto_tone_mode_dtcs(self):
+ self._test_auto_tone_mode('DTCS Code', 'DTCS', 'DTCS->')
+
+ def test_auto_tone_mode_dtcs_rx(self):
+ self._test_auto_tone_mode('DTCS Rx Code', 'Cross', '->DTCS')
+
+ def test_auto_tone_mode_dtcs_pol(self):
+ self._test_auto_tone_mode('DTCS Pol', 'DTCS', 'DTCS->')
+
+ def test_auto_tone_mode_cross(self):
+ self._test_auto_tone_mode('Cross Mode', 'Cross', 'Tone->Tone')
diff --git a/tests/unit/test_platform.py b/tests/unit/test_platform.py
new file mode 100644
index 0000000..394f894
--- /dev/null
+++ b/tests/unit/test_platform.py
@@ -0,0 +1,62 @@
+# Copyright 2013 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import unittest
+try:
+ import mox
+except ImportError:
+ from mox3 import mox
+import os
+
+from tests.unit import base
+from chirp import platform
+
+
+class Win32PlatformTest(base.BaseTest):
+ def _test_init(self):
+ self.mox.StubOutWithMock(platform, 'comports')
+ self.mox.StubOutWithMock(os, 'mkdir')
+ self.mox.StubOutWithMock(os, 'getenv')
+ os.mkdir(mox.IgnoreArg())
+ os.getenv("APPDATA").AndReturn("foo")
+ os.getenv("USERPROFILE").AndReturn("foo")
+
+ def test_init(self):
+ self._test_init()
+ self.mox.ReplayAll()
+ platform.Win32Platform()
+
+ def test_serial_ports_sorted(self):
+ self._test_init()
+
+ fake_comports = []
+ numbers = [1, 11, 2, 12, 7, 3, 123]
+ for i in numbers:
+ fake_comports.append(("COM%i" % i, None, None))
+
+ platform.comports().AndReturn(fake_comports)
+ self.mox.ReplayAll()
+ ports = platform.Win32Platform().list_serial_ports()
+
+ correct_order = ["COM%i" % i for i in sorted(numbers)]
+ self.assertEqual(ports, correct_order)
+
+ def test_serial_ports_bad_portnames(self):
+ self._test_init()
+
+ platform.comports().AndReturn([('foo', None, None)])
+ self.mox.ReplayAll()
+ ports = platform.Win32Platform().list_serial_ports()
+ self.assertEqual(ports, ['foo'])
diff --git a/tests/unit/test_repeaterbook.py b/tests/unit/test_repeaterbook.py
new file mode 100644
index 0000000..2563b3f
--- /dev/null
+++ b/tests/unit/test_repeaterbook.py
@@ -0,0 +1,28 @@
+import tempfile
+import unittest
+
+from chirp import chirp_common
+from chirp.drivers import repeaterbook
+
+
+class TestRepeaterBook(unittest.TestCase):
+ def _fetch_and_load(self, query):
+ fn = tempfile.mktemp('.csv')
+ chirp_common.urlretrieve(query, fn)
+ radio = repeaterbook.RBRadio(fn)
+ return fn, radio
+
+ def test_political(self):
+ query = "http://www.repeaterbook.com/repeaters/downloads/chirp.php" + \
+ "?func=default&state_id=%s&band=%s&freq=%%&band6=%%&loc=%%" + \
+ "&county_id=%s&status_id=%%&features=%%&coverage=%%&use=%%"
+ query = query % ('41', '%%', '005')
+ self._fetch_and_load(query)
+
+ def test_proximity(self):
+ loc = '97124'
+ band = '%%'
+ dist = '20'
+ query = "https://www.repeaterbook.com/repeaters/downloads/CHIRP/" \
+ "app_direct.php?loc=%s&band=%s&dist=%s" % (loc, band, dist)
+ self._fetch_and_load(query)
diff --git a/tests/unit/test_settings.py b/tests/unit/test_settings.py
new file mode 100644
index 0000000..ccc4308
--- /dev/null
+++ b/tests/unit/test_settings.py
@@ -0,0 +1,140 @@
+# Copyright 2013 Dan Smith <dsmith@danplanet.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from tests.unit import base
+from chirp import settings
+
+
+class TestSettingValues(base.BaseTest):
+ def _set_and_test(self, rsv, *values):
+ for value in values:
+ rsv.set_value(value)
+ self.assertEqual(rsv.get_value(), value)
+
+ def _set_and_catch(self, rsv, *values):
+ for value in values:
+ self.assertRaises(settings.InvalidValueError,
+ rsv.set_value, value)
+
+ def test_radio_setting_value_integer(self):
+ value = settings.RadioSettingValueInteger(0, 10, 5)
+ self.assertEqual(value.get_value(), 5)
+ self._set_and_test(value, 1, 0, 10)
+ self._set_and_catch(value, -1, 11)
+
+ def test_radio_setting_value_float(self):
+ value = settings.RadioSettingValueFloat(1.0, 10.5, 5.0)
+ self.assertEqual(value.get_value(), 5.0)
+ self._set_and_test(value, 2.5, 1.0, 10.5)
+ self._set_and_catch(value, 0.9, 10.6, -1.5)
+
+ def test_radio_setting_value_boolean(self):
+ value = settings.RadioSettingValueBoolean(True)
+ self.assertTrue(value.get_value())
+ self._set_and_test(value, True, False)
+
+ def test_radio_setting_value_list(self):
+ opts = ["Abc", "Def", "Ghi"]
+ value = settings.RadioSettingValueList(opts, "Abc")
+ self.assertEqual(value.get_value(), "Abc")
+ self.assertEqual(int(value), 0)
+ self._set_and_test(value, "Def", "Ghi", "Abc")
+ self._set_and_catch(value, "Jkl", "Xyz")
+ self.assertEqual(value.get_options(), opts)
+
+ def test_radio_setting_value_string(self):
+ value = settings.RadioSettingValueString(1, 5, "foo", autopad=False)
+ self.assertEqual(value.get_value(), "foo")
+ self.assertEqual(str(value), "foo")
+ self._set_and_test(value, "a", "abc", "abdef")
+ self._set_and_catch(value, "", "abcdefg")
+
+ def test_validate_callback(self):
+ class TestException(Exception):
+ pass
+
+ value = settings.RadioSettingValueString(0, 5, "foo", autopad=False)
+
+ def test_validate(val):
+ if val == "bar":
+ raise TestException()
+ value.set_validate_callback(test_validate)
+ value.set_value("baz")
+ self.assertRaises(TestException, value.set_value, "bar")
+
+ def test_changed(self):
+ value = settings.RadioSettingValueBoolean(False)
+ self.assertFalse(value.changed())
+ value.set_value(False)
+ self.assertFalse(value.changed())
+ value.set_value(True)
+ self.assertTrue(value.changed())
+
+
+class TestSettingContainers(base.BaseTest):
+ def test_radio_setting_group(self):
+ s1 = settings.RadioSetting("s1", "Setting 1")
+ s2 = settings.RadioSetting("s2", "Setting 2")
+ s3 = settings.RadioSetting("s3", "Setting 3")
+ group = settings.RadioSettingGroup("foo", "Foo Group", s1)
+ self.assertEqual(group.get_name(), "foo")
+ self.assertEqual(group.get_shortname(), "Foo Group")
+ self.assertEqual(group.values(), [s1])
+ self.assertEqual(group.keys(), ["s1"])
+ group.append(s2)
+ self.assertEqual(group.items(), [("s1", s1), ("s2", s2)])
+ self.assertEqual(group["s1"], s1)
+ group["s3"] = s3
+ self.assertEqual(group.values(), [s1, s2, s3])
+ self.assertEqual(group.keys(), ["s1", "s2", "s3"])
+ self.assertEqual([x for x in group], [s1, s2, s3])
+
+ def set_dupe():
+ group["s3"] = s3
+ self.assertRaises(KeyError, set_dupe)
+
+ def test_radio_setting(self):
+ val = settings.RadioSettingValueBoolean(True)
+ rs = settings.RadioSetting("foo", "Foo", val)
+ self.assertEqual(rs.value, val)
+ rs.value = False
+ self.assertEqual(val.get_value(), False)
+
+ def test_radio_setting_multi(self):
+ val1 = settings.RadioSettingValueBoolean(True)
+ val2 = settings.RadioSettingValueBoolean(False)
+ rs = settings.RadioSetting("foo", "Foo", val1, val2)
+ self.assertEqual(rs[0], val1)
+ self.assertEqual(rs[1], val2)
+ rs[0] = False
+ rs[1] = True
+ self.assertEqual(val1.get_value(), False)
+ self.assertEqual(val2.get_value(), True)
+
+ def test_apply_callback(self):
+ class TestException(Exception):
+ pass
+
+ rs = settings.RadioSetting("foo", "Foo")
+ self.assertFalse(rs.has_apply_callback())
+
+ def test_cb(setting, data1, data2):
+ self.assertEqual(setting, rs)
+ self.assertEqual(data1, "foo")
+ self.assertEqual(data2, "bar")
+ raise TestException()
+ rs.set_apply_callback(test_cb, "foo", "bar")
+ self.assertTrue(rs.has_apply_callback())
+ self.assertRaises(TestException, rs.run_apply_callback)
diff --git a/tests/unit/test_shiftdialog.py b/tests/unit/test_shiftdialog.py
new file mode 100644
index 0000000..fe0b62d
--- /dev/null
+++ b/tests/unit/test_shiftdialog.py
@@ -0,0 +1,112 @@
+import unittest
+try:
+ import mox
+except ImportError:
+ from mox3 import mox
+
+from tests.unit import base
+from chirp import chirp_common
+from chirp import errors
+
+shiftdialog = None
+
+
+class FakeRadio(object):
+ def __init__(self, *memories):
+ self._mems = {}
+ for location in memories:
+ mem = chirp_common.Memory()
+ mem.number = location
+ self._mems[location] = mem
+ self._features = chirp_common.RadioFeatures()
+
+ def get_features(self):
+ return self._features
+
+ def get_memory(self, location):
+ try:
+ return self._mems[location]
+ except KeyError:
+ mem = chirp_common.Memory()
+ mem.number = location
+ mem.empty = True
+ return mem
+
+ def set_memory(self, memory):
+ self._mems[memory.number] = memory
+
+ def erase_memory(self, location):
+ del self._mems[location]
+
+
+class FakeRadioThread(object):
+ def __init__(self, radio):
+ self.radio = radio
+
+ def lock(self):
+ pass
+
+ def unlock(self):
+ pass
+
+
+class ShiftDialogTest(base.BaseTest):
+ def setUp(self):
+ global shiftdialog
+ super(ShiftDialogTest, self).setUp()
+ base.mock_gtk()
+ from chirp.ui import shiftdialog as shiftdialog_module
+ shiftdialog = shiftdialog_module
+
+ def tearDown(self):
+ super(ShiftDialogTest, self).tearDown()
+ base.unmock_gtk()
+
+ def _test_hole(self, fn, starting, arg, expected):
+ radio = FakeRadio(*tuple(starting))
+ radio.get_features().memory_bounds = (0, 5)
+ sd = shiftdialog.ShiftDialog(FakeRadioThread(radio))
+
+ if isinstance(arg, tuple):
+ getattr(sd, fn)(*arg)
+ else:
+ getattr(sd, fn)(arg)
+
+ self.assertEqual(expected, sorted(radio._mems.keys()))
+ self.assertEqual(expected,
+ sorted([mem.number for mem in radio._mems.values()]))
+
+ def _test_delete_hole(self, starting, arg, expected):
+ self._test_hole('_delete_hole', starting, arg, expected)
+
+ def _test_insert_hole(self, starting, pos, expected):
+ self._test_hole('_insert_hole', starting, pos, expected)
+
+ def test_delete_hole_with_hole(self):
+ self._test_delete_hole([1, 2, 3, 5],
+ 2,
+ [1, 2, 5])
+
+ def test_delete_hole_without_hole(self):
+ self._test_delete_hole([1, 2, 3, 4, 5],
+ 2,
+ [1, 2, 3, 4])
+
+ def test_delete_hole_with_all(self):
+ self._test_delete_hole([1, 2, 3, 5],
+ (2, True),
+ [1, 2, 4])
+
+ def test_delete_hole_with_all_full(self):
+ self._test_delete_hole([1, 2, 3, 4, 5],
+ (2, True),
+ [1, 2, 3, 4])
+
+ def test_insert_hole_with_space(self):
+ self._test_insert_hole([1, 2, 3, 5],
+ 2,
+ [1, 3, 4, 5])
+
+ def test_insert_hole_without_space(self):
+ self.assertRaises(errors.InvalidMemoryLocation,
+ self._test_insert_hole, [1, 2, 3, 4, 5], 2, [])
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
new file mode 100644
index 0000000..575f3e3
--- /dev/null
+++ b/tests/unit/test_utils.py
@@ -0,0 +1,21 @@
+from chirp import util
+from tests.unit import base
+
+
+class TestUtils(base.BaseTest):
+ def test_hexprint_with_string(self):
+ util.hexprint('00000000000000')
+
+ def test_hexprint_with_bytes(self):
+ util.hexprint(b'00000000000000')
+
+ def test_struct_pack(self):
+ struct = util.StringStruct
+
+ self.assertEqual('\x00c',
+ struct.pack('bc', 0, 'c'))
+
+ def test_struct_unpack(self):
+ struct = util.StringStruct
+
+ self.assertEqual((1, 'c'), struct.unpack('bc', '\x01c'))
diff --git a/tests/unit/test_yaesu_clone.py b/tests/unit/test_yaesu_clone.py
new file mode 100644
index 0000000..869c3b5
--- /dev/null
+++ b/tests/unit/test_yaesu_clone.py
@@ -0,0 +1,41 @@
+from builtins import bytes
+import unittest
+
+from chirp.drivers import yaesu_clone
+from chirp import memmap
+
+
+class TestYaesuChecksum(unittest.TestCase):
+ def _test_checksum(self, mmap):
+ cs = yaesu_clone.YaesuChecksum(0, 2, 3)
+
+ self.assertEqual(42, cs.get_existing(mmap))
+ self.assertEqual(0x8A, cs.get_calculated(mmap))
+ try:
+ mmap = mmap.get_byte_compatible()
+ mmap[0] = 3
+ except AttributeError:
+ # str or bytes
+ try:
+ # str
+ mmap = memmap.MemoryMap('\x03' + mmap[1:])
+ except TypeError:
+ # bytes
+ mmap = memmap.MemoryMapBytes(b'\x03' + mmap[1:])
+
+ cs.update(mmap)
+ self.assertEqual(95, cs.get_calculated(mmap))
+
+ def test_with_MemoryMap(self):
+ mmap = memmap.MemoryMap('...\x2A')
+ self._test_checksum(mmap)
+
+ def test_with_MemoryMapBytes(self):
+ mmap = memmap.MemoryMapBytes(bytes(b'...\x2A'))
+ self._test_checksum(mmap)
+
+ def test_with_bytes(self):
+ self._test_checksum(b'...\x2A')
+
+ def test_with_str(self):
+ self._test_checksum('...\x2A')
diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 0000000..a9f08af
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Makefile for serialsniff
+#
+# Author: IT2 Stuart Blake Tener, USNR (N3GWG)
+#
+# Version 1.00
+#
+# This makefile checks to see if we are running under the OS "Darwin"
+# and passes the proper macro flag ("MACOS") if we are.
+#
+# Incidentally, it is noteworthy that MacOS (Darwin) is not the only
+# operating system which is deficient some of the library routines
+# MacOS is currently defficient. Thus, it is instructive that other
+# operating systems names might need to be added for compilation to
+# become occurring in their environments.
+#
+#
+
+ifndef SYSNAME
+ SYSNAME := $(shell uname -s)
+ ifeq ($(SYSNAME),Darwin)
+ MYFLAGS := "-DMACOS"
+ REMOVE := srm -vrfz
+ else
+ REMOVE := rm -rf
+ endif
+endif
+
+serialsniff: serialsniff.c
+ $(CC) $? -o $@ $(LDFLAGS) $(CFLAGS) $(MYFLAGS)
+
+clean:
+ $(REMOVE) serialsniff *~ *.o *.bak core tags shar a.out
+
diff --git a/tools/bitdiff.py b/tools/bitdiff.py
new file mode 100644
index 0000000..d06bdb2
--- /dev/null
+++ b/tools/bitdiff.py
@@ -0,0 +1,166 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 Jens Jensen AF5MI <kd4tjx@yahoo.com>
+
+import sys
+import os
+import argparse
+import time
+
+
+def printDiff(pos, byte1, byte2, args):
+ bits1 = '{0:08b}'.format(byte1)
+ bits2 = '{0:08b}'.format(byte2)
+ print "@%04Xh" % pos
+ print "1:%02Xh, %sb" % (byte1, bits1)
+ print "2:%02Xh, %sb" % (byte2, bits2)
+ if args.csv:
+ writeDiffCSV(pos, byte1, byte2, args)
+
+
+def writeDiffCSV(pos, byte1, byte2, args):
+ bits1 = '{0:08b}'.format(byte1)
+ bits2 = '{0:08b}'.format(byte2)
+ csvline = '%s, %s, %04X, %02X, %s, %02X, %s, %s, %s' % \
+ (args.file1, args.file2, pos, byte1, bits1,
+ byte2, bits2, args.setting, args.value)
+ if not os.path.isfile(args.csv):
+ fh = open(args.csv, "w")
+ header = "filename1, filename2, byte_offset, byte1, " \
+ "bits1, byte2, bits2, item_msg, value_msg"
+ fh.write(header + os.linesep)
+ else:
+ fh = open(args.csv, "a")
+ fh.write(csvline + os.linesep)
+ fh.close()
+
+
+def compareFiles(args):
+ f1 = open(args.file1, "rb")
+ f1.seek(args.offset)
+ f2 = open(args.file2, "rb")
+ f2.seek(args.offset)
+
+ while True:
+ pos = f1.tell() - args.offset
+ c1 = f1.read(1)
+ c2 = f2.read(1)
+ if not (c1 and c2):
+ break
+ b1 = ord(c1)
+ b2 = ord(c2)
+ if b1 != b2:
+ printDiff(pos, b1, b2, args)
+
+ pos = f1.tell() - args.offset
+ print "bytes read: %02d" % pos
+ f1.close()
+ f2.close()
+
+
+def compareFilesDat(args):
+ f1 = open(args.file1, "r")
+ f1contents = f1.read()
+ f1.close()
+ f2 = open(args.file2, "r")
+ f2contents = f2.read()
+ f2.close()
+
+ f1strlist = f1contents.split()
+ f1intlist = map(int, f1strlist)
+ f2strlist = f2contents.split()
+ f2intlist = map(int, f2strlist)
+ f1bytes = bytearray(f1intlist)
+ f2bytes = bytearray(f2intlist)
+
+ length = len(f1intlist)
+ for i in range(length):
+ b1 = f1bytes[i]
+ b2 = f2bytes[i]
+ pos = i
+ if b1 != b2:
+ printDiff(pos, b1, b2, args)
+
+ pos = length
+ print "bytes read: %02d" % pos
+
+
+def convertFileToBin(args):
+ f1 = open(args.file1, "r")
+ f1contents = f1.read()
+ f1.close()
+ f1strlist = f1contents.split()
+ f1intlist = map(int, f1strlist)
+ f1bytes = bytearray(f1intlist)
+ f2 = open(args.file2, "wb")
+ f2.write(f1bytes)
+ f2.close
+
+
+def convertFileToDat(args):
+ f1 = open(args.file1, "rb")
+ f1contents = f1.read()
+ f1.close()
+ f2 = open(args.file2, "w")
+ for i in range(0, len(f1contents)):
+ f2.write(" %d " % (ord(f1contents[i]), ))
+ if i % 16 == 15:
+ f2.write("\r\n")
+ f2.close
+
+
+# main
+
+ap = argparse.ArgumentParser(description="byte-/bit- comparison of two files")
+ap.add_argument("file1", help="first (reference) file to parse")
+ap.add_argument("file2", help="second file to parse")
+
+mutexgrp1 = ap.add_mutually_exclusive_group()
+mutexgrp1.add_argument("-o", "--offset", default=0,
+ help="offset (hex) to start comparison")
+mutexgrp1.add_argument("-d", "--dat", action="store_true",
+ help="process input files from .DAT/.ADJ format "
+ "(from 'jujumao' oem programming software "
+ "for chinese radios)")
+mutexgrp1.add_argument("--convert2bin", action="store_true",
+ help="convert file1 from .dat/.adj to "
+ "binary image file2")
+mutexgrp1.add_argument("--convert2dat", action="store_true",
+ help="convert file1 from bin to .dat/.adj file2")
+
+ap.add_argument("-w", "--watch", action="store_true",
+ help="'watch' changes. runs in a loop")
+
+csvgrp = ap.add_argument_group("csv output")
+csvgrp.add_argument("-c", "--csv",
+ help="file to append csv results. format: filename1, "
+ "filename2, byte_offset, byte1, bits1, byte2, "
+ "bits2, item_msg, value_msg")
+csvgrp.add_argument("-s", "--setting",
+ help="user-meaningful field indicating setting/item "
+ "modified, e.g. 'beep' or 'txtone'")
+csvgrp.add_argument("-v", "--value",
+ help="user-meaningful field indicating values "
+ "changed, e.g. 'true->false' or '110.9->100.0'")
+
+args = ap.parse_args()
+if args.offset:
+ args.offset = int(args.offset, 16)
+
+print "f1:", args.file1, " f2:", args.file2
+if args.setting or args.value:
+ print "setting:", args.setting, "- value:", args.value
+
+while True:
+ if (args.dat):
+ compareFilesDat(args)
+ elif (args.convert2bin):
+ convertFileToBin(args)
+ elif (args.convert2dat):
+ convertFileToDat(args)
+ else:
+ compareFiles(args)
+ if not args.watch:
+ break
+ print "------"
+ time.sleep(delay)
diff --git a/tools/check_for_bug.sh b/tools/check_for_bug.sh
new file mode 100755
index 0000000..c8b042d
--- /dev/null
+++ b/tools/check_for_bug.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env sh
+
+# This checks a given revision to make sure that it has a bug number
+# in it, of the form "#123". It should be used in your pretxncommit
+# hook
+
+hg log -r $1 --template {desc} | egrep -q "\#[0-9]+"
diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh
new file mode 100755
index 0000000..5cf3a6f
--- /dev/null
+++ b/tools/checkpatch.sh
@@ -0,0 +1,72 @@
+#!/usr/bin/env bash
+#
+# CHIRP coding standards compliance script
+#
+# To add a test to this file, create a new check_foo() function
+# and then add it to the list of TESTS= below
+#
+
+TESTS="check_long_lines check_bug_number check_commit_message_line_length"
+
+function check_long_lines() {
+ local rev="$1"
+ local files="$2"
+
+ # For now, ignore this check on chirp/
+ files=$(echo $files | sed -r 's#\bchirp[^ ]*\b##')
+
+ if [ -z "$files" ]; then
+ return
+ fi
+
+ pep8 --select=E501 $files || \
+ error "Please use <80 columns in source files"
+}
+
+function check_bug_number() {
+ local rev="$1"
+ hg log -vr $rev | grep -qE '#[0-9]+' || \
+ error "A bug number is required like #123"
+}
+
+function _less_than_80() {
+ while true; do
+ read line
+ if [ -z "$line" ]; then
+ break
+ elif [ $(echo -n "$line" | wc -c) -ge 80 ]; then
+ return 1
+ fi
+ done
+}
+
+function check_commit_message_line_length() {
+ local rev="$1"
+ hg log -vr $rev | (_less_than_80) || \
+ error "Please keep commit message lines to <80 columns"
+}
+
+# --- END OF TEST FUNCTIONS ---
+
+function error() {
+ echo FAIL: $*
+ ERROR=1
+}
+
+function get_touched_files() {
+ local rev="$1"
+ hg status -n --change $rev | grep '\.py$'
+}
+
+rev=${1:-tip}
+files=$(get_touched_files $rev)
+
+for testname in $TESTS; do
+ eval "$testname $rev \"$files\""
+done
+
+if [ -z "$ERROR" ]; then
+ echo "Patch '${rev}' is OK"
+else
+ exit 1
+fi
diff --git a/tools/cpep8.blacklist b/tools/cpep8.blacklist
new file mode 100644
index 0000000..6a98e72
--- /dev/null
+++ b/tools/cpep8.blacklist
@@ -0,0 +1,3 @@
+# cpep8.blacklist: The list of files that do not meet PEP8 standards.
+# DO NOT ADD NEW FILES!! Instead, fix the code to be compliant.
+# Over time, this list should shrink and (eventually) be eliminated.
diff --git a/tools/cpep8.exceptions b/tools/cpep8.exceptions
new file mode 100644
index 0000000..4efef30
--- /dev/null
+++ b/tools/cpep8.exceptions
@@ -0,0 +1,10 @@
+# This file contains a list of per-file exceptions to the pep8 style rules
+# Each line must contain the file name, a tab, and a comma-separated list
+# of style rules to ignore in that file. This mechanism should be used
+# sparingly and as a measure of last resort.
+./share/make_supported.py E402
+./tests/run_tests E402
+./tests/unit/test_memedit_edits.py E402
+./chirpw E402
+./chirp/memmap.py E731
+./chirp/util.py E731
diff --git a/tools/cpep8.manifest b/tools/cpep8.manifest
new file mode 100644
index 0000000..368c6d2
--- /dev/null
+++ b/tools/cpep8.manifest
@@ -0,0 +1,152 @@
+./chirp/__init__.py
+./chirp/bandplan.py
+./chirp/bandplan_au.py
+./chirp/bandplan_iaru_r1.py
+./chirp/bandplan_iaru_r2.py
+./chirp/bandplan_iaru_r3.py
+./chirp/bandplan_na.py
+./chirp/bitwise.py
+./chirp/bitwise_grammar.py
+./chirp/chirp_common.py
+./chirp/detect.py
+./chirp/directory.py
+./chirp/drivers/__init__.py
+./chirp/drivers/alinco.py
+./chirp/drivers/anytone.py
+./chirp/drivers/ap510.py
+./chirp/drivers/baofeng_uv3r.py
+./chirp/drivers/baofeng_wp970i.py
+./chirp/drivers/bjuv55.py
+./chirp/drivers/btech.py
+./chirp/drivers/ft1500m.py
+./chirp/drivers/ft1802.py
+./chirp/drivers/ft1d.py
+./chirp/drivers/ft2800.py
+./chirp/drivers/ft2900.py
+./chirp/drivers/ft4.py
+./chirp/drivers/ft50.py
+./chirp/drivers/ft60.py
+./chirp/drivers/ft7100.py
+./chirp/drivers/ft7800.py
+./chirp/drivers/ft817.py
+./chirp/drivers/ft818.py
+./chirp/drivers/ft857.py
+./chirp/drivers/ft90.py
+./chirp/drivers/ftm350.py
+./chirp/drivers/generic_csv.py
+./chirp/drivers/generic_tpe.py
+./chirp/drivers/h777.py
+./chirp/drivers/ic208.py
+./chirp/drivers/ic2100.py
+./chirp/drivers/ic2200.py
+./chirp/drivers/ic2720.py
+./chirp/drivers/ic2730.py
+./chirp/drivers/ic2820.py
+./chirp/drivers/ic9x.py
+./chirp/drivers/ic9x_icf.py
+./chirp/drivers/ic9x_icf_ll.py
+./chirp/drivers/ic9x_ll.py
+./chirp/drivers/icf.py
+./chirp/drivers/icomciv.py
+./chirp/drivers/icq7.py
+./chirp/drivers/ict70.py
+./chirp/drivers/ict7h.py
+./chirp/drivers/ict8.py
+./chirp/drivers/icw32.py
+./chirp/drivers/icx8x.py
+./chirp/drivers/icx8x_ll.py
+./chirp/drivers/id31.py
+./chirp/drivers/id51.py
+./chirp/drivers/id800.py
+./chirp/drivers/id880.py
+./chirp/drivers/idrp.py
+./chirp/drivers/kenwood_hmk.py
+./chirp/drivers/kenwood_itm.py
+./chirp/drivers/kenwood_live.py
+./chirp/drivers/kguv8d.py
+./chirp/drivers/kguv9dplus.py
+./chirp/drivers/kyd.py
+./chirp/drivers/leixen.py
+./chirp/drivers/puxing.py
+./chirp/drivers/radioddity_r2.py
+./chirp/drivers/rfinder.py
+./chirp/drivers/template.py
+./chirp/drivers/th350.py
+./chirp/drivers/th9800.py
+./chirp/drivers/th_uv3r.py
+./chirp/drivers/th_uv3r25.py
+./chirp/drivers/th_uv8000.py
+./chirp/drivers/th_uvf8d.py
+./chirp/drivers/thd72.py
+./chirp/drivers/thuv1f.py
+./chirp/drivers/tk8102.py
+./chirp/drivers/tk8180.py
+./chirp/drivers/tmv71.py
+./chirp/drivers/tmv71_ll.py
+./chirp/drivers/ts480.py
+./chirp/drivers/ts590.py
+./chirp/drivers/uv5r.py
+./chirp/drivers/uvb5.py
+./chirp/drivers/vx170.py
+./chirp/drivers/vx2.py
+./chirp/drivers/vx3.py
+./chirp/drivers/vx5.py
+./chirp/drivers/vx510.py
+./chirp/drivers/vx6.py
+./chirp/drivers/vx7.py
+./chirp/drivers/vx8.py
+./chirp/drivers/vxa700.py
+./chirp/drivers/wouxun.py
+./chirp/drivers/wouxun_common.py
+./chirp/drivers/yaesu_clone.py
+./chirp/elib_intl.py
+./chirp/errors.py
+./chirp/import_logic.py
+./chirp/logger.py
+./chirp/memmap.py
+./chirp/platform.py
+./chirp/pyPEG.py
+./chirp/radioreference.py
+./chirp/settings.py
+./chirp/ui/__init__.py
+./chirp/ui/bandplans.py
+./chirp/ui/bankedit.py
+./chirp/ui/clone.py
+./chirp/ui/cloneprog.py
+./chirp/ui/common.py
+./chirp/ui/config.py
+./chirp/ui/dstaredit.py
+./chirp/ui/editorset.py
+./chirp/ui/fips.py
+./chirp/ui/importdialog.py
+./chirp/ui/inputdialog.py
+./chirp/ui/mainapp.py
+./chirp/ui/memdetail.py
+./chirp/ui/memedit.py
+./chirp/ui/miscwidgets.py
+./chirp/ui/radiobrowser.py
+./chirp/ui/reporting.py
+./chirp/ui/settingsedit.py
+./chirp/ui/shiftdialog.py
+./chirp/util.py
+./chirpc
+./chirpw
+./locale/check_parameters.py
+./rpttool
+./setup.py
+./share/make_supported.py
+./tests/__init__.py
+./tests/run_tests
+./tests/unit/__init__.py
+./tests/unit/base.py
+./tests/unit/test_bitwise.py
+./tests/unit/test_chirp_common.py
+./tests/unit/test_import_logic.py
+./tests/unit/test_mappingmodel.py
+./tests/unit/test_memedit_edits.py
+./tests/unit/test_platform.py
+./tests/unit/test_settings.py
+./tests/unit/test_shiftdialog.py
+./tools/bitdiff.py
+./tools/cpep8.py
+./tools/img2thd72.py
diff --git a/tools/cpep8.py b/tools/cpep8.py
new file mode 100755
index 0000000..2bf55d0
--- /dev/null
+++ b/tools/cpep8.py
@@ -0,0 +1,137 @@
+#!/usr/bin/env python
+#
+# cpep8.py - Check Python source files for PEP8 compliance.
+#
+# Copyright 2015 Zachary T Welch <zach@mandolincreekfarm.com>
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import sys
+import logging
+import argparse
+import pep8
+
+parser = argparse.ArgumentParser()
+parser.add_argument("-a", "--all", action="store_true",
+ help="Check all files, ignoring blacklist")
+parser.add_argument("-d", "--dir", action="store", default=".",
+ help="Root directory of source tree")
+parser.add_argument("-s", "--stats", action="store_true",
+ help="Only show statistics")
+parser.add_argument("--strict", action="store_true",
+ help="Ignore listed exceptions")
+parser.add_argument("-S", "--scan", action="store_true",
+ help="Scan for additional files")
+parser.add_argument("-u", "--update", action="store_true",
+ help="Update manifest/blacklist files")
+parser.add_argument("-v", "--verbose", action="store_true",
+ help="Display list of checked files")
+parser.add_argument("files", metavar="file", nargs='*',
+ help="List of files to check (if none, check all)")
+args = parser.parse_args()
+
+
+def file_to_lines(name):
+ fh = file(name, "r")
+ lines = fh.read().split("\n")
+ lines.pop()
+ fh.close()
+ return lines
+
+
+scriptdir = os.path.dirname(sys.argv[0])
+manifest_filename = os.path.join(scriptdir, "cpep8.manifest")
+blacklist_filename = os.path.join(scriptdir, "cpep8.blacklist")
+exceptions_filename = os.path.join(scriptdir, "cpep8.exceptions")
+
+manifest = []
+if args.scan:
+ for root, dirs, files in os.walk(args.dir):
+ for f in files:
+ filename = os.path.join(root, f)
+ if f.endswith('.py'):
+ manifest.append(filename)
+ continue
+ with file(filename, "r") as fh:
+ shebang = fh.readline()
+ if shebang.startswith("#!/usr/bin/env python"):
+ manifest.append(filename)
+else:
+ manifest += file_to_lines(manifest_filename)
+
+
+# unless we are being --strict, load per-file style exceptions
+exceptions = {}
+if not args.strict:
+ exception_lines = file_to_lines(exceptions_filename)
+ exception_lists = [x.split('\t')
+ for x in exception_lines if not x.startswith('#')]
+ for filename, codes in exception_lists:
+ exceptions[filename] = codes
+
+
+def get_exceptions(f):
+ try:
+ ignore = exceptions[f]
+ except KeyError:
+ ignore = None
+ return ignore
+
+if args.update:
+ print "Starting update of %d files" % len(manifest)
+ bad = []
+ for f in manifest:
+ checker = pep8.StyleGuide(quiet=True, ignore=get_exceptions(f))
+ results = checker.check_files([f])
+ if results.total_errors:
+ bad.append(f)
+ print "%s: %s" % (results.total_errors and "FAIL" or "PASS", f)
+
+ with file(blacklist_filename, "w") as fh:
+ print >>fh, """\
+# cpep8.blacklist: The list of files that do not meet PEP8 standards.
+# DO NOT ADD NEW FILES!! Instead, fix the code to be compliant.
+# Over time, this list should shrink and (eventually) be eliminated."""
+ print >>fh, "\n".join(sorted(bad))
+
+ if args.scan:
+ with file(manifest_filename, "w") as fh:
+ print >>fh, "\n".join(sorted(manifest))
+ sys.exit(0)
+
+if args.files:
+ manifest = args.files
+
+# read the blacklisted source files
+blacklist = file_to_lines(blacklist_filename)
+
+check_list = []
+for f in manifest:
+ if args.all or f not in blacklist:
+ check_list.append(f)
+check_list = sorted(check_list)
+
+total_errors = 0
+for f in check_list:
+ if args.verbose:
+ print "Checking %s" % f
+
+ checker = pep8.Checker(f, quiet=args.stats, ignore=get_exceptions(f))
+ results = checker.check_all()
+ if args.stats:
+ checker.report.print_statistics()
+ total_errors += results
+
+sys.exit(total_errors and 1 or 0)
diff --git a/tools/icomsio.sh b/tools/icomsio.sh
new file mode 100755
index 0000000..f5f126d
--- /dev/null
+++ b/tools/icomsio.sh
@@ -0,0 +1,95 @@
+#!/usr/bin/env bash
+#
+# ICOM ID-RP* serial helper script
+#
+# Copyright 2009 Dan Smith <dsmith@danplanet.com>
+#
+# This script will scan the USB bus on this system and determine
+# the product ID of any attached ICOM repeater modules. It will
+# unload and then reload the FTDI serial driver with the proper
+# options to detect the device. After that, it will determine the
+# device name and link /dev/icom to that device for easy access.
+
+LINK="icom"
+VENDOR="0x0c26"
+DEVICE=$(lsusb -d ${VENDOR}: | cut -d ' ' -f 6 | cut -d : -f 2 | sed -r 's/\n/ /g')
+
+product_to_name() {
+ local prod=$1
+
+ if [ "$prod" = "0012" ]; then
+ echo "ID-RP2000V TX"
+ elif [ "$prod" = "0013" ]; then
+ echo "ID-RP2000V RX"
+ elif [ "$prod" = "0010" ]; then
+ echo "ID-RP4000V TX"
+ elif [ "$prod" = "0011" ]; then
+ echo "ID-RP4000V RX"
+ elif [ "$prod" = "000b" ]; then
+ echo "ID-RP2D"
+ elif [ "$prod" = "000c" ]; then
+ echo "ID-RP2V TX"
+ elif [ "$prod" = "000d" ]; then
+ echo "ID-RP2V RX"
+ else
+ echo "Unknown module (id=${prod})"
+ fi
+}
+
+if [ $(id -u) != 0 ]; then
+ echo "This script must be run as root"
+ exit 1
+fi
+
+if [ -z "$DEVICE" ]; then
+ echo "No devices found"
+ exit 1
+fi
+
+if echo $DEVICE | grep -q ' '; then
+ echo "Multiple devices found. Choose one:"
+ i=0
+ for dev in $DEVICE; do
+ name=$(product_to_name $dev)
+ echo " ${i}: ${name}"
+ i=$(($i + 1))
+ done
+
+ echo -n "> "
+ read num
+
+ array=($DEVICE)
+
+ DEVICE=${array[$num]}
+ if [ -z "$DEVICE" ]; then
+ exit
+ fi
+fi
+
+modprobe -r ftdi_sio || {
+ echo "Unable to unload ftdi_sio"
+ exit 1
+}
+
+modprobe ftdi_sio vendor=${VENDOR} product=0x${DEVICE} || {
+ echo "Failed to load ftdi_sio"
+ exit 1
+}
+
+sleep 0.5
+
+info=$(lsusb -d ${VENDOR}:0x${DEVICE})
+bus=$(echo $info | cut -d ' ' -f 2 | sed 's/^0*//')
+dev=$(echo $info | cut -d ' ' -f 4 | sed 's/^0*//')
+
+for usbserial in /sys/class/tty/ttyUSB*; do
+ driver=$(basename $(readlink -f ${usbserial}/device/driver))
+ device=$(basename $usbserial)
+ if [ "$driver" = "ftdi_sio" ]; then
+ name=$(product_to_name $DEVICE)
+ ln -sf /dev/${device} /dev/${LINK}
+ echo "Device $name is /dev/${device} -> /dev/${LINK}"
+ break
+ fi
+done
+
diff --git a/tools/img2thd72.py b/tools/img2thd72.py
new file mode 100644
index 0000000..407bdf7
--- /dev/null
+++ b/tools/img2thd72.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python
+# coding=utf-8
+# ex: set tabstop=4 expandtab shiftwidth=4 softtabstop=4:
+#
+# © Copyright Vernon Mauery <vernon@mauery.com>, 2010. All Rights Reserved
+#
+# This is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This sofware is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this software. If not, see <http://www.gnu.org/licenses/>.
+
+
+import sys
+import getopt
+from PIL import Image as im
+
+
+def die(msg):
+ print msg
+ sys.exit(1)
+
+
+def thd72bitmap(fname, invert):
+ img = im.open(ifname)
+ if img.size != (120, 48):
+ die("Image has wrong dimensions: must be 120x48")
+
+ colors = img.getcolors()
+ if len(colors) != 2:
+ die("Image must be 1 bits per pixel (black and white)")
+
+ if ('-i', '') in opts:
+ c, black = colors[0]
+ c, white = colors[1]
+ else:
+ c, white = colors[0]
+ c, black = colors[1]
+
+ colors = {black: 1, white: 0}
+ data = img.getdata()
+ buf = ''
+ for y in range(6):
+ for x in range(120):
+ b = 0
+ for i in range(8):
+ b |= colors[data[x + 120 * (y * 8 + i)]] << i
+ buf += chr(b)
+ return buf
+
+
+def display_thd72(buf):
+ dots = {0: '*', 1: ' '}
+ lines = []
+ for y in range(48):
+ line = ''
+ for x in range(120):
+ byte = y/8*120 + x
+ line += dots[(ord(buf[byte]) >> (y % 8)) & 0x01]
+ lines.append(line)
+ for l in lines:
+ print l
+
+
+def usage():
+ print "\nUsage: %s <-s|-g> [-i] [-d] " \
+ "<image-file> <thd72-nvram-file>" % sys.argv[0]
+ print "\nThis program will modify whatever nvram file provided or will"
+ print "create a new one if the file does not exist. After using this to"
+ print "modify the image, you can use that file to upload all or part of"
+ print "it to your radio"
+ print "\nOption explanations:"
+ print " -s Save as the startup image"
+ print " -g Save as the GPS logger image"
+ print " -i Invert colors (black for white)"
+ print " Depending on the file format the bits may be inverted."
+ print " If your bitmap file turns out to be inverted, use -i."
+ print " -d Display the bitmap as dots (for confirmation)"
+ print " Each black pixel is '*' and each white pixel is ' '"
+ print " This will print up to 120 dots wide, so beware your"
+ print " terminal size."
+ sys.exit(1)
+
+if __name__ == "__main__":
+ opts, args = getopt.getopt(sys.argv[1:], "idgs")
+ if len(args) != 2:
+ usage()
+ ifname = args[0]
+ ofname = args[1]
+ invert = ('-i', '') in opts
+ gps = ('-g', '') in opts
+ startup = ('-s', '') in opts
+ if (gps and startup) or not (gps or startup):
+ usage()
+ if gps:
+ imgpos = 0xe800
+ tagpos = 18
+ else:
+ imgpos = 0xe500
+ tagpos = 17
+
+ buf = thd72bitmap(ifname, invert)
+ imgfname = ifname + '\xff' * (48-len(ifname))
+ of = file(ofname, "rb+")
+ of.seek(tagpos)
+ of.write('\x01')
+ of.seek(imgpos)
+ of.write(buf)
+ of.write(imgfname)
+ of.seek(65536)
+ of.close()
+
+ if ('-d', '') in opts:
+ display_thd72(buf)
+
+ blocks = [0, ]
+ blocks.append(imgpos/256)
+ blocks.append(1+imgpos/256)
+ blocks.append(2+imgpos/256)
+ print "Modified block list:", blocks
diff --git a/tools/serialsniff.c b/tools/serialsniff.c
new file mode 100644
index 0000000..7a80ac4
--- /dev/null
+++ b/tools/serialsniff.c
@@ -0,0 +1,440 @@
+/*
+ *
+ * Copyright 2008 Dan Smith <dsmith@danplanet.com>
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ *
+ * Modifications made by:
+ * Stuart Blake Tener, N3GWG
+ * Email: <teners@bh90210.net>
+ * Mobile phone: +1 (310) 358-0202
+ *
+ * 02 MAR 2009 - Version 1.01
+ *
+ * Logic was changed to use "ptsname" instead of "ptsname_r"
+ * in pursuance of provisioning greater compatibility with other
+ * Unix variants and Open Standards Unix flavors which have not
+ * otherwise implemented the "ptsname_r" system call.
+ * Changes developed and tested under MacOS 10.5.6 (Leopard)
+ *
+ * Added "--quiescent" switch, which when used on the command
+ * line prevents the printing of "Timeout" and count notices
+ * on the console.
+ * Changes developed and tested under MacOS 10.5.6 (Leopard)
+ *
+ * Added program title and version tagline, printed when the
+ * software is first started.
+ *
+ * 03 MAR 2009 - Version 1.02
+ *
+ * Added "--digits" switch, which when used on the command
+ * line allows for setting the number of hex digits print per
+ * line.
+ *
+ * Added code to allow "-q" shorthand for "quiescent mode".
+ *
+ * Changes were made to add "#ifdef" statements so that only code
+ * appropriate to MacOS would be compiled if a "#define MACOS" is
+ * defined early within the source code.
+ *
+ * Cleaned up comments in the source for my new source code.
+ *
+ * Changes developed and tested under MacOS 10.5.6 (Leopard)
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <fcntl.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <string.h>
+#include <signal.h>
+#include <getopt.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <arpa/inet.h>
+
+#define STREQ(a,b) (strcmp(a,b) == 0)
+
+char *version = "1.02 (03 MAR 2009)";
+int quiescent = 0;
+int total_hex = 20;
+
+struct path {
+ int fd;
+ char path[1024];
+ char name[1024];
+ int rawlog_fd;
+};
+
+void hexdump(char *buf, int len, FILE *dest)
+{
+ /*
+ * In precedence to the modification of this procedure to support the
+ * variable size hexadecimal output, the total bytes output was fixed
+ * to be a length of 8.
+ *
+ * The amendment of this procedure to support the "total_hex" variable
+ * allows for the user to pass a command line argument instantiating a
+ * desired number of hexadecimal bytes (and their ASCII equivelent) to
+ * be displayed.
+ *
+ */
+
+ int i;
+ int j;
+
+ for (i = 0; i < len; i += total_hex) {
+ for (j = i; j < i + total_hex; j++) {
+ if ((j % 4) == 0)
+ fprintf(dest, " ");
+
+ if (j < len)
+ fprintf(dest, "%02x", buf[j] & 0xFF);
+ else
+ fprintf(dest, "--");
+ }
+
+ fprintf(dest, " ");
+
+ for (j = i; j < i + total_hex; j++) {
+ if ((j % 4) == 0)
+ fprintf(dest, " ");
+
+ if (j > len)
+ fprintf(dest, ".");
+ else if ((buf[j] > ' ') && (buf[j] < '~'))
+ fprintf(dest, "%c", buf[j]);
+ else
+ fprintf(dest, ".");
+ }
+
+ fprintf(dest, "\n");
+ }
+}
+
+int saferead(int fd, char *buf, int len)
+{
+ struct itimerval val;
+ int ret;
+ int count = 0;
+
+ memset(&val, 0, sizeof(val));
+ val.it_value.tv_usec = 50000;
+ setitimer(ITIMER_REAL, &val, NULL);
+
+ while (count < len) {
+ getitimer(ITIMER_REAL, &val);
+ if ((val.it_value.tv_sec == 0) &&
+ (val.it_value.tv_usec == 0)) {
+ if (!quiescent)
+ printf("Timeout\n");
+ break;
+ }
+
+ ret = read(fd, &(buf[count]), len - count);
+ if (ret > 0)
+ count += ret;
+ }
+
+ return count;
+}
+
+void proxy(struct path *pathA, struct path *pathB)
+{
+ fd_set rfds;
+ int ret;
+ struct timeval tv;
+
+ while (1) {
+ int count = 0;
+ int ret;
+ char buf[4096];
+
+ FD_ZERO(&rfds);
+
+ FD_SET(pathA->fd, &rfds);
+ FD_SET(pathB->fd, &rfds);
+
+ ret = select(30, &rfds, NULL, NULL, NULL);
+ if (ret == -1) {
+ perror("select");
+ break;
+ }
+
+ if (FD_ISSET(pathA->fd, &rfds)) {
+ count = saferead(pathA->fd, buf, sizeof(buf));
+ if (count < 0)
+ break;
+
+ ret = write(pathB->fd, buf, count);
+ if (ret != count)
+ printf("Failed to write %i (%i)\n", count, ret);
+ if (!quiescent)
+ printf("%s %i:\n", pathA->name, count);
+ hexdump(buf, count, stdout);
+
+ if (pathA->rawlog_fd >= 0) {
+ ret = write(pathA->rawlog_fd, buf, count);
+ if (ret != count)
+ printf("Failed to write %i to %s log",
+ count,
+ pathA->name);
+ }
+
+ }
+
+ if (FD_ISSET(pathB->fd, &rfds)) {
+ count = saferead(pathB->fd, buf, sizeof(buf));
+ if (count < 0)
+ break;
+
+ ret = write(pathA->fd, buf, count);
+ if (ret != count)
+ printf("Failed to write %i (%i)\n", count, ret);
+ if (!quiescent)
+ printf("%s %i:\n", pathB->name, count);
+ hexdump(buf, count, stdout);
+
+ if (pathB->rawlog_fd >= 0) {
+ ret = write(pathB->rawlog_fd, buf, count);
+ if (ret != count)
+ printf("Failed to write %i to %s log",
+ count,
+ pathB->name);
+ }
+ }
+ }
+}
+
+static bool open_pty(struct path *path)
+{
+#ifdef MACOS
+ char *ptsname_path;
+#endif
+
+ path->fd = posix_openpt(O_RDWR);
+ if (path->fd < 0) {
+ perror("posix_openpt");
+ return false;
+ }
+
+ grantpt(path->fd);
+ unlockpt(path->fd);
+
+#ifdef MACOS
+ ptsname_path = ptsname(path->fd);
+ strncpy(path->path,ptsname_path,sizeof(path->path) - 1);
+#else
+ ptsname_r(path->fd, path->path, sizeof(path->path));
+#endif
+
+ fprintf(stderr, "%s\n", path->path);
+
+ return true;
+}
+
+static bool open_serial(const char *serpath, struct path *path)
+{
+ path->fd = open(serpath, O_RDWR);
+ if (path->fd < 0)
+ perror(serpath);
+
+ strncpy(path->path, serpath, sizeof(path->path));
+
+ return path->fd >= 0;
+}
+
+static bool open_socket(const char *foo, struct path *path)
+{
+ int lfd;
+ struct sockaddr_in srv;
+ struct sockaddr_in cli;
+ unsigned int cli_len = sizeof(cli);
+ int optval = 1;
+
+ lfd = socket(AF_INET, SOCK_STREAM, 0);
+ if (lfd < 0) {
+ perror("socket");
+ return false;
+ }
+
+ srv.sin_family = AF_INET;
+ srv.sin_port = htons(2000);
+ srv.sin_addr.s_addr = INADDR_ANY;
+
+ setsockopt(lfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
+
+ if (bind(lfd, (struct sockaddr *)&srv, sizeof(srv)) < 0) {
+ perror("bind");
+ return false;
+ }
+
+ if (listen(lfd, 1) < 0) {
+ perror("listen");
+ return false;
+ }
+
+ printf("Waiting...\n");
+
+ path->fd = accept(lfd, (struct sockaddr *)&cli, &cli_len);
+ if (path->fd < 0) {
+ perror("accept");
+ return false;
+ }
+
+ printf("Accepted socket client\n");
+
+ strcpy(path->path, "SOCKET");
+
+ return true;
+}
+
+static bool open_path(const char *opt, struct path *path)
+{
+ if (STREQ(opt, "pty"))
+ return open_pty(path);
+ else if (STREQ(opt, "listen"))
+ return open_socket(opt, path);
+ else
+ return open_serial(opt, path);
+}
+
+static bool open_log(const char *filename, struct path *path)
+{
+ path->rawlog_fd = open(filename, O_WRONLY | O_CREAT, 0644);
+ if (path->rawlog_fd < 0)
+ perror(filename);
+
+ return path->rawlog_fd >= 0;
+}
+
+static void usage()
+{
+ printf("Usage:\n"
+ "serialsniff [OPTIONS]\n"
+ "Where OPTIONS are:\n"
+ "\n"
+ " -A,--pathA=DEV Path to device A (or 'pty')\n"
+ " -B,--pathB=DEV Path to device B (or 'pty')\n"
+ " --logA=FILE Log pathA (raw) to FILE\n"
+ " --logB=FILE Log pathB (raw) to FILE\n"
+ " --nameA=NAME Set pathA name to NAME\n"
+ " --nameB=NAME Set pathB name to NAME\n"
+ " --q,-q,--quiescent Run in quiescent mode\n"
+ " --d,-d,--digits Number of hex digits to print in one line\n\n"
+ " --d=nn or -d nn or --digits nn\n"
+ "\n"
+ );
+}
+
+int main(int argc, char **argv)
+{
+
+ struct sigaction sa;
+
+ struct path pathA;
+ struct path pathB;
+
+ int c;
+
+ strcpy(pathA.name, "A");
+ strcpy(pathB.name, "B");
+ pathA.fd = pathA.rawlog_fd = -1;
+ pathB.fd = pathB.rawlog_fd = -1;
+
+ printf("\nserialsniff - Version %s\n\n",version);
+
+ while (1) {
+ int optind;
+ static struct option lopts[] = {
+ {"pathA", 1, 0, 'A'},
+ {"pathB", 1, 0, 'B'},
+ {"logA", 1, 0, 1 },
+ {"logB", 1, 0, 2 },
+ {"nameA", 1, 0, 3 },
+ {"nameB", 1, 0, 4 },
+ {"quiescent", 0, 0, 'q' },
+ {"digits", 1, 0, 'd'},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long(argc, argv, "A:B:d:l:q",
+ lopts, &optind);
+ if (c == -1)
+ break;
+
+ switch (c) {
+
+ case 'A':
+ if (!open_path(optarg, &pathA))
+ return 1;
+ break;
+
+ case 'B':
+ if (!open_path(optarg, &pathB))
+ return 2;
+ break;
+
+ case 1:
+ if (!open_log(optarg, &pathA))
+ return 3;
+ break;
+
+ case 2:
+ if (!open_log(optarg, &pathB))
+ return 4;
+ break;
+
+ case 3:
+ strncpy(pathA.name, optarg, sizeof(pathA.name));
+ break;
+
+ case 4:
+ strncpy(pathB.name, optarg, sizeof(pathB.name));
+ break;
+
+ case 'q':
+ quiescent = 1;
+ break;
+
+ case 'd':
+ total_hex=atoi(optarg);
+ break;
+
+ case '?':
+ return 3;
+ }
+ }
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = SIG_IGN;
+ sigaction(SIGALRM, &sa, NULL);
+
+ if ((pathA.fd < 0) || (pathB.fd < 0)) {
+ usage();
+ return -1;
+ }
+
+ proxy(&pathA, &pathB);
+
+ return 0;
+}
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..32f367e
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,61 @@
+[tox]
+envlist = unit,driver,style,py3clean,py3unit,py3driver
+skipsdist = True
+
+[testenv]
+basepython = python2.7
+sitepackages = True
+passenv = HOME
+whitelist_externals = bash
+deps = future
+
+[testenv:unit]
+deps =
+ pytest
+ mox
+ mock
+ future
+ pytest-xdist
+commands =
+ pytest --disable-warnings -v tests/unit {posargs}
+ python ./share/make_supported.py /dev/null
+
+[testenv:driver]
+deps =
+ future
+ pytest
+ pytest-xdist
+commands =
+ pytest --disable-warnings -v tests/test_drivers.py {posargs}
+
+[testenv:style]
+deps =
+ pep8==1.6.2
+ future
+commands =
+ python ./tools/cpep8.py
+
+[textenv:py3clean]
+commands =
+ py3clean chirp tests
+
+[testenv:py3unit]
+basepython = python3
+sitepackages = False
+setenv =
+ PYTHONPATH=../..
+deps =
+ -rrequirements.txt
+ -rtest-requirements.txt
+commands =
+ pytest --disable-warnings -v tests/unit {posargs}
+
+[testenv:py3driver]
+basepython = python3
+sitepackages = False
+setenv =
+ PYTHONPATH=../..
+ CHIRP_DEBUG=y
+deps = {[testenv:py3unit]deps}
+commands =
+ pytest --disable-warnings -v tests/test_drivers.py {posargs}