Exemplo n.º 1
0
 def setUp(self):
     """ Set up the environnment, ran before every tests. """
     if '///' in DB_PATH:
         dbfile = DB_PATH.split('///')[1]
         if os.path.exists(dbfile):
             os.unlink(dbfile)
     self.session = model.create_tables(DB_PATH, debug=False)
     APP.before_request(FAS._check_session)
Exemplo n.º 2
0
 def setUp(self):
     """ Set up the environnment, ran before every tests. """
     if '///' in DB_PATH:
         dbfile = DB_PATH.split('///')[1]
         if os.path.exists(dbfile):
             os.unlink(dbfile)
     self.session = model.create_tables(DB_PATH, debug=False)
     APP.before_request(FAS._check_session)
Exemplo n.º 3
0
 def setUp(self):
     """ Set up the environnment, ran before every tests. """
     if '///' in DB_PATH:
         dbfile = DB_PATH.split('///')[1]
         if os.path.exists(dbfile):
             os.unlink(dbfile)
     self.session = model.create_tables(DB_PATH, debug=False)
     # Create the docker namespace
     obj = model.Namespace('docker')
     self.session.add(obj)
     self.session.commit()
     APP.before_request(FAS._check_session)
Exemplo n.º 4
0
 def setUp(self):
     """ Set up the environnment, ran before every tests. """
     if '///' in DB_PATH:
         dbfile = DB_PATH.split('///')[1]
         if os.path.exists(dbfile):
             os.unlink(dbfile)
     self.session = model.create_tables(DB_PATH, debug=False)
     # Create the docker namespace
     obj = model.Namespace('docker')
     self.session.add(obj)
     self.session.commit()
     APP.before_request(FAS._check_session)
Exemplo n.º 5
0
                    action='store_true',
                    default=False,
                    help='Expand the level of data returned.')
parser.add_argument('--profile',
                    dest='profile',
                    action='store_true',
                    default=False,
                    help='Profile the packages2 application.')
parser.add_argument('--port',
                    '-p',
                    default=5000,
                    help='Port for the flask application.')

args = parser.parse_args()

if args.profile:
    from werkzeug.contrib.profiler import ProfilerMiddleware
    APP.config['PROFILE'] = True
    APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30])

if args.config:
    config = args.config
    if not config.startswith('/'):
        here = os.path.join(os.path.dirname(os.path.abspath(__file__)))
        config = os.path.join(here, config)
    os.environ['PKGDB2_CONFIG'] = config

from pkgdb2 import APP
APP.debug = True
APP.run(port=int(args.port))
Exemplo n.º 6
0
    help='Configuration file to use for packages.')
parser.add_argument(
    '--debug', dest='debug', action='store_true',
    default=False,
    help='Expand the level of data returned.')
parser.add_argument(
    '--profile', dest='profile', action='store_true',
    default=False,
    help='Profile the packages2 application.')
parser.add_argument(
    '--port', '-p', default=5000,
    help='Port for the flask application.')

args = parser.parse_args()

if args.profile:
    from werkzeug.contrib.profiler import ProfilerMiddleware
    APP.config['PROFILE'] = True
    APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30])

if args.config:
    config = args.config
    if not config.startswith('/'):
        here = os.path.join(os.path.dirname(os.path.abspath(__file__)))
        config = os.path.join(here, config)
    os.environ['PKGDB2_CONFIG'] = config

from pkgdb2 import APP
APP.debug = True
APP.run(port=int(args.port))
Exemplo n.º 7
0
parser.add_argument(
    '--profile', dest='profile', action='store_true',
    default=False,
    help='Profile the packages2 application.')
parser.add_argument(
    '--port', '-p', default=5000,
    help='Port for the flask application.')
parser.add_argument(
    '--host', default="127.0.0.1",
    help='Hostname to listen on. When set to 0.0.0.0 the server is available \
    externally. Defaults to 127.0.0.1 making the it only visable on localhost')

args = parser.parse_args()

if args.config:
    config = args.config
    if not config.startswith('/'):
        here = os.path.join(os.path.dirname(os.path.abspath(__file__)))
        config = os.path.join(here, config)
    os.environ['PKGDB2_CONFIG'] = config

from pkgdb2 import APP

if args.profile:
    from werkzeug.contrib.profiler import ProfilerMiddleware
    APP.config['PROFILE'] = True
    APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30])

APP.debug = True
APP.run(port=int(args.port), host=args.host)
Exemplo n.º 8
0
#!/usr/bin/env python

## These two lines are needed to run on EL6
__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
import pkg_resources

from pkgdb2 import APP
APP.debug = True
APP.run()
Exemplo n.º 9
0
                    default=False,
                    help='Profile the packages2 application.')
parser.add_argument('--port',
                    '-p',
                    default=5000,
                    help='Port for the flask application.')
parser.add_argument(
    '--host',
    default="127.0.0.1",
    help='Hostname to listen on. When set to 0.0.0.0 the server is available \
    externally. Defaults to 127.0.0.1 making the it only visable on localhost')

args = parser.parse_args()

if args.config:
    config = args.config
    if not config.startswith('/'):
        here = os.path.join(os.path.dirname(os.path.abspath(__file__)))
        config = os.path.join(here, config)
    os.environ['PKGDB2_CONFIG'] = config

from pkgdb2 import APP

if args.profile:
    from werkzeug.contrib.profiler import ProfilerMiddleware
    APP.config['PROFILE'] = True
    APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30])

APP.debug = True
APP.run(port=int(args.port), host=args.host)