Message94387
I have Firefox and Safari installed on my Mac. Safari is the default.
I wanted to try out Crunchy (http://code.google.com/p/crunchy/). It's
developed under Firefox and does not work under Safari. I tried. ;)
It starts the web browser with the following.
try:
client = webbrowser.get("firefox")
client.open(url)
return
except:
try:
client = webbrowser.get()
client.open(url)
return
except:
print('Please open %s in Firefox.' % url)
On my Mac, webbrowser.get("firefox") fails, so this ends up opening in
Safari. Which does not work to view the code.
Thing is, I have Firefox installed, so it should work. But the Mac code in
webbrowser appears to only open in the default browser.
The following bit of code works well enough to get crunchy to work
class MacOSXFirefox(BaseBrowser):
def open(self, url, new=0, autoraise=True):
subprocess.check_call(["/usr/bin/open", "-b",
"org.mozilla.firefox", url])
register("firefox", None, MacOSXFirefox('firefox'), -1)
but I don't know enough about the Mac nor about webbrowser to know if I'm
the right path. For example, I don't know if there are ways to support
'new' and 'autoraise' through /usr/bin/open or if there's a better
solution.
Attached is the full diff. |
|
Date |
User |
Action |
Args |
2009-10-23 14:07:37 | dalke | set | recipients:
+ dalke |
2009-10-23 14:07:37 | dalke | set | messageid: <1256306857.19.0.981560840081.issue7192@psf.upfronthosting.co.za> |
2009-10-23 14:07:35 | dalke | link | issue7192 messages |
2009-10-23 14:07:34 | dalke | create | |
|