Exemple #1
0
    def _showRepositoryConfigDialog(self):

        repoconfig_dialog = RepositoryConfigDialog(self,
                                                   CONF.getCouchURI(),
                                                   CONF.getCouchIsReplicated(),
                                                   CONF.getCouchReplics(),
                                                   callback=None)
        result = repoconfig_dialog.exec_loop()
        if result == qt.QDialog.Accepted:
            repourl, isReplicated, replics = repoconfig_dialog.getData()
            api.devlog("repourl = %s" % repourl)
            wm = self._main_app.getWorkspaceManager()
            if not CouchdbManager.testCouch(repourl):
                self.showPopup("""
                Repository URL Not valid, check if
                service is available and that connection string is from
                the form: http[s]://hostname:port""")
                repourl, isReplicated, replics = "", False, ""

            CONF.setCouchUri(repourl)
            CONF.setCouchIsReplicated(isReplicated)
            CONF.setCouchReplics(replics)
            CONF.saveConfig()

            couchdbmanager = CouchdbManager(repourl)
            wm.setCouchManager(couchdbmanager)

            wm.loadWorkspaces()
            mwin = self._main_app.getMainWindow()
            mwin.getWorkspaceTreeView().loadAllWorkspaces()
            mwin.getWorkspaceTreeView().setDefaultWorkspace()
Exemple #2
0
 def setUp(self):
     self.couch_uri = CONF.getCouchURI()
     self.cdm = CouchdbManager(uri=self.couch_uri)
     wpath = os.path.expanduser("~/.faraday/persistence/")
     self.fsm = FSManager(wpath)
     self.wm = WorkspaceManager(mock(ModelController),
                                mock(PluginController))
     self._fs_workspaces = []
     self._couchdb_workspaces = []