Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm watching the Giants game right now, but as I said, I just cut and pasted a url that didn't work a moment before. This is really mysterious. And annoying.
On the whole, this was possibly the worst day to release a version for testing. We'll see, maybe tomorrow will work like normal again.
On the whole, this was possibly the worst day to release a version for testing. We'll see, maybe tomorrow will work like normal again.
Just so you don't get *too* down, the audio part of the script works fantastically... which I really appreciate, so thanks for that, it'll be nice not to have to figure out whether the Cubs are at home or away before I try to listen to a game.
Sorry to top post but it's easier to read for this post.
I understand that the listings have all the information we need. As a newbie Python programmer, I'm still having trouble wrapping my head around all the dictionary syntax.
Here's what I started on.
Instead of defining the gameid at dct['video'][url['speed']] in the listings, I'm going to expand this to include all items in url['url'].
So accessing the gameid will now be:
dct['video'][url['speed']][id]
and so on for the other elements which won't be trimmed. Then I think gameid should become gameid[] which will be a url entry from dct['video'][url['speed']] and all it's subkeys and values. Assuming I can figure out how to do this.
Like I said, if you have a better way, please let me know. While I have experience with many other scripting languages, this dictionary concept and syntax is very powerful and very confusing. Online documentation is very sparse and terse about it all and *every* Python book at the library is checked out. That's gotta say something about the complexity of the language....
Quote:
Originally Posted by jkr
use_default_colors() isn't strictly necessary, but it makes it look a lot nicer, it can have transparent terminals, etc. I know it's a relatively new feature in the python curses implementation. If you're getting that error, what version are you using?
daftcat -- GameStream can have access to everything in the JSP file. Here's a sample game from today's schedule. But there's a lot of information. That's why we have the trimList step -- get the parts that are helpful. Of course, more can be added at that stage (as with audio), it will still be trimmer.
If you think it's just a timing issue, I can use mlbgameid to fetch the url and my mlbplay to play it. I'll test that on several games. If it's a timing issue, we can try poll() instead of wait(). I'll run some tests and let you know.
(I'm so glad I wrote that mlbgameid script. It's turning out to be a powerful test tool for the network code.)
There's two pages worth of complaints on the Mosaic Forum about problems with live games. Now I don't feel quite so bad.
I think I'll upgrade my Mosaic client and see how it does it. I hope we get this figured out before my Trial license on HTTP Analyzer runs out because the other tools I've tried are not nearly as useful.
jkr
Mind if I add a x_display option to the config file? I know I may be the only weirdo who launches this remotely and needs to set the DISPLAY variable to :0.0, but it's kind of annoying when I finally snag a stream and realize that DISPLAY wasn't set.
If it's okay with you, put these lines wherever you think is most appropriate:
Code:
if cfg['x_display']:
os.environ['DISPLAY'] = cfg['x_display']
Test it for me with your setup to make sure it doesn't cause problems for people who run it locally. Default x_display to None to make it transparent to everyone else.
Also, we should probably make it a cfg override to disable the curses.use_default_colors() call:
Code:
if cfg['cursesbug'] is None:
curses.use_default_colors()
I just wanted to let you guys know that as of 11:20pm or so I can view all of the archived games. Maybe it was just a temporary problem on the server side?
I just wanted to let you guys know that as of 11:20pm or so I can view all of the archived games. Maybe it was just a temporary problem on the server side?
Thanks, I just checked again at around 10:30pm ADT (2:30am EDT) & the archived games are fine. When I couldn't get anything, I thought it was Mplayer crashing. I kept getting a message about some dll in /usr/something...win32codecs/... Well, Mplayer was crashing but it isn't now.... so whatever the problem was, it no longer exist.
Wonder if this daftcat is related to the very famous straycat who was topdog on some Usenet warez group around a decade ago? If so, I want his autograph.
I just wanted to let you guys know that as of 11:20pm or so I can view all of the archived games. Maybe it was just a temporary problem on the server side?
Great news!
Some games I'm still having trouble with but most I can snag. It looks like they just had a terrible night. Hopefully tomorrow will be better.
It looks like it's not just the Tigers who are still trying to find their stride. ;-) But that a was a very nice comeback they mounted tonight. Maybe there's hope for MLB.com too.
Thanks, I just checked again at around 10:30pm ADT (2:30am EDT) & the archived games are fine. When I couldn't get anything, I thought it was Mplayer crashing. I kept getting a message about some dll in /usr/something...win32codecs/... Well, Mplayer was crashing but it isn't now.... so whatever the problem was, it no longer exist.
Wonder if this daftcat is related to the very famous straycat who was topdog on some Usenet warez group around a decade ago? If so, I want his autograph.
Heh, no. But that's funny because straycat is another handle I go by.
Oh good! There's some day games tomorrow. I should take a real sick day tomorrow since today wasn't all that restful. It'll be nice to cozy up with the Angels and Rangers and some good herb tea.
and so on for the other elements which won't be trimmed. Then I think gameid should become gameid[] which will be a url entry from dct['video'][url['speed']] and all it's subkeys and values. Assuming I can figure out how to do this.
Like I said, if you have a better way, please let me know.
Okay, I see -- yeah, that sounds like it should work great. Just to make sure I understand: you want all of the following information in the dictionary that getListings() uses, in order to pass on to GameStream to make a more realistic url:
Right? Yeah -- this would be fine. So I take it that you're basically suggesting holding off the index call on ['id'] until the next step. So instead of
Code:
for url in elem['mlbtv']['urls']:
dct['video'][url['speed']] = url['url']['id']
you would have
Code:
for url in elem['mlbtv']['urls']:
dct['video'][url['speed']] = url['url']
Then in trimList, t, t['video']['800'] would be a dictionary, and you could call all of the above attributes.
I'm just saying, very slowly for my own early morning benefit, that yes, this would work absolutely fine.
EDIT: if you're having trouble getting it to do exactly what you want, write out explicitly what you'd like trimlist to look like, for a specific game, and I'd be happy to suggest how to get there.
daftcat The x_display config sounds like a good idea. I'll put it in somewhere, or, if you get a chance to play with it, you can also commit it.
As for curses.use_default_colors(), since it seemed to produce a _curses.error, I'll just put it inside of a try/except. That should handle python 2.4 and forward. I'll also put it inside of an
if hasattr(curses, 'use_default_colors')
That should catch most errors transparently.
EDIT: in fact, I just committed it.
quonset
If you get a chance, could you try this out: where it said
Code:
-
curses.use_default_colors()
(the code you commented out) could you try replacing that with
Code:
if hasattr(curses, 'use_default_colors'):
try:
curses.use_default_colors()
except _curses.error:
pass
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.