View Single Post
Old 04-25-2022, 06:32 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
I too have been fretting about this.

One problem with that is the interplay between the contents of the columns box and metadata management. If you use a checkbox then can I also use the columns box?
The checkbox would disable the template field. As the column field would still be enabled, both could be used. I'm tempted to add a checkbox for both to make it clear what is being used at any point.
Quote:
What if I don't, making the columns box empty, which in the current code would prevent get_collections() from being called.
That's the easiest thing to fix. And I think that needs to be revisited. At the least, the variable used needs to be renamed.
Quote:
Is using the checkbox equivalent to having "something" in the columns box? It also raises the question "What does the template return?" Is it a list of columns or a list of items?
Yes, the check box says to use the template as well as the columns. The template result should be a comma separated list of collections names. That way, a template of "{#some_column}" is the same as just using "#some_column" as the collections column.
Quote:
Finally, how does one solve the problem of two users wanting different metadata management settings? That could be done with a checkbox and yet another template that returns the management setting desired for the connected device. I have been tempted to play with this, but as I don't need it I haven't taken the time.
That is unchanged from the current scenario. It has no effect on what collections are generated, just when or if they are applied. To be able to do anything else, I thing you would need to be able to store a configuration for each device. I looked at that when I rewrote the configuration dialog a few years ago, but the single configuration is to embedded in the USBMS driver to make it easy to do.
Quote:
The "special name" is safe because it can't conflict with a custom column. It could be made safer by using something like "%template" instead of "template".

But you know all the above.
Attached is a zip containing a) complete source files for books.py, driver.py, and kobotouch_config.py; and b) a patch file for the same changes.

The source files incorporate all your changes that have been checked in by Kovid.
Thanks. That reduces some thinking and gave me a good starting point.
davidfor is offline   Reply With Quote