$INFO formatting
#1
I'm trying to format a label with square brackets only if a listitem has info.

<label>$INFO,ListItem.Label2, (wiki)</label>

e.g. [PG] if ListItem.Label2=PG

could someone show me the correct way. The above only displays the right ] no matter what and I don't want the brackets if ListItem is blank.

A link in the manual that explains it would also help. I must be searching the wrong term.

Thanks

Edit: http://www.xboxmediacenter.com/wiki/inde...el_Parsing

With this <label>$INFO[ListItem.Label2,[,]]</label>
When it's blank I get the right bracket. Otherwise it works good.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#2
Yeah - the parser doesn't know which ] to match, so just assumes the first one.

The best solution IMO is to add some sort of escaping (eg using \ or whatever) - obviously the \ character itself would need to be escaped as well.

The same will happen with comma's for instance.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Commas has a keyword $COMMA, but I think an escape character would be better.

I take a quick look

I went this route instead, it was easier Smile
Code:
[SIZE=2]m_prefix.Replace("$LBRACKET", "["); m_prefix.Replace("$RBRACKET", "]");
m_postfix.Replace("$LBRACKET", "["); m_postfix.Replace("$RBRACKET", "]");[/SIZE]
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#4
Works for me.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
$INFO formatting00