Exemple #1
0
    def populate_prefs(self):
        filename = os.path.expanduser('~/.dockyard.cfg')
        config = ConfigParser.SafeConfigParser({
            'browser': 'firefox',
            'docker_api_url': 'unix://var/run/docker.sock'
        })
        config.read(['dockyard.cfg', os.path.expanduser('~/.dockyard.cfg')])
        if not config.has_section('settings'):
            config.add_section('settings')


        self.prefs_select_browser = interface.get_object('cmb_prefs_select_browser')
        model = self.prefs_select_browser.get_model()
        model.clear()
        for browser, path in return_browsers():
            self.prefs_select_browser.append_text(browser)
        self.prefs_select_browser.set_active(0)
        self.window_prefs.show_all()
        
        browser = self.prefs_select_browser.get_active() or 'firefox'

        config.set('settings', 'browser', browser)
        # tmp write out prefs
        with open(filename, 'wb') as configfile:
            config.write(configfile)
 def test_bad_browser_selected(self):
     self.assertTrue(utils.return_browsers())
 def test_local_search(self):
     utils.return_browsers()