~francesco-marella/specto/blacklist-plugins

« back to all changes in this revision

Viewing changes to spectlib/util.py

  • Committer: Jean-François Fortin Tam
  • Author(s): Christian Storgaard
  • Date: 2009-12-29 21:45:20 UTC
  • Revision ID: nekohayo@gmail.com-20091229214520-htd1pgdqotrffvx1
Implement a stopgap measure to handle Google Chrome (issue #284)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    """ Open the webpage in the default browser. """
31
31
    specto_gconf = Specto_gconf("/desktop/gnome/url-handlers/http")
32
32
    default_browser = specto_gconf.get_entry("command")
33
 
    return (default_browser % webpage) #return the browser with the page
 
33
    # Return the browser executable with the URL
 
34
    if "%s" in default_browser:  # Most browsers
 
35
        return (default_browser % webpage)
 
36
    else:  # TODO: This is a hack for Google Chrome. We should use xdg-open instead, ideally. See bug #284.
 
37
        return ("%s %s" % (default_browser, webpage))
34
38
 
35
39
 
36
40
def show_webpage(webpage):