Quoth Christian Ebert on Monday, 06 September 2010: > * Chip Camden on Sunday, September 05, 2010 at 10:26:29 -0700 > > Quoth Christian Ebert on Sunday, 05 September 2010: > >> * Chip Camden on Saturday, September 04, 2010 at 15:22:57 -0700 > >>> That's pretty cool. It looks though like it doesn't accept a shell > >>> wrapper for the browser: > >>> > >>> viewhtmlmsg -b browser > >>> > >>> where browser is a shell script as follows: > >>> > >>> #!/bin/sh > >>> if RunningX > >>> then > >>> firefox $* > >>> xdotool key super+3 > >>> xdotool keyup super > >>> else > >>> w3m -t text/html $* > >>> fi > >>> > >>> It appears from debugging that we never even get into this script, yet no > >>> error is generated. Same result if I put the full path on the script. > > The error catching should be fixed now: > > $ viewhtmlmsg -b dummy < testhtmlmsg > abort: could not locate runnable browser > > >>> Works great with just 'viewhtmlmsg -b firefox' though, and the odd thing > >>> is that 'firefox' is a shell script in /usr/local/bin. > >> > >> That's because the script uses Python's webbrowser module > >> > >> http://docs.python.org/library/webbrowser.html > >> > >> for browser detection and handling. > >> > >> I deemed it sufficient for most use cases. > > > > A known list of browsers seems very un-unixlike. > > Yes. otoh, I can always blame Python's webbrowser module when > something breaks ;-) > > Try, unix-like: > > BROWSER=/path/to/browser viewhtmlmsg testhtmlmsg > > > If the name supplied is not one of those, couldn't you just > > launch it with the filename as an argument? > > The rationale for my lazyness is that the webbrowser module > should be more cross platform. I don't know about windows, but it > already makes things a lot easier on Mac. I spent more effort in > handling text browsers (in potential conjunction with screen) in > the included pybrowser script (also used by the urlview > replacement urlpager) and, in the spirit of Mutt, try to make the > GUI part, so to speak, as lightweight as possible. > > Thanks for your feedback. > > c > -- > Was heißt hier Dogma, ich bin Underdogma! > [ What the hell do you mean dogma, I am underdogma. ] > free movies --->>> http://www.blacktrash.org/underdogma/ > http://itunes.apple.com/podcast/underdogma-movies/id363423596
Setting BROWSER to /path/to/browser does the trick. That says to me that this is an oversight in the webbrowser module's design. But I have a solution now, so I'm happy. Thanks again for the script! -- Sterling (Chip) Camden | sterl...@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipstips.com | http://chipsquips.com
pgp1xXtkSs0Qj.pgp
Description: PGP signature