Ejemplo n.º 1
0
    def handle(self):
        try:
            dialogs = UserDialogsFacade()
            basePath = dialogs.getExistingDirectory(
                self._model.gui, self.tr("Choose a repository base path"))

            if not basePath:
                raise Exception(
                    self.
                    tr("You haven't chosen existent directory. Operation canceled."
                       ))

            #QFileDialog returns forward slashes in windows! Because of this path should be normalized
            basePath = os.path.normpath(basePath)
            self._model.repo = RepoMgr(basePath)
            self._model.user = None
            self._model.loginRecentUser()

            stats.sendEvent("main_window.open_repo")

        except LoginError:
            self.__letUserLoginByHimself()

        except Exception as ex:
            show_exc_info(self._model.gui, ex)
Ejemplo n.º 2
0
    def handle(self):
        try:
            dialogs = UserDialogsFacade()
            basePath = dialogs.getExistingDirectory(
                self._model.gui, self.tr("Choose a base path for new repository"))

            if not basePath:
                raise MsgException(
                    self.tr("You haven't chosen existent directory. Operation canceled."))

            # QFileDialog returns forward slashes in windows! Because of this
            # the path should be normalized
            basePath = os.path.normpath(basePath)
            self._model.repo = RepoMgr.createNewRepo(basePath)
            self._model.user = self.__createDefaultUser()

            stats.sendEvent("main_window.create_repo")

        except Exception as ex:
            show_exc_info(self._model.gui, ex)
Ejemplo n.º 3
0
    def handle(self):
        try:
            dialogs = UserDialogsFacade()
            basePath = dialogs.getExistingDirectory(
                self._model.gui,
                self.tr("Choose a base path for new repository"))

            if not basePath:
                raise MsgException(
                    self.
                    tr("You haven't chosen existent directory. Operation canceled."
                       ))

            # QFileDialog returns forward slashes in windows! Because of this
            # the path should be normalized
            basePath = os.path.normpath(basePath)
            self._model.repo = RepoMgr.createNewRepo(basePath)
            self._model.user = self.__createDefaultUser()

            stats.sendEvent("main_window.create_repo")

        except Exception as ex:
            show_exc_info(self._model.gui, ex)
Ejemplo n.º 4
0
    def handle(self):
        try:
            dialogs = UserDialogsFacade()
            basePath = dialogs.getExistingDirectory(
                self._model.gui, self.tr("Choose a repository base path"))

            if not basePath:
                raise Exception(
                    self.tr("You haven't chosen existent directory. Operation canceled."))

            #QFileDialog returns forward slashes in windows! Because of this path should be normalized
            basePath = os.path.normpath(basePath)
            self._model.repo = RepoMgr(basePath)
            self._model.user = None
            self._model.loginRecentUser()

            stats.sendEvent("main_window.open_repo")

        except LoginError:
            self.__letUserLoginByHimself()

        except Exception as ex:
            show_exc_info(self._model.gui, ex)