Example #1
0
def setup_app(command, conf, vars):
    """Place any commands to setup fickileaks here"""
    # Don't reload the app if it was loaded under the testing environment
    if not pylons.test.pylonsapp:
        load_environment(conf.global_conf, conf.local_conf)

    # Create the tables if they don't already exist
    metadata.create_all(bind=Session.bind)

    # Populate the database on 'paster setup-app'

    # Users
    alice = User("*****@*****.**", "123456")
    bob = User("*****@*****.**", "654321")
    charlie = User("*****@*****.**", "password")

    # User alice claims to be aware of the existence of these persons
    ap0 = Person(alice, ["Alice Alison"], ["http://example.com/alice72"])
    ap1 = Person(alice, ["Bob Bobson"], ["http://example.com/bob81"])
    ap2 = Person(alice, ["Charlie Charleson"], ["http://example.com/charlie90"])
    ap3 = Person(alice, ["Dave Davidson"], ["http://example.com/davedavedave"])

    # User alice claims to be aware of the existence of these relationships
    ar0 = Relation(alice, "F**K", [ap0, ap1])
    ar1 = Relation(alice, "F**K", [ap0, ap2])
    ar2 = Relation(alice, "KISS", [ap0, ap3])

    # User bob claims to be aware of the existence of these persons
    bp0 = Person(bob, ["Alise"], ["http://example.net/~alice"])
    bp1 = Person(bob, ["Bobby"], ["http://example.com/bob81"])
    bp2 = Person(bob, ["Dave the Face"], ["http://example.com/davedavedave"])

    # User bob claims to be aware of the existence of these relationships
    br0 = Relation(bob, "F**K", [bp0, bp1])
    br1 = Relation(bob, "F**K", [bp0, bp2])
    br2 = Relation(bob, "KISS", [bp1, bp2])

    # User charlie claims to be aware of the existence of these persons
    cp0 = Person(charlie, ["Alice"], ["http://example.com/alice72", "http://example.net/~alice"])
    cp1 = Person(charlie, ["Bob from Berlin"], ["http://example.com/bob81"])
    cp2 = Person(charlie, ["Davey"], ["http://example.com/davedavedave"])
    cp3 = Person(charlie, ["Emily", "Em"], ["http://emily.example.net"])

    # User charlie claims to be aware of the existence of these relationships
    cr0 = Relation(charlie, "KISS", [cp0, cp1])
    cr1 = Relation(charlie, "KISS", [cp0, cp2])
    cr2 = Relation(charlie, "KISS", [cp1, cp3])
    cr3 = Relation(charlie, "F**K", [cp2, cp3])

    Session.commit()
Example #2
0
def setup_app(command, conf, vars):
    """Place any commands to setup fickileaks here"""
    # Don't reload the app if it was loaded under the testing environment
    if not pylons.test.pylonsapp:
        load_environment(conf.global_conf, conf.local_conf)

    # Create the tables if they don't already exist
    metadata.create_all(bind=Session.bind)

    # Populate the database on 'paster setup-app'

    # Users
    alice = User("*****@*****.**", "123456")
    bob = User("*****@*****.**", "654321")
    charlie = User("*****@*****.**", "password")

    # User alice claims to be aware of the existence of these persons
    ap0 = Person(alice, ["Alice Alison"], ["http://example.com/alice72"])
    ap1 = Person(alice, ["Bob Bobson"], ["http://example.com/bob81"])
    ap2 = Person(alice, ["Charlie Charleson"], ["http://example.com/charlie90"])
    ap3 = Person(alice, ["Dave Davidson"], ["http://example.com/davedavedave"])

    # User alice claims to be aware of the existence of these relationships
    ar0 = Relation(alice, 'F**K', [ap0, ap1])
    ar1 = Relation(alice, 'F**K', [ap0, ap2])
    ar2 = Relation(alice, 'KISS', [ap0, ap3])

    # User bob claims to be aware of the existence of these persons
    bp0 = Person(bob, ["Alise"], ["http://example.net/~alice"])
    bp1 = Person(bob, ["Bobby"], ["http://example.com/bob81"])
    bp2 = Person(bob, ["Dave the Face"], ["http://example.com/davedavedave"])

    # User bob claims to be aware of the existence of these relationships
    br0 = Relation(bob, 'F**K', [bp0, bp1])
    br1 = Relation(bob, 'F**K', [bp0, bp2])
    br2 = Relation(bob, 'KISS', [bp1, bp2])

    # User charlie claims to be aware of the existence of these persons
    cp0 = Person(charlie, ["Alice"], ["http://example.com/alice72", "http://example.net/~alice"])
    cp1 = Person(charlie, ["Bob from Berlin"], ["http://example.com/bob81"])
    cp2 = Person(charlie, ["Davey"], ["http://example.com/davedavedave"])
    cp3 = Person(charlie, ["Emily", "Em"], ["http://emily.example.net"])

    # User charlie claims to be aware of the existence of these relationships
    cr0 = Relation(charlie, 'KISS', [cp0, cp1])
    cr1 = Relation(charlie, 'KISS', [cp0, cp2])
    cr2 = Relation(charlie, 'KISS', [cp1, cp3])
    cr3 = Relation(charlie, 'F**K', [cp2, cp3])

    Session.commit()
Example #3
0
def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
    """Create a Pylons WSGI application and return it

    ``global_conf``
        The inherited configuration for this application. Normally from
        the [DEFAULT] section of the Paste ini file.

    ``full_stack``
        Whether this application provides a full WSGI stack (by default,
        meaning it handles its own exceptions and errors). Disable
        full_stack when this application is "managed" by another WSGI
        middleware.

    ``static_files``
        Whether this application serves its own static files; disable
        when another web server is responsible for serving them.

    ``app_conf``
        The application's local configuration. Normally specified in
        the [app:<name>] section of the Paste ini file (where <name>
        defaults to main).

    """
    # Configure the Pylons environment
    config = load_environment(global_conf, app_conf)

    # The Pylons WSGI app
    app = PylonsApp(config=config)

    # Routing/Session Middleware
    app = RoutesMiddleware(app, config['routes.map'])
    app = SessionMiddleware(app, config)

    # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)

    if asbool(full_stack):
        # Handle Python exceptions
        app = ErrorHandler(app, global_conf, **config['pylons.errorware'])

        # Display error documents for 401, 403, 404 status codes (and
        # 500 when debug is disabled)
        if asbool(config['debug']):
            app = StatusCodeRedirect(app)
        else:
            app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])

    # Establish the Registry for this application
    app = RegistryManager(app)

    if asbool(static_files):
        # Serve static files
        static_app = StaticURLParser(config['pylons.paths']['static_files'])
        app = Cascade([static_app, app])
    app.config = config
    return app
Example #4
0
def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
    """Create a Pylons WSGI application and return it

    ``global_conf``
        The inherited configuration for this application. Normally from
        the [DEFAULT] section of the Paste ini file.

    ``full_stack``
        Whether this application provides a full WSGI stack (by default,
        meaning it handles its own exceptions and errors). Disable
        full_stack when this application is "managed" by another WSGI
        middleware.

    ``static_files``
        Whether this application serves its own static files; disable
        when another web server is responsible for serving them.

    ``app_conf``
        The application's local configuration. Normally specified in
        the [app:<name>] section of the Paste ini file (where <name>
        defaults to main).

    """
    # Configure the Pylons environment
    config = load_environment(global_conf, app_conf)

    # The Pylons WSGI app
    app = PylonsApp(config=config)

    # Routing/Session Middleware
    app = RoutesMiddleware(app, config["routes.map"])
    app = SessionMiddleware(app, config)

    # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)

    if asbool(full_stack):
        # Handle Python exceptions
        app = ErrorHandler(app, global_conf, **config["pylons.errorware"])

        # Display error documents for 401, 403, 404 status codes (and
        # 500 when debug is disabled)
        if asbool(config["debug"]):
            app = StatusCodeRedirect(app)
        else:
            app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])

    # Establish the Registry for this application
    app = RegistryManager(app)

    if asbool(static_files):
        # Serve static files
        static_app = StaticURLParser(config["pylons.paths"]["static_files"])
        app = Cascade([static_app, app])
    app.config = config
    return app
Example #5
0
def setup_app(command, conf, vars):
    """Place any commands to setup fickileaks here"""
    # Don't reload the app if it was loaded under the testing environment
    if not pylons.test.pylonsapp:
        load_environment(conf.global_conf, conf.local_conf)

    # Create the tables if they don't already exist
    metadata.create_all(bind=Session.bind)

    # Populate the database on 'paster setup-app'

    # Users
    alice = User("*****@*****.**", "123456")
    bob = User("*****@*****.**", "123456")
    charlie = User("*****@*****.**", "123456")

    # User alice claims to be aware of the existence of these persons
    ap0 = Person(alice, ["Maine"], ["http://example.net/~maine"])
    ap1 = Person(alice, ["Alabama"], ["http://example.net/~alabama", "https://example.com/~alabama"])
    ap2 = Person(alice, ["Delaware"], ["http://example.com/~delaware"])
    ap3 = Person(alice, ["Georgia"], ["http://example.org/~georgia"])
    ap4 = Person(alice, ["Montana"], ["http://example.net/~montana"])
    ap5 = Person(alice, ["Indiana"], ["http://example.com/~indiana"])
    ap6 = Person(alice, [u"ˌkælɪˈfɔrnjə"], ["http://example.com/~california"])
    ap7 = Person(alice, [u"ˌpɛnsɪlˈveɪnjə"], ["http://example.net/~pennsylvania"])

    # User alice claims to be aware of the existence of these relationships
    Relation(alice, 'KISS', [ap1, ap2])
    Relation(alice, 'F**K', [ap1, ap2])
    Relation(alice, 'KISS', [ap0, ap3])
    Relation(alice, 'KISS', [ap3, ap4])
    Relation(alice, 'F**K', [ap3, ap4])
    Relation(alice, 'KISS', [ap0, ap5])
    Relation(alice, 'KISS', [ap2, ap3])
    Relation(alice, 'KISS', [ap3, ap5])
    Relation(alice, 'GROPE', [ap3, ap5])
    Relation(alice, 'KISS', [ap3, ap6])
    Relation(alice, 'F**K', [ap5, ap6])
    Relation(alice, 'GROPE', [ap0, ap7])
    Relation(alice, 'KISS', [ap0, ap7])
    Relation(alice, 'F**K', [ap0, ap7])
    Relation(alice, 'ORAL', [ap0, ap7])

    # User bob claims to be aware of the existence of these persons
    bp0 = Person(bob, ["Alabama"], ["http://example.net/~alabama"])
    bp1 = Person(bob, ["Delaware"], ["http://example.com/~delaware"])
    bp2 = Person(bob, ["Indiana"], ["http://example.com/~indiana"])
    bp3 = Person(bob, [u"ˌkælɪˈfɔrnjə"], ["http://example.com/~california"])

    # User bob claims to be aware of the existence of these relationships
    Relation(bob, 'KISS', [bp0, bp1])
    Relation(bob, 'F**K', [bp0, bp1])
    Relation(bob, 'GROPE', [bp2, bp3])

    # User charlie claims to be aware of the existence of these persons
    cp0 = Person(charlie, ["Maine"], ["http://example.net/~maine"])
    cp1 = Person(charlie, ["Georgia", u"ˈdʒɔrdʒə"], ["http://example.org/~georgia", "http://example.net/memory"])

    # User charlie claims to be aware of the existence of these relationships

    Relation(charlie, 'GROPE', [cp0, cp1])
    Relation(charlie, 'KISS', [cp0, cp1])
    Relation(charlie, 'F**K', [cp0, cp1])
    Relation(charlie, 'ORAL', [cp0, cp1])
    Relation(charlie, 'ANAL', [cp0, cp1])
    Relation(charlie, 'SM', [cp0, cp1])

    Session.commit()