Exemplo n.º 1
0
def create_app_no_redis():
    return webtest.TestApp(napfs.create_app(data_dir=NAPFS_DATA_DIR))
Exemplo n.º 2
0
def create_app():
    if not os.path.exists(NAPFS_DATA_DIR):
        os.mkdir(NAPFS_DATA_DIR)
    return webtest.TestApp(
        napfs.create_app(data_dir=NAPFS_DATA_DIR,
                         redis_connection=redis_connection))
Exemplo n.º 3
0
import napfs
import redislite

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='kick off the napfs server')
    parser.add_argument('-p',
                        '--port',
                        default=3035,
                        type=int,
                        help="specify the port to listen to")

    parser.add_argument('-d',
                        '--data-dir',
                        type=str,
                        default="/tmp/napfs",
                        help="specify the directory to use to write the files")

    args = parser.parse_args()
    httpd = make_server(
        '127.0.0.1', args.port,
        napfs.create_app(data_dir=args.data_dir,
                         redis_connection=redislite.StrictRedis()))

    print("starting server on port %s" % args.port)
    print("data-dir %s" % args.data_dir)

    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        print("done")
Exemplo n.º 4
0
def create_app_no_redis():
    return webtest.TestApp(napfs.create_app(data_dir=NAPFS_DATA_DIR))
Exemplo n.º 5
0
def create_app():
    if not os.path.exists(NAPFS_DATA_DIR):
        os.mkdir(NAPFS_DATA_DIR)
    return webtest.TestApp(napfs.create_app(
        data_dir=NAPFS_DATA_DIR, redis_connection=redis_connection))
Exemplo n.º 6
0
from wsgiref.simple_server import make_server
import argparse

# import library
import napfs
import redislite

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='kick off the napfs server')
    parser.add_argument('-p', '--port', default=3035, type=int,
                        help="specify the port to listen to")

    parser.add_argument('-d', '--data-dir', type=str, default="/tmp/napfs",
                        help="specify the directory to use to write the files")

    args = parser.parse_args()
    httpd = make_server(
        '127.0.0.1',
        args.port,
        napfs.create_app(
            data_dir=args.data_dir,
            redis_connection=redislite.StrictRedis()))

    print("starting server on port %s" % args.port)
    print("data-dir %s" % args.data_dir)

    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        print("done")