-
Notifications
You must be signed in to change notification settings - Fork 31
Plugin support #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Zoli, do you already work on it? This was my idea too exactly :). If you have any working part, could you share this with us? We should make a new branch here (eg: dev/plugins). |
commited the current state into https://github.com/zcsahok/tlf/tree/poc_plugin |
Great. Really good that you found time to start with it, The idea is flying around for quite some time.
|
Found the reason for my compile problem. From the python3.8 "Whats New": "To embed Python into an application, a new --embed option must be passed to python3-config --libs --embed to get -lpython3.8 (link the application to libpython). To support both 3.8 and older, try python3-config --libs --embed first and fallback to python3-config --libs (without --embed) if the previous command fails." Adding --embed helped. In the long run that part needs to be moved to the configure.ac file. |
Good to hear that you managed the compilation. I'm using stock 3.7 from Debian 10. |
That needs to be sorted out, but not for the actual proof of concept. I will try to look for some other program with embedded python. Maybe I find one which uses autoconf |
I've checked that repository, few remarks:
Now that's it after a quick review :). Edit: for the record: I'm using Python3.6 |
Ctrl-C was disabled on purpose. The "official" reason is to let The plain answer is that Python throws an exception upon Ctrl-C and then this should be always handled complicating our life. So it's better to disable it altogether as we can live without it. (I also normally used Ctrl-C to exit...) Re score window: I was using a plain contest and had the window. Don't know how can it get lost. Importing: I didn't check adding to builtin. I was quite happy that it works at all, so did no further research. IMO having to write |
Thanks for clarification, CTRL-C is clear now. Missing of score window needs more investigation. Could you share the used logcfg.dat? May be some config directive is missing... (I've set up the Importing: sure, that was just an idea. Btw @dl1jbe and also to you: here is a small patch which can helps to integrate the plugin: https://github.com/zcsahok/tlf/compare/poc_plugin...airween:poc_plugin_ha2os?expand=1 As you can see I added the |
Wrt leaving the program: I think we should leave only ALT+X and :EXit for it. There may be some people using ALT+Q or :QUit but they will get used to it.
@zcsahok: I would suggest to not use RULES=xyz to load a python script implicitly. How about having a normal rules file and using a CONFIG_SCRIPT=<path_to_python_script> or similar there? |
@dl1jbe: thanks, but no, It's good to see that patch is well - I think it needs a minimal modification to make it usable (as I wrote it needs to handle the More suggestions:
|
Two more little points:
|
* On 2021 17 Feb 05:27 -0600, ha5se wrote:
Two more little points:
- I would suggest to leave out the `py:` prefix and the `.py` suffix,
so that if later required, it would be possible to smoothly convert to
other language without having to adjust the rules files. The shee-bang
should suffice.
Just to be aware that there are some brain dead editors that rely on the
extension to select the correct parser/highlighter. I would say that it
should not matter to Tlf what language the plugin is written in so long
as the data returned is in the required format, e.g. KEY=value pairs,
parsed strings, etc. In that sense, the plugin suffix should be
immaterial to Tlf and is merely an aid to us humans and other
aforementioned brain dead tools.
73, Nate
…--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
|
Than try Alt+R - it works here.
+1 |
Thanks, it solved. But I still don't know why isn't there by default. Btw counting multis and scoring works as well. |
if we leave the prefix or suffix and there won't be any explicit mark for the plugin type, we cut off the opportunity of further expansion (we must to assume that every plugin written in Python), so imho any explicit mark will help (and need). Note: shebang works only if you run the script through a shell. Any embedded interpreter (Python, Lua) ignores it.
I think the |
The idea of the plugin is that we have a collection of optional methods that it can be implement per contest. The ones where the core Tlf functionality is fine one can simply leave out. Currently the most critical feature is the handling of multis, that's why it's in the focus. For RAEM of course the quite complex
|
Re: exit: as it's independent of the plugin story I'll prepare a PR for the master. How about removing Alt-Q but keeping :QUIt? So we gain a free key combination and for the command entry it makes no difference. (Alt-X is quite handy as the key are very close) |
Fine by me. If possible please add the other changes (ctrl-C, mode to static , ...) to the PR.
Right, and that is what I use always. |
Well, my suggestion above intended just to prepare for a possible future separate second (scoring) plugin. To elaborate, I think of something like
Admitting, I only see advantages for this. Just another opinion, of course... IMHO, during proof-of-concepts phase, brain storming can help much more to build final concept as well as to avoid some unnecessary coding efforts, than any other discussions during a later phase... |
I think this is a bit complicated. I believe in one contest - one plugin rule file. Instead of this, it would be better to implement the The another solution would be if the |
Created dev_plugin branch. It contains just plugin.c/h and minimal changes to main+readcalls, plus the automake machinery by @airween. The actual plugin points and functions we will figure out later. I'll keep my branch for prototyping and merge things into dev_plugin as needed. |
Covered by #347, closing issue. |
(just fyi, no action is needed)
I'm working on a proof of concept implementation of using contest-specific plugins. As a test I have defined the multi rules for MWC (https://memorial-ok1wc.cz/index.php?page=rules2l) that takes place each Monday from 1630 UT. For multiplier they use the last character of the worked call. The rationale behind this is likely to allow higher mult counts even if only a handful of DXCC entities participate.
Such plugins would allow Tlf to support practically any contest and would also be a solution for #235.
Here is the screenshot after today's contest, I still had some unworked mults on 80 and even more on 40.
As plugin technology I use Python as it is quite widespread and has a lot of features. The plugin script is implicitly selected by the contest rule config: for RULES=xdx the file
rules/xdx.py
is loaded if available.Currently the interface methods are:
bm_ismulti()
There are still a number of rough edges and some stuff are not too tlf-ish (i.e. bypassing
multis[]
), so work is in progress.The code for MWC:
The text was updated successfully, but these errors were encountered: