MorseKOB / PyKOB

Python implementation of a library for Morse and MorseKOB functionality
https://sites.google.com/site/morsekob/morsekob40
MIT License
4 stars 2 forks source link

Pwd 250 guard optional library inclusion and use #251

Closed pwdirks closed 3 years ago

pwdirks commented 3 years ago

Updated references to Tkinter to be under guard; changed Configure.py to also disable -G option if no GUI support is available. Changed pykob/preferencesWindow.py to not offer serial configuration if pySerial is not installed, and stub out any attempt to create a GUI window if Tkinter is not available.

No attempt to conditionalize Tkinter use in MKOB and its related source files (kobactions.py, kobwindow.py etc.)

AESilky commented 3 years ago

No need to conditionalize the use of tkinter in MKOB and it's files. MKOB is a GUI app and therefore requires tkinter. Note that MKOB and its support files used to be in a MKOB subdirectory, making it obvious that they were all part of the MKOB app. However, that made it very difficult to develop and test when changes needed to be made in the 'pykob' module files. We pulled all of MKOB up out of the subdirectory so that 'pykob' was a subdirectory. That allows changes in those module files to be picked up without having to publish the module.

The 'pykob' module files are not graphical and can be used by both MKOB and command line apps.

A convention that Les picked and I've stuck with is that application files (meant to be run) start with a capitol letter while support/module files start with a lowercase letter. In addition, the MKOB files start with 'kob' (in addition to the main MKOB.pyw).

pwdirks commented 3 years ago

On Jan 21, 2021, at 11:03 PM, Ed Silky notifications@github.com wrote:

No need to conditionalize the use of tkinter in MKOB and it's files. MKOB is a GUI app and therefore requires tkinter. Note that MKOB and its support files used to be in a MKOB subdirectory, making it obvious that they were all part of the MKOB app. However, that made it very difficult to develop and test when changes needed to be made in the 'pykob' module files. We pulled all of MKOB up out of the subdirectory so that 'pykob' was a subdirectory. That allows changes in those module files to be picked up without having to publish the module.

Yes - I noticed that organization and I think it works well - a bunch of top-level programs in the top-level directory sharing a single “pekob” subdirectory for the common core functionality.

And, yes, I figured the same - MKOB is a GUI program; no point trying to run it w/o Tkinter installed.

The 'pykob' module files are not graphical and can be used by both MKOB and command line apps.

Right, so I concentrated on making sure anything in pykob (and, for good measure, the Configure program itself) can work without Tkinter installed. A convention that Les picked and I've stuck with is that application files (meant to be run) start with a capitol letter while support/module files start with a lowercase letter. In addition, the MKOB files start with 'kob' (in addition to the main MKOB.pyw).

I noticed that and it works for me. The pieces of MKOB also all seem to start with “kob...” Which is helpful as well. I think all these conventions work well. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MorseKOB/PyKOB/pull/251#issuecomment-765182614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALTAYK4BBYHSNPFR4ZUN4NTS3EPNPANCNFSM4WNSSDNA.