コード例 #1
0
ファイル: __init__.py プロジェクト: trasher/pkgdb2
 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)
コード例 #2
0
ファイル: __init__.py プロジェクト: devyanikota/pkgdb2
 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)
コード例 #3
0
ファイル: __init__.py プロジェクト: vivekanand1101/pkgdb2
 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)
コード例 #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)
コード例 #5
0
ファイル: runserver.py プロジェクト: apevec/pkgdb2
                    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))
コード例 #6
0
ファイル: runserver.py プロジェクト: cverna/pkgdb2
    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))
コード例 #7
0
ファイル: runserver.py プロジェクト: fedora-infra/pkgdb2
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)
コード例 #8
0
ファイル: runserver.py プロジェクト: cydrobolt/pkgdb2
#!/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()
コード例 #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)