-
Notifications
You must be signed in to change notification settings - Fork 64
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
User Sources #78
Comments
Great idea! |
Wonderful idea. |
Cool. Do you have any wishes for the format? Supporting a plain list of files (one file per line) is clear candidate. What I would reach for first is JSON, in a prototype I have one JSON object (dict) per line. JSON is good because it is typed, and we could use this to have it be entirely extensible (you could create leaves of any loaded plugin that whose leaves support a protocol for creating them from a dict from JSON). |
Yes JSON is nice.
Can you elaborate? |
Not yet, haven't gotten that far in the design. |
Alright. So it will index anything. Let's say I want to recursively index all png file from ~/Pictures/Screenshot at toplevel. We can do that by presenting all files (or file names) as json obj? |
Yes, which leaves are created depends entirely on the output of the script. If it outputs one JSON record (if that's the format) per png file, those files are all part of the user source. |
Json is easy to output from Python, and using external python scripts is not useless, but maybe there are other formats that are better. Big value in using an existing format with existing parser and typed values though. |
What about action? We still want to do something with it. For example opening those pngs with default image viewer? |
I imagine they would show up as files, so they are just like any other .png file in kupfer (so the same actions). It would be open for a plugin to implement a different leaf for them, but I don't think files should be represented in any other way than FileLeaf in kupfer. |
So to clarify, the design IMO would be that user sources is a way to insert collections of objects (Leaves in Kupfer's terms) with the help of text based programs, using any of the builtin or plugin defined Leaves that support creation from (for example) JSON. It's not intended that user sources defines new classes of leaves. |
Nice idea! Now we need:
|
I like JSON but unix commands can easily output a 'CSV' (or CSV like output). |
If the csv has named columns it should work well, then it's easy to map each row to a dictionary just like JSON; however then we don't have types. Majority will use strings anyway, but I don't want to distribute the lowest level of input parsing to the plugins, it should be central. |
I liked this repo is some kind of early stage of what you proposed here.
But, again would be hard create them from command lines. 🤔 |
A long time ago I found @spiritedflow kupfer-connectables plugin. For some reason a forgot them. LOL It works with YAMLs 💩: locale: en_EN.UTF-8
cacti_id: 1
icon_name: network-server
actions:
- ssh
- cacti
- ping And other for Actions: type: uri
name: Cacti charts
descr: View cacti charts for this host
icon_name: web-browser
uri: https://your-cacti-site/cacti/graph_view.php?action=tree&tree_id=6&leaf_id=%(cacti_id)d Once again, is a bit hard create this files from command lines output. |
And the Great Bedkowski created user_sources.py |
Allow users to extend the catalog by using shell scripts (or other programs) that produce textual output. In this way they act like indexers. A User source plugin will parse the output of each command into Leaves of the correct type.
The text was updated successfully, but these errors were encountered: