[mythtv] Dynamic menus

Charles Iliya Krempeaux charles at reptile.ca
Tue Dec 2 00:46:01 UTC 2008


Hello,


On Mon, Dec 1, 2008 at 2:33 PM, Charles Iliya Krempeaux
<charles at reptile.ca> wrote:
>
> Hello,
>
> On Mon, Dec 1, 2008 at 2:24 PM, Andrei Tanas <andrei at tanas.ca> wrote:
>>
>> I'd like to propose a simple piece of functionality that allows to generate
>> dynamic menus.
>
> [..]
>
>>
>> The idea is simple: if the <action> tag inside the menu <button> defines a
>> MENU, but the parameter starts with the '`' character (same as bash shell
>> command substitution), rather than treating this as a path to another menu
>> file, we execute the external process, capture its standard output stream,
>> and use the result to load the menu.

Thinking about this a little more, I think alot of people are familiar
with using surrounding backticks in Shell Script, in PHP, and many
other places.

For example, in shell script we might have...

    for i in `cat BADFILES`
    do
        rm -f "$i"
    done

Or in PHP we might have...

    $str = `finger -l`;


However, that's not how the backtick is behaving here... which might
confuse some people.

I know you're using a single backtick, and not surrounding backticks,
but I think many developers will not only expect surrounding
backticks, but will expect it to work the same way as surrounding
backticks.

For example, consider this...

    <action>MENU `/home/mythtv/somemenuscript`</action>

I think alot of people would believe that this mean, take the output
from running the "/home/mythtv/somemenuscript" command, and that
output will be the path to use to the MENU action (and not the actual
XML data itself).

For example, they would probably think (based on their experience with
the backticks being used in other places) that
"`/home/mythtv/somemenuscript`" might return something like
"/the/path/to/the/menu.xml"... instead of the raw XML.

If you follow the conventions we currently have, what you are
proposing seems (to me) to fit more into the idea of piping.
Something like...

    <action>/home/mythtv/somemenuscript | MENU</action>

Although maybe that's not the best notation for it.  (I'm not going to
bother suggesting an alternative notation though.)

I think your idea is great!  But perhaps the notation should be tweaked.

--
Charles Iliya Krempeaux, B.Sc.
http://changelog.ca/


More information about the mythtv-dev mailing list