Skip to content

Commit 4160df3

Browse files
committed
Release 1.0
1 parent 41955ef commit 4160df3

File tree

13 files changed

+122
-59
lines changed

13 files changed

+122
-59
lines changed

Release_Notes.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
pyKeyer - by AA2IL
2+
----------------------
3+
4+
A CW contest keyer and logger in written Python.
5+
Also can be used as a sending and receiving CW trainer.
6+
7+
This app is written in python 3. The python script pyKeyer.py can be run under linux or windoz 10/11. You will also need the libraries in github.com/aa2il/libs and to installed the python modules listed in "requirements.txt".
8+
9+
Stand-alone execuatables for linux and windoz 10/11 have been made using pyinstaller. Complete source code and build files are available at https://github.com/aa2il/wclock .
10+
11+
Please email constructive comments/suggestions to aa2il AT arrl DOT net.
12+
13+
Windows Installer: pyKeyer_setup.exe
14+
15+
After installation, double click the desktop shortcut or open a command prompt (cmd.exe) and execute "C:\Program Files (x86)\AA2IL\pyKeyer.exe".
16+
17+
Known issues:
18+
19+
- Rig control is not yet available under windoz. (All capabilities are avaiable under linux.)
20+
21+
------------------------------------------------------------------------------
22+
23+
Revision history:
24+
25+
Version 1.0 - Jan. 2023
26+
27+
This is the first version-controlled release.

cwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def enable_boxes(self,gui):
220220
gui.name_lab.grid(columnspan=cspan,column=col)
221221
gui.name.grid(column=col,columnspan=cspan)
222222
col+=cspan
223-
cspan=1
223+
cspan=2
224224
gui.exch_lab.grid(columnspan=cspan,column=col)
225225
gui.exch.grid(column=col,columnspan=cspan)
226226

dist/pyKeyer.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "pyKeyer"
5-
#define MyAppVersion "1..0.0"
5+
#define MyAppVersion "1..0"
66
#define MyAppPublisher "AA2IL"
77
#define MyAppURL "https://github.com/aa2il/pyKeyer"
88
#define MyAppExeName "pyKeyer.exe"

gui.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
from utilities import cut_numbers,freq2band
7070
import platform
7171
import pyautogui
72+
from utilities import find_resource_file
7273

7374
############################################################################################
7475

@@ -118,7 +119,8 @@ def __init__(self,P):
118119
self.splash.overrideredirect(1)
119120
self.splash.geometry('+500+500')
120121

121-
pic = tk.PhotoImage(file='keyer_splash.png')
122+
fname=find_resource_file('keyer_splash.png')
123+
pic = tk.PhotoImage(file=fname)
122124
lab = tk.Label(self.splash, bg='white', image=pic)
123125
lab.pack()
124126
self.root.withdraw()
@@ -175,7 +177,7 @@ def construct_gui(self):
175177
# Open simple log file & read its contents
176178
# It probably time to jetison this & just use the adif file
177179
MY_CALL = P.SETTINGS['MY_CALL']
178-
fname = P.DATA_DIR+MY_CALL.replace('/','_')+".LOG"
180+
fname = P.WORK_DIR+MY_CALL.replace('/','_')+".LOG"
179181
self.log_book = []
180182
print('Opening log file',fname,'...')
181183
if not os.path.exists(fname):
@@ -208,7 +210,7 @@ def construct_gui(self):
208210

209211
# Read adif log also
210212
if P.LOG_FILE==None:
211-
P.LOG_FILE = P.DATA_DIR+MY_CALL.replace('/','_')+".adif"
213+
P.LOG_FILE = P.WORK_DIR+MY_CALL.replace('/','_')+".adif"
212214
if P.USE_ADIF_HISTORY:
213215
print('fname_adif=',P.LOG_FILE)
214216
qsos = parse_adif(P.LOG_FILE,upper_case=True,verbosity=0)
@@ -229,7 +231,7 @@ def construct_gui(self):
229231
print("GUI: ADIF file name=", self.fp_adif)
230232

231233
# Also save all sent text to a file
232-
self.fp_txt = open(P.DATA_DIR+MY_CALL.replace('/','_')+".TXT","a+")
234+
self.fp_txt = open(P.WORK_DIR+MY_CALL.replace('/','_')+".TXT","a+")
233235

234236
# Create pop-up window for Settings and Paddle Practice - Need these before we can create the menu
235237
self.SettingsWin = SETTINGS_GUI(self.root,self.P)
@@ -1424,7 +1426,7 @@ def SaveState(self):
14241426
'freqs' : frqs,
14251427
'fields' : flds }
14261428
print('STATE=',STATE)
1427-
with open('state.json', "w") as outfile:
1429+
with open(self.P.WORK_DIR+'state.json', "w") as outfile:
14281430
json.dump(STATE, outfile)
14291431
if False:
14301432
with open('keyer.log', "a") as outfile2:
@@ -1448,7 +1450,7 @@ def ClearState(self):
14481450
# Restore program state
14491451
def RestoreState(self):
14501452
try:
1451-
with open('state.json') as json_data_file:
1453+
with open(self.P.WORK_DIR+'state.json') as json_data_file:
14521454
STATE = json.load(json_data_file)
14531455
print('STATE=',STATE)
14541456
now = datetime.utcnow().replace(tzinfo=UTC)

paddling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(self,root,P):
9292

9393
# Read Book
9494
self.Book = read_text_file('Book.txt',KEEP_BLANKS=False)
95-
95+
9696
# Form list of calls - just use what we loaded from the master list
9797
self.calls = P.calls
9898
self.Ncalls = len(self.calls)

params.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def __init__(self):
108108
help='Sidetone Osc')
109109
arg_proc.add_argument('-split', action='store_true',
110110
help='Split Text Window')
111-
arg_proc.add_argument('-nohints', action='store_true',
112-
help='No hints')
111+
arg_proc.add_argument('-hints', action='store_true',
112+
help='Show hints')
113113
arg_proc.add_argument('-capture', action='store_true',
114114
help='Record Rig Audio')
115115
arg_proc.add_argument('-force', action='store_true',
@@ -183,7 +183,7 @@ def __init__(self):
183183
self.AUTOFILL = args.autofill
184184
self.PRACTICE_MODE = args.practice or args.rig[0]=="NONE"
185185
self.ADJUST_SPEED = args.adjust and args.practice
186-
self.NO_HINTS = args.nohints
186+
self.NO_HINTS = not args.hints
187187
self.CA_ONLY = args.ca_only
188188
self.WPM = args.wpm
189189
self.INIT_MODE = args.mode
@@ -262,7 +262,7 @@ def __init__(self):
262262
elif args.skcc:
263263
self.contest_name='SKCC'
264264
MAX_AGE_HOURS=2
265-
self.SHOW_TEXT_BOX2=True
265+
#self.SHOW_TEXT_BOX2=True
266266
elif args.calls:
267267
self.contest_name='RANDOM CALLS'
268268
MAX_AGE_HOURS=2
@@ -315,18 +315,18 @@ def __init__(self):
315315
elif args.sat:
316316
self.contest_name='SATELLITES'
317317
MAX_AGE_HOURS=9999
318-
self.SHOW_TEXT_BOX2=True
318+
#self.SHOW_TEXT_BOX2=True
319319
elif args.ragchew:
320320
self.contest_name='Ragchew'
321321
MAX_AGE_HOURS=9999
322-
self.SHOW_TEXT_BOX2=True
322+
#self.SHOW_TEXT_BOX2=True
323323
elif args.dx:
324324
self.contest_name='DX-QSO'
325-
self.SHOW_TEXT_BOX2=True
325+
#self.SHOW_TEXT_BOX2=True
326326
MAX_AGE_HOURS=9999
327327
else:
328328
self.contest_name='Default'
329-
self.SHOW_TEXT_BOX2=True
329+
#self.SHOW_TEXT_BOX2=True
330330
self.ROTOR_CONNECTION = args.rotor
331331
self.PORT9 = args.port9
332332
self.Immediate_TX = args.immediate
@@ -355,12 +355,20 @@ def __init__(self):
355355
self.HIST_DIR=os.path.expanduser('~/'+MY_CALL2+'/')
356356
if not os.path.isdir(self.HIST_DIR):
357357
fname=find_resource_file('master.csv')
358-
self.HIST_DIR=os.path.dirname(fname)
358+
self.HIST_DIR=os.path.dirname(fname)+'/'
359359
self.HISTORY = self.HIST_DIR+'master.csv'
360360

361-
self.DATA_DIR=os.path.expanduser('~/'+MY_CALL2+'/')
362-
if not os.path.isdir(self.DATA_DIR):
363-
self.DATA_DIR='./'
361+
self.WORK_DIR=os.path.expanduser('~/'+MY_CALL2+'/')
362+
if not os.path.isdir(self.WORK_DIR):
363+
HOME=os.path.expanduser('~/')
364+
print('HOME=',HOME)
365+
CURRENT=os.path.expanduser('./')
366+
print('CURRENT=',CURRENT)
367+
if CURRENT in HOME:
368+
self.WORK_DIR=CURRENT
369+
else:
370+
self.WORK_DIR=HOME
371+
print('WORK_DIR=',self.WORK_DIR)
364372

365373
#sys,exit(0)
366374

practice

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set CONTEST="cwt"
1919
###############################################################################
2020

2121
# Start keyer
22-
set OPTS="-prac -wpm 30 -adjust -sending $NANO -$CONTEST -nohints"
22+
set OPTS="-prac -wpm 30 -adjust -sending $NANO -$CONTEST"
2323
#echo OPTS=$OPTS
2424

2525
cd ~/Python/pyKeyer/dist

practice.bat

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@echo off
2+
rem ###########################################################################
3+
rem #
4+
rem # practice.bat - J.B.Attili - 2023
5+
rem #
6+
rem # Script showing how to start the keyer for practice.
7+
rem #
8+
rem ###########################################################################
9+
10+
set NANO=
11+
rem set NANO=-nano
12+
13+
rem Pick one
14+
set CONTEST=cwt
15+
rem set CONTEST=sst
16+
rem set CONTEST=mst
17+
rem set CONTEST=naqp
18+
19+
rem ###########################################################################
20+
21+
# Start keyer
22+
set OPTS=-prac -wpm 30 -adjust -sending %NANO% -%CONTEST%
23+
echo OPTS=%OPTS%
24+
25+
set CMD="c:\Program File (x86)\pyKeyer.exe %OPTS%"
26+
echo CMD=%CMD%
27+
%CMD%
28+
29+
30+

pyKeyer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
P.sock.set_freq(f1+30)
281281

282282
# Read satellite grids confirmed - this will be used to alert station in new grid
283-
FNAME = P.DATA_DIR+'states.xls'
283+
FNAME = P.HIST_DIR+'states.xls'
284284
P.grids=[]
285285
if os.path.isfile(FNAME):
286286
print('Reading Sat Grids - fname=',FNAME)

start

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ set NANO="-nano"
3838
#set NANO="-nano -sidetone"
3939

4040
set WPM=25
41-
set HINTS="-nohints"
41+
set HINTS=""
42+
#set HINTS="-hints"
4243

4344
set CA_ONLY=""
4445
#set CA_ONLY="-ca_only"
@@ -112,34 +113,34 @@ if( $CONTEST == "paddling" )then
112113
endif
113114
set WPM=20
114115
set CONTEST="ragchew"
115-
set HINTS="-nohints -adjust -sending -immediate"
116+
set HINTS="-adjust -sending -immediate"
116117
#exit
117118

118119
########################################################################
119120

120121
# Settings for NAQP contest
121122
else if( $CONTEST == "naqp" )then
122123
set WPM=30
123-
set HINTS="-nohints -adjust"
124-
#set HINTS="-nohints -adjust -autofill -scp"
124+
set HINTS="-adjust"
125+
#set HINTS="-adjust -autofill -scp"
125126

126127
# Settings for CW Ops mini tests
127128
else if( $CONTEST == "cwt" )then
128129
set WPM=30
129-
set HINTS="-nohints -adjust"
130+
set HINTS="-adjust"
130131
#set HINTS=""
131132

132133
# Settings for K1USN slow speed tests
133134
else if( $CONTEST == "sst" )then
134135
set WPM=20
135-
set HINTS="-nohints -adjust"
136-
#set HINTS="-nohints -adjust -autofill"
137-
#set HINTS="-use_log_hist -nohints -autofill -nrows 1"
136+
set HINTS="-adjust"
137+
#set HINTS="-adjust -autofill"
138+
#set HINTS="-use_log_hist -autofill -nrows 1"
138139

139140
# Settings for ICWC Medium speed tests
140141
else if( $CONTEST == "mst" )then
141142
set WPM=25
142-
set HINTS="-nohints -adjust"
143+
set HINTS="-adjust"
143144

144145
# Settings for NCCC CW Sprints
145146
else if( $CONTEST == "sprint" )then
@@ -165,8 +166,7 @@ else if( $CONTEST == "cqww" )then
165166
# Settings for field day
166167
else if( $CONTEST == "fd" )then
167168
set WPM=25
168-
#set HINTS="-nohints"
169-
set HINTS="-nohints -adjust"
169+
set HINTS="-adjust"
170170

171171
# Settings for IARU HF Champs
172172
else if( $CONTEST == "iaru" )then
@@ -176,7 +176,7 @@ else if( $CONTEST == "iaru" )then
176176
# Settings for CA QSO Party
177177
else if( $CONTEST == "cqp" )then
178178
set WPM=30
179-
set HINTS="-nohints -adjust $CA_ONLY"
179+
set HINTS="-adjust $CA_ONLY"
180180

181181
# Settings for ARRL & CQ VHF
182182
else if( $CONTEST == "vhf" || $CONTEST == "cqvhf" )then
@@ -215,7 +215,6 @@ else if( $CONTEST == "ss" )then
215215
set WPM=30
216216
set HINTS=""
217217
set HINTS="-adjust"
218-
#set HINTS="-nohints -adjust"
219218

220219
# Settings for SKCC practice
221220
else if( $CONTEST == "skcc" )then
@@ -230,8 +229,7 @@ else if( $CONTEST == "calls" )then
230229
# Settings for Default Quick, Ragchew or QSOs
231230
else if( $CONTEST == "default" || $CONTEST == "ragchew" || $CONTEST == "dx" )then
232231
set WPM=22
233-
set HINTS=""
234-
set HINTS="-use_log_hist -nohints -autofill -nrows 0 -lock -sending"
232+
set HINTS="-use_log_hist -autofill -nrows 0 -lock -sending"
235233

236234
# Settings for various state QPs
237235
else if( $CONTEST == "state" )then

0 commit comments

Comments
 (0)