Quote:
I'll see about adding this in this week. I just heard from jkr and it sounds like we're getting close to another official release (perhaps next week.) I'll see if I can get this feature into svn before the weekend so others can test it before we release it. |
I'm just curious if you're still planning on putting starting pitchers and various other information inside of mlbviewer (by hitting "i" after selecting a game, for instance), or is that all going into mlbscores now? I'd personally rather have access to that info within mlbviewer, but of course will defer to the group.
Thanks, d |
Quote:
I'd rather iron out all the details of what kind of information I want to include and nail down the xml code in the mlbscores app first. It's possible mlbscores might make the next release but it may not. In mlbscores, the information screen will be there for 'In Progress' games, 'Final' games, and not yet played games each displaying different kinds of information. Once that code gets tested and people put their input into what they like and don't like on those screens, we could conceivably integrate all or part of mlbscores into mlbviewer. My development design plan is to make mlbscores modular and pluggable from the start. With lessons learned from mlbscores, we'll probably revise the way we do things in mlbviewer (backend stuff you'll likely never see) to make it easier to plug in parts or the whole of mlbscores. This would also set us up in the long run to easily accomodate any new features like perhaps gameday or standings without having to rewrite the infrastructure or do messy merges. A temporary feature (which folks might actually prefer) would be to ask for that information in the status line with the 'i' key. I'll look into that after I get top plays put in. I was just saying to jkr that my plate was looking empty after this weekend but I guess I got a couple new features to work on. :D |
Don't know what this means...
I haven't changed anything, but all of the sudden, i get this message after the days' schedule failed to load:
Traceback (most recent call last): File "mlbviewer.py", line 311, in <module> curses.wrapper(mainloop, mycfg.data) File "curses/wrapper.py", line 44, in wrapper File "mlbviewer.py", line 65, in mainloop available = mysched.getListings(cfg['speed'],cfg['blackout'],cfg['audio_follow']) File "/home/ben/Desktop/mlbviewer-0.1alpha5/MLBviewer/mlbtv.py", line 186, in getListings listings = self.trimList() File "/home/ben/Desktop/mlbviewer-0.1alpha5/MLBviewer/mlbtv.py", line 159, in trimList dct['event_time'] = datetime.time(hrs,mins) I don't know what that means. Help? |
Quote:
|
Quote:
However, looking at the code, I'm going to guess that it encountered a game time of 12:05 PM, tried to add 12 hours to that (because it's PM), and threw a ValueError saying it can't convert 24:05 to a datetime. If you see an error like: ValueError: hour must be in 0..23 at the bottom of your Traceback, on line 155 of "/home/ben/Desktop/mlbviewer-0.1alpha5/MLBviewer/mlbtv.py", change: Code:
hrs = int(hrs) Code:
hrs = int(hrs) % 12 Code:
svn co https://mlbviewer.svn.sourceforge.net/svnroot/mlbviewer/trunk mlbviewer The downside of this approach is you're getting a lot more new code which may have it's own problems. The upside is you're getting bug fixes and new features. Please paste the entire Traceback including the last line which says what kind of error was generated and I can confirm if this is the error you're seeing. |
Quote:
|
Quote:
I suddenly developed the same problem. When I went to bed last night, the script was working fine. This morning it was crashing. The fix was your suggestion. |
Quote:
'r' will refresh the listings. |
Quote:
|
Quote:
|
Quote:
Left/Right Navigate one day forward or back j Jump to a date p Toggle speed (does not change config file) r Refresh listings We get our information from a page like this: http://mlb.mlb.com/components/game/y...amesbydate.jsp So it's possible MLB gave us stale information too. In that case, there's nothing we can do. |
Top Plays and Game Recap support: Testers needed
I implemented Top Plays and Game Recap support (same screen) by highlighting a game and pressing 't'. This opens the Top Plays screen. Up and Down are as you expect them and Enter selects the highlight.
Here are a couple of things to note about Top Plays feature: A new configuration file option top_plays_player was added so you don't have to overkill on cache for a short clip. If you don't specify this option in your config file, it will default to your video_player option. I use a 4 mb cache for a normal game but that's way too much for a 20 second clip so I have the all the same options in my top_plays_player except I changed the cache to 1024. Certain features are disabled in the Top Plays view including any feature that would allow you to change days (Left, Right, Jump.) Basically, it doesn't make sense to navigate across days except by using the Listings view. Speed toggling and Gameday Audio also aren't supported in Top Plays screen. Basically, you'll get an error message saying, "That key is not supported in this screen..." if the feature is disabled for Top Plays screen. All Top Plays are 400K streams so the speed indicator will automatically change to 400K to visually remind you of this fact. It will change back to whatever value you use for games when you return to the listings view. If you don't have an MLB.com account, you can still use Top Plays feature. You still need to specify user= and pass= in the config file but you can leave the value blank. For MLB.TV subscribers, we don't login for Top Plays but we still do for games and audio. You can get this code from svn. I need people to test the heck out of it before I feel comfortable about making it part of the next official release. (Coming soon!) I tried to cover all the scenarios, including some weird cases, but no code is ever bug free (except maybe a hello world script.) Svn instructions are on the previous page. Please post your experiences here--good or bad. If you encounter any Tracebacks, please post the entire Traceback here. Cheers! daftcat |
Code:
$ python mlbviewer.py |
I got the same problem, different line numbers though. Just started doing this in the morning
|
TEMPORARY WORKAROUND FOR ValueError in simplejson
I get the same ValueError with ALL VERSIONS (not just the latest svn.) Since the error is coming from simplejson (the JSON parser library), it may be that MLB.com has a badly formed JSP for today's listings. I'm not sure which MLB.com pages or applications use this page, so I don't know if and when they'll fix today's jsp. Hopefully they will.
In the meantime, I've caught the ValueError exception and print a "There was a parser problem with listings page" error to the status line. The bad news is that until they fix this or until I can find where and how it's broken, today's listings will not be available. The good news is that every other day that has well-formed jsp will be available including yesterday's top plays. :D Please re-pull from svn to get this latest fix. Let me know if you encounter that error again with the newest svn. |
Quote:
|
I guess I'll get more testers of the latest code than I hoped for since the badly formed jsp (at least that's what I assume it is) hoses every earlier version of mlbviewer including the last official release.
|
Quote:
Or, can you grep MLBJsonError mlbviewer.py? If that doesn't return at least half a dozen results, you pulled before I finished transmitting the fix. |
Quote:
Code:
Traceback (most recent call last): |
Oh, by the way, regarding the discussion about whether MLB would approve or not: my guess is their main concern with unauthorized clients is that it can allow people to circumvent their advertising (never mind that I use adblock). In this case, though, it's not a matter of us linux users using a client we like more than MLB's; but rather that MLB's client doesn't work at all for us.
So we wouldn't be getting any of the advertising anyway, and at least this way they still get our money for subscriptions. |
Everyone Must Update To Latest Svn
I can't tell you what happened with today's schedule page that we get from mlb.com. A library call outside of our own code is telling us that it is very likely mlb.com posted a badly formed jsp page. I just don't have the time this morning to look deeply into this. Unfortunately, the JSON to Python code is jkr's domain, but I guess I'll have to learn fast.
To update to the latest svn: Code:
svn co https://mlbviewer.svn.sourceforge.net/svnroot/mlbviewer/trunk mlbviewer To verify that you have the workaround: Code:
matthew@tango:~/mlbtv/svn/mlbviewer$ grep MLBJsonError mlbviewer.py Every previous version of mlbviewer is affected by this. Today's games may be unavailable from mlbviewer. The good news: Every other day (those without badly formed jsp schedules) should be available and you get the new Top Plays feature support. How to watch today's games: If the jsp isn't fixed by mlb.com or I'm not able to figure out how to correct for it on our end, you can still watch today's games using the mlbgameid.py script in the test directory: First, find the stream id for the game, gameday audio, or top play you want to watch/listen to from the jsp page: http://mlb.mlb.com/components/game/y...amesbydate.jsp Within a particular listing there are home_audio, away_audio, mlbtv, top_play_index, and game_wrapup sections. This is an example of a mlbtv listing: Code:
mlbtv: { Code:
test/mlbgameid.py 653960 I just uploaded one more fix into svn for the mlbgameid.py script to autodetect whether it should use the video_player or audio_player config file option based on the stream url type. You'll have to check out from svn once more for this fix. I apologize for releasing the workarounds in multiple svn's this morning. I honestly don't have time for these problems this morning but I'd rather not leave you all high and dry until tonight. If I have some more time before tonight, I'll track down the root cause of today's problems. |
Quote:
Please checkout from svn once more and tell if you still get an MLBJsonError (or ValueError for that matter.) |
Are we good for now?
I can look deeper into the issue later, but I want to make sure you all can watch archived games and top plays until this is fixed properly (which will probably have to come from mlb.com fixing their jsp.) |
I just pulled from svn and... nice! Top plays support = fabulous.
I'm able to see today's schedule, it's yesterday's (4/22) that I have problems with. It says "There was a parser problem with the listings page." Previous days work fine, though. Thanks for all the great work on this!! |
Quote:
Well, that's good news that you all can get today's games. Maybe when they figure out their error, you can view yesterday's top plays. |
Hey all,
Long time no see. Just wanted to let you know that I figured out the cause of yesterday's hiccup (their unwonted use of a double quote in a play description) and I'll have a fix up quite soon. UPDATE: Fixed in svn. |
Hmmm. Just pulled the latest svn. Getting a "there was a parser error with the listings page" followed by "No listings available for today". Tried going back a day and jumping to another day. No difference. Direct link to mlb listings as given earlier on the thread and I get something back. Putting it into debug mode didnt make any difference.
Thoughts? *edit* This is on a laptop. I'll try it on my usual PC later. |
Quote:
Try doing a fresh pull into another directory: Code:
svn co https://mlbviewer.svn.sourceforge.net/svnroot/mlbviewer/trunk mlbviewer-test |
I can confirm the latest svn fixes the 4/22 bug for me.
|
Quote:
I'll see if I can re-raise the Exception when debug is enabled just in case we're masking something else. Debug is intended to let most errors drop through like a lead ball so we can find the "unknown" errors. |
Quote:
|
Quote:
If we get future Json errors, the commit I'm making will spit out the character information if debugging is enabled. Code:
matthew@tango:~/mlbtv/svn/mlbviewer$ ./mlbviewer.py EDIT: Verified with Debug enabled that parser error isn't raised so your fix is golden. Thanks a million! |
Quote:
Thanks for the Daily Rewind support and keep up the good work you two! |
I don't know if I am pulling the newest svn off correctly...I am not getting anything when I press J for jumping to a day....I am still getting traceback errors. How do I know whether I am picking up the latest version?
____________________________________________________________________ Newbie error....Got it situated! |
Quote:
Code:
matthew@tango:~$ svn co https://mlbviewer.svn.sourceforge.net/svnroot/mlbviewer/trunk mlbviewer-test Did you create a new branch (or tag)? What's with the "mlbviewer-test"? How do you know if you have the latest? Code:
matthew@tango:~$ cd mlbviewer-test/ svn up updates your copy if there are newer revisions in the repository svn diff to see the changes between what's in the repository and any local changes you might have made svn log to see the commit notes And finally, you can always browse the repository online at: http://mlbviewer.svn.sourceforge.net...bviewer/trunk/ Each file/directory has its own Rev. so you look for the highest Rev and the Age to see how recent the revision is. Browsing the repository online also lets you see the commit log and visual diff's which are easier to read than svn diff. If you installed the package globally, (e.g. you ran setup.py install), you'll probably need to re-install the package you just checked out (or updated.) |
Quote:
I don't mind typing out the howto answers like I just did. It helps me later when someone asks the same question. :) You have to have a manual first before you can tell someone to read the fine manual. :D |
Daftcat-
Thanks! I didn't realize it was being put into a new folder, I have been looking at .mlb from the original origin. The svn put it in a mlbviewer-test folder within my home directory...I am sure you already know this, but I didn't and that was my problem... Everything works great, I love the options! |
Quote:
Great writeup. One slight addition: Quote:
Advanced usage note: 'svn log' shows you all the changes. But you can actually pull down from any point -- svn keeps a complete history. So if any of you are real bug-hunting junkies, and you think a recent change might have screwed something up, you can just run 'svn -r #' up, where '#' is a change in the log, to roll back to here. Only for the curious, but the latest version will still always be there waiting for you if you screw up And just to add on to what daftcat said about system installation. If that's how you run it, you can just run setup.py again. Each change will overwrite the old files. |
Where Are Condensed Games?
Copied from the MLB Mosaic Forum (and in turn, copied from an email correspondence with one of the members of that forum):
Quote:
|
Daftcat-
Awesome. I love those. |
Splash Screen Poll
What do you think of this as a new splash screen?
http://www.eds.org/~straycat/mlbsplash.jpg This is based on an older version of our VERSION text but we can change that. Please keep in mind the splash screen is only there to serve as a buffer between the time you start the application and when the listings load. There are no additional sleep commands in the splash code. So under normal network conditions, the amount of time this screen would be displayed would be relatively short (unlike Adobe Photoshop or Gimp, for example.) What do you think? a) Keep it simple. I like the splash the way it is. b) That rocks. Let's go with it. c) I'm indifferent. |
Quote:
|
Quote:
|
Quote:
Poll closed. ;) |
Quote:
|
I really like the addition of the top play listings, it's great stuff.
I'm with jkr on the logo, there's no sense in doing anything to upset major league baseball. That's not to say you shouldn't add some sort of splash screen, just that it shouldn't look like a copyrighted image. |
Is there any way to let us make our own ASCII splash screen (and maybe put a variable somewhere to let it know where to put the version info)? That way if people wanted, they could make the MLB or their team's logo in ASCII art, but it wouldn't be officially released with it so it shouldn't attract the hounds
|
Quote:
The biggest problem I see with implementing a user-defined splash screen is replacing whatever user-defined tag with the version string. I guess if the user wants to go through all the trouble of formatting an ascii graphic that doesn't look like a$$ when cooked through curses, then it should be up to them to also figure out where to put the version string in, how long the version string will be, and go through all the iterations of poorly formatted splash screen until they get it right. All in all, this doesn't really sound like a feature I want to implement--a very low bang to buck ratio. Try bribing me with tickets and maybe I'll reconsider. ;-) What's your local team? |
I tried a knock-off of the MLB logo with a silhouetted Tux, the penguin, but it was virtually unrecognizable as a penguin and wasn't fat enough to accommodate a version string. Who wants a skinny penguin?!
I'm looking at the alarm clock feature and then I'm calling it done for this release. I probably should implement meta-refresh for "Estimated delay" pages but it might be more annoying to wait for our app to retry under network congestion conditions. Perhaps I'll just write a "mlb.com congestion" error message and call it a day. I'd like to get a working version of mlbscores (which is behaving very badly right now) into the next release. |
All times are GMT -5. The time now is 02:34 AM. |