[mythtv-users] Error parsing config.xml?

John Pilkington J.Pilk at tesco.net
Sat May 12 07:26:11 UTC 2012


On 12/05/12 01:50, Raymond Wagner wrote:
> On 5/11/2012 15:18, John Pilkington wrote:
>> On 11/05/12 19:10, Bill Meek wrote:
>>> On 05/11/2012 11:57 AM, Michael T. Dean wrote:
>>> ...
>>>> Probably best would be to use a language designed for parsing text,...
>>>
>>> As an example (of using a tank to kill a mosquito)
>>> http://pastebin.ca/2147582 is
>>> what I wrote. Save it as xml2src. Replace . ~mythtv/.mythtv/mysql.txt
>>> with:
>>>
>>> for V in $(xml2src); do export $V; done
>>>
>>> Truth be told, I'm finding that I don't use most of my old SQL scripts
>>> and
>>> using python bindings and Services API are of more interest.
>>>
>>> But, this gives me time to learn then convert anything I actually use.
>>>
>>> Cue the part where someone who knows what they're doing writes the
>>> whole thing in one line.
>>>
>> Thanks, Bill - and Mike and Raymond. I take the point about using the
>> bindings, but the advice is along the lines of 'Can you please tell me
>> the way to XXX? Ooh, I wouldn't start from here' :-)
>
> Change your job to something like...
>
> mythcutprojectx.py %VERBOSEMODE% %JOBID%
>
> The bindings will automatically handle logging through the same
> mechanism as the internal code. All you have to do is pick up the jobid
> from the last argument. Pull the job from the database with...
>

... and what appears to be a complete translation of the original script 
follows :-)

Wow!  Thanks, Raymond, I shall study it with great interest.

In fact I don't think my original script did use mysql.txt at all; ISTR 
that that line was commented out as a reminder of where the magic words 
could be found.

Cheers!

John P



More information about the mythtv-users mailing list