def init_browser(self):
        install_path = os.path.join(self.base_install_dir, self.INSTALL_SUBDIR)
        latest = GetLatestTinderbox(self.branch, self.PLATFORM, buildtype=self.BUILDTYPE, app='firefox', app_short='firefox')

        try:
            latest_url = latest.latest_build_url()
            basename = latest_url[latest_url.rfind("/")+1:]
        except:
            if config.verbose:
                traceback.print_exc()
            return False

        try:
            shutil.rmtree(install_path)
        except:
            pass

        os.makedirs(install_path)

        try:
            print "Fetching " + latest_url + "..."
            urllib.urlretrieve(latest_url, os.path.join(install_path, basename))
        except:
            print 'Failed to get latest tinderbox build'
            if config.verbose:
                traceback.print_exc()
            return False

        appini = self.prepare_archived_build(install_path, os.path.join(install_path, basename))
        if appini is None:
            print 'Failed to get application.ini!'
            return False

        self.parse_app_ini(appini)
        return True
    def init_browser(self):
        install_path = os.path.join(self.base_install_dir, self.INSTALL_SUBDIR)

        try:
            shutil.rmtree(install_path)
        except:
            pass
        os.makedirs(install_path)

        latest = GetLatestTinderbox(self.branch, "android", app='mobile', app_short='fennec')
        latest_url = latest.latest_build_url()
        basename = latest_url[latest_url.rfind("/")+1:]

        apkpath = os.path.join(install_path, basename)

        try:
            print "Fetching " + latest_url + "..."
            urllib.urlretrieve(latest_url, apkpath)
        except Exception as e:
            print 'Failed to get latest tinderbox build'
            print e
            return False

        # pull out app.ini and parse it
        zip = zipfile.ZipFile(apkpath, 'r')
        zip.extract("application.ini", install_path)
        self.parse_app_ini(os.path.join(install_path, "application.ini"))

        # now install the apk
        return self.dm.installLocalApp(apkpath)
    def init_browser(self):
        install_path = os.path.join(self.base_install_dir, self.INSTALL_SUBDIR)
        latest = GetLatestTinderbox(self.branch, self.PLATFORM, buildtype=self.BUILDTYPE, app='firefox', app_short='firefox')

        try:
            latest_url = latest.latest_build_url()
            basename = latest_url[latest_url.rfind("/")+1:]
        except:
            if config.verbose:
                traceback.print_exc()
            return False

        try:
            if self.last_download_url is None:
                shutil.rmtree(install_path)
                os.makedirs(install_path)
        except:
            pass

        if not os.path.exists(install_path):
            print "! failed to create temp dir path: %s" % install_path
            return False

        destfile = os.path.join(install_path, basename)

        try:
            if latest_url == self.last_download_url and os.path.exists(destfile):
                print "Skipping fetching " + latest_url + ", already have it"
            else:
                print "Fetching " + latest_url + "..."
                urllib.urlretrieve(latest_url, destfile)
                self.last_download_url = latest_url
        except:
            print 'Failed to get latest tinderbox build'
            if config.verbose:
                traceback.print_exc()
            self.last_download_url = None
            return False

        appini = self.prepare_archived_build(install_path, destfile)
        if appini is None:
            print 'Failed to get application.ini!'
            return False

        self.parse_app_ini(appini)
        return True
    def init_browser(self):
        install_path = os.path.join(self.base_install_dir, self.INSTALL_SUBDIR)

        try:
            if self.last_download_url is None:
                shutil.rmtree(install_path)
                os.makedirs(install_path)
        except:
            pass

        if not os.path.exists(install_path):
            print "! failed to create temp dir path: %s" % install_path
            return False

        latest = GetLatestTinderbox(self.branch, "android", app='mobile', app_short='fennec')
        latest_url = latest.latest_build_url()
        basename = latest_url[latest_url.rfind("/")+1:]

        apkpath = os.path.join(install_path, basename)

        try:
            if latest_url == self.last_download_url and os.path.exists(apkpath):
                print "Skipping fetching " + latest_url + ", already have it"
            else:
                print "Fetching " + latest_url + "..."
                urllib.urlretrieve(latest_url, apkpath)
                self.last_download_url = latest_url
        except Exception as e:
            print 'Failed to get latest tinderbox build'
            if config.verbose:
                traceback.print_exc()
            self.last_download_url = None
            return False

        # pull out app.ini and parse it
        zip = zipfile.ZipFile(apkpath, 'r')
        zip.extract("application.ini", install_path)
        self.parse_app_ini(os.path.join(install_path, "application.ini"))

        # now install the apk
        return self.dm.installLocalApp(apkpath)