From 29d475ae9fb96895427ca1ddfbdd014aa14fae70 Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Fri, 11 Dec 2009 02:51:31 -0800 Subject: [PATCH] Try legacy config file location if config file not found Before we renamed the project, the config file used to be found in $HOME/.config/browser-proxy, so if we don't find a config file in the new place, try the old one before giving up. Also fix a couple of syntax errors. --- browser-switchboard | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/browser-switchboard b/browser-switchboard index 71a9bbf..8873c24 100755 --- a/browser-switchboard +++ b/browser-switchboard @@ -130,9 +130,9 @@ class BrowserLauncher: 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): + if os.access("/usr/bin/tear", os.X_OK): self.LaunchBrowser = self.LaunchTear - else + else: self.LaunchBrowser = self.LaunchMicroB else: print "Unknown default_browser %s, using default" % default_browser @@ -191,10 +191,14 @@ def readconfigfile(signalnum=None, frame=None): # read configuration from the config file, if available try: execfile(os.getenv("HOME", "/home/user") + "/.config/browser-switchboard", globals()) - launcher.UpdateDefaultBrowser() except: - # No valid config file available - pass + # Try the legacy config file location + try: + execfile(os.getenv("HOME", "/home/user") + "/.config/browser-proxy", globals()) + except: + # No valid config file available + return + launcher.UpdateDefaultBrowser() setconfigdefaults() -- 1.7.9.5