Make browser-switchboard launch MicroB if there is no config file and
Tear is not installed. Do this by handling default_browser == ""
specially, and by setting default_browser to the empty string by
default.
This allows us to drop the Depends: on tear in the packaging.
global continuous_mode, default_browser, other_browser_cmd
# continuous_mode: 0 -- close after handling a request; 1 -- run
global continuous_mode, default_browser, other_browser_cmd
# continuous_mode: 0 -- close after handling a request; 1 -- run
- # continuously in the background
+ # continuously in the background
continuous_mode = 0
# default_browser: "tear", "microb", "fennec", "midori", or "other"
continuous_mode = 0
# default_browser: "tear", "microb", "fennec", "midori", or "other"
- default_browser = "tear"
+ # empty string is handled specially -- see below
+ default_browser = ""
# If default browser is "other", what program to run (%s will be replaced
# If default browser is "other", what program to run (%s will be replaced
other_browser_cmd = ""
class BrowserLauncher:
other_browser_cmd = ""
class BrowserLauncher:
else:
print "default_browser is 'other', but no other_browser_cmd set -- using default"
self.LaunchBrowser = self.LaunchTear
else:
print "default_browser is 'other', but no other_browser_cmd set -- using default"
self.LaunchBrowser = self.LaunchTear
+ elif default_browser == "":
+ # If default_browser is empty, use Tear as the default if
+ # installed, otherwise use MicroB
+ if os.access("/usr/bin/tear", X_OK):
+ self.LaunchBrowser = self.LaunchTear
+ else
+ self.LaunchBrowser = self.LaunchMicroB
else:
print "Unknown default_browser %s, using default" % default_browser
self.LaunchBrowser = self.LaunchTear
else:
print "Unknown default_browser %s, using default" % default_browser
self.LaunchBrowser = self.LaunchTear