wallop icon indicating copy to clipboard operation
wallop copied to clipboard

Cannot configure images for channels with decimal points

Open computmaxer opened this issue 11 years ago • 7 comments

Perhaps I am just using the toml syntax wrong, but when I set the image for a channel with a decimal place, like 5.1, I get this:

Failed to match sequence (ALL_SPACE (KEY_GROUP / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 10 char 1.
`- Don't know what to do with "5.1 = \"abc" at line 10 char 1.

config:

[channel_logos]
5.1 = "abc.png"

computmaxer avatar Sep 23 '13 16:09 computmaxer

Ahh, its probably a bug in toml. That's kinda tricky. Try quoting the key "5.1" and see if that works.

maddox avatar Sep 23 '13 17:09 maddox

Hmm, nope. Same kind of error.

Failed to match sequence (ALL_SPACE (KEY_GROUP / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 10 char 1.
`- Don't know what to do with "\"5.1\" = \"a" at line 10 char 1.

That's too bad for toml. I may alter wallop a bit to read in channel image definitions from a different file type for my use, since all of my channels have decimal points at the moment.

computmaxer avatar Sep 23 '13 17:09 computmaxer

Sorry about this. This is very unfortunate. We can work on just using a new format inside the toml.

Feel free to submit a change.

On Sep 23, 2013, at 1:45 PM, Max Peterson [email protected] wrote:

Hmm, nope. Same kind of error.

Failed to match sequence (ALL_SPACE (KEY_GROUP / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 10 char 1. `- Don't know what to do with ""5.1" = "a" at line 10 char 1. That's too bad for toml. I may alter wallop a bit to read in channel image definitions from a different file type for my use, since all of my channels have decimal points at the moment.

— Reply to this email directly or view it on GitHub.

maddox avatar Sep 23 '13 23:09 maddox

Here is a potential fix: https://github.com/computmaxer/wallop/commit/940574a1c4bc15d552c174f5fdcbd0b8ffade045

I defined the channel logos like this:

5_1 = "abc.png"
8_1 = "cbs.png"
13_1 = "nbc.png"
17_1 = "fox.png"

and then simply used a string substitution before checking the config for the channel number.

I'm not in love with this solution but it is easy and it works. If you think it is okay I'll make a pull request!

computmaxer avatar Sep 24 '13 00:09 computmaxer

wow, gross, hahah. Sit on it for a while, at least you have it working for yourself. that's not very clear in my opinion. I'll see if i can come up with something.

maddox avatar Sep 24 '13 00:09 maddox

Yeah I definitely agree. I'll also try to think of other solutions. I tried starting each line with a letter, like channel_5.1 but it still chokes on the decimal point.

computmaxer avatar Sep 24 '13 00:09 computmaxer

Any real solution for this one yet? All of my channels have decimal points too.

JerseyDevil6 avatar Jan 20 '14 10:01 JerseyDevil6