Ejemplo n.º 1
0
    def handle(self, app, *args, **kwargs):
        os.environ['RUNNING_FROM_CLI'] = '1'
        app.blohg.init_repo(kwargs.pop('revision_id'))

        # find extension files
        def _listfiles(directory, files):
            if not os.path.exists(directory):
                return
            for f in os.listdir(directory):
                fname = os.path.join(directory, f)
                if os.path.isdir(fname):
                    _listfiles(fname, files)
                else:
                    files.append(os.path.abspath(fname))

        extra_files = []
        _listfiles(os.path.join(app.config['REPO_PATH'],
                                app.config['EXTENSIONS_DIR']), extra_files)

        if 'extra_files' in self.server_options \
           and self.server_options['extra_files'] is not None:
            self.server_options['extra_files'] = \
                list(self.server_options['extra_files']) + extra_files
        else:
            self.server_options['extra_files'] = extra_files

        _Server.handle(self, app, *args, **kwargs)
Ejemplo n.º 2
0
 def handle(*args, **kwargs):
     app.configure(
         DEBUG=True,
         SQLALCHEMY_ECHO=True,
         USE_X_SENDFILE=False,
     )
     Server.handle(*args, **kwargs)
Ejemplo n.º 3
0
 def handle(self, *args, **kwargs):
     Server.handle(self, *args, **kwargs)
Ejemplo n.º 4
0
 def handle(self, *args, **kwargs):
     Server.handle(self, *args, **kwargs)
Ejemplo n.º 5
0
 def handle(*args, **kwargs):
     app.configure(DEBUG=True)
     Server.handle(*args, **kwargs)