Exemple #1
0
def create_application(cyd=None, viewer=None):
    if viewer is None:
        # try to automatically detect pyggi and use it as viewer
        try:
            import pyggi.lib.config
            pyggi.lib.config.config.read(['/etc/pyggi.conf'])

            from pyggi import create_app
            viewer = create_app()
        except Exception as e:
            logging.info("Pyggi not found", exc_info=True)

    if viewer is None:
        logging.warn("No viewer for git found!")

    return GitHTTP(cyd=cyd, gitviewer=viewer)
Exemple #2
0
def create_application(cyd=None, viewer=None):
    if viewer is None:
        # try to automatically detect pyggi and use it as viewer
        try:
            import pyggi.lib.config
            pyggi.lib.config.config.read(['/etc/pyggi.conf'])

            from pyggi import create_app
            viewer = create_app()
        except Exception as e:
            logging.info("Pyggi not found", exc_info=True)

    if viewer is None:
        logging.warn("No viewer for git found!")

    return GitHTTP(cyd=cyd, gitviewer=viewer)
Exemple #3
0
def find_git_viewer():
    """Tries to find a known git viewer"""
    # pyggi - https://www.0xdeadbeef.ch/pyggi/pyggi.git/
    # not to be confused with PyGGI from PyPI
    try:
        from pyggi.lib.config import config

        config.add_section('general')
        config.set('general', 'preserve_daemon_export', "false")
        config.set('general', 'name', "pyggi")

        config.add_section('clone')

        config.add_section('modules')
        config.set('modules', 'pyggi.repositories.frontend', '/')
        config.set('modules', 'pyggi.base.base', '/')

        from pyggi import create_app

        return WSGIResource(reactor, reactor.getThreadPool(), create_app())

    except:
        pass
Exemple #4
0
def find_git_viewer():
    """Tries to find a known git viewer"""
    # pyggi - https://www.0xdeadbeef.ch/pyggi/pyggi.git/
    # not to be confused with PyGGI from PyPI
    try:
        from pyggi.lib.config import config

        config.add_section('general')
        config.set('general', 'preserve_daemon_export', "false")
        config.set('general', 'name', "pyggi")

        config.add_section('clone')

        config.add_section('modules')
        config.set('modules', 'pyggi.repositories.frontend', '/')
        config.set('modules', 'pyggi.base.base', '/')

        from pyggi import create_app

        return WSGIResource(reactor, reactor.getThreadPool(), create_app())

    except:
        pass