Exemple #1
0
    def load_project(self, projdir):
        ''' Activate the project in the specified directory;
            instantiate a file manager and projdirfactory.
        '''
        _clear_insts()
        self.cleanup()

        try:
            # Start a new log file.
            logging.getLogger().handlers[0].doRollover()

            self.files = FileManager('files',
                                     path=projdir,
                                     publish_updates=self.publish_updates)

            self.projdirfactory = ProjDirFactory(projdir,
                                                 observer=self.files.observer)
            register_class_factory(self.projdirfactory)

            self.proj = Project(projdir)
            repo = get_repo(projdir)
            if repo is None:
                find_vcs()[0](projdir).init_repo()
            self.proj.activate()
        except Exception as err:
            self._error(err, sys.exc_info())
    def load_project(self, projdir):
        ''' Activate the project in the specified directory;
            instantiate a file manager and projdirfactory.
        '''
        _clear_insts()
        self.cleanup()

        try:
            # Start a new log file.
            logging.getLogger().handlers[0].doRollover()

            self.files = FileManager('files', path=projdir,
                                     publish_updates=self.publish_updates)

            self.projdirfactory = ProjDirFactory(projdir,
                                                 observer=self.files.observer)
            register_class_factory(self.projdirfactory)

            self.proj = Project(projdir)
            repo = get_repo(projdir)
            if repo is None:
                find_vcs()[0](projdir).init_repo()
            self.proj.activate()
        except Exception as err:
            self._error(err, sys.exc_info())