示例#1
0
def setUpModule():
    init_db()
    ctx = app.test_request_context()
    ctx.push()
    wallet1 = Wallet(
        'box1',
        'admin1',
        '123',
        'localhost',
        19001,
        False,
        True,
    )
    wallet2 = Wallet(
        'box2',
        'admin2',
        '123',
        'localhost',
        19011,
        False,
        True,
    )
    session.add(wallet1)
    session.add(wallet2)
    session.commit()
    # DONTFIXME encryption should be done through the webapp
    # Actually, no, this can't be done as it makes the daemon stop..
    # Unless we let this code restart it...
    conn = get_connection(wallet2)
    info = conn.getinfo()
    if not hasattr(info, 'unlocked_until'):
        conn.encryptwallet(pp)
    else:
        # Unlock and refill the keypool
        conn.walletpassphrase(pp, 1)
        conn.keypoolrefill()
示例#2
0
def setUpModule():
    init_db()
    ctx = app.test_request_context()
    ctx.push()
    wallet1 = Wallet(
        'box1',
        'admin1',
        '123',
        'localhost',
        19001,
        False,
        True,
    )
    wallet2 = Wallet(
        'box2',
        'admin2',
        '123',
        'localhost',
        19011,
        False,
        True,
    )
    session.add(wallet1)
    session.add(wallet2)
    session.commit()
    # DONTFIXME encryption should be done through the webapp
    # Actually, no, this can't be done as it makes the daemon stop..
    # Unless we let this code restart it...
    conn = get_connection(wallet2)
    info = conn.getinfo()
    if not hasattr(info, 'unlocked_until'):
        conn.encryptwallet(pp)
    else:
        # Unlock and refill the keypool
        conn.walletpassphrase(pp, 1)
        conn.keypoolrefill()
示例#3
0
def setUpModule():
    init_db()
示例#4
0
from otpapp.app import otpapp
from settingsapp.app import settingsapp
from walletapp.app import walletapp

try:
    from flask_debugtoolbar import DebugToolbarExtension
    toolbar = True
except:
    toolbar = False


app.config.from_envvar('FLASK_ADMIN', silent=True)
app.register_blueprint(otpapp)
app.register_blueprint(settingsapp)
app.register_blueprint(walletapp)
init_db()

if not app.debug and 'FLASK_ADMIN' in app.config:
    import logging
    from logging.handlers import SMTPHandler
    mail_handler = SMTPHandler(
        '127.0.0.1',
        '*****@*****.**',
        app.config['FLASK_ADMIN'],
        'Your application Failed'
    )
    mail_handler.setLevel(logging.ERROR)
    app.logger.addHandler(mail_handler)

# Init, teardown
@app.teardown_appcontext
示例#5
0
def setUpModule():
    init_db()
示例#6
0
def setUpModule():
    init_db()
    ctx = app.test_request_context()
    ctx.push()
示例#7
0
from flaskwallet import init_db
from otpapp.app import otpapp
from settingsapp.app import settingsapp
from walletapp.app import walletapp

try:
    from flask_debugtoolbar import DebugToolbarExtension
    toolbar = True
except:
    toolbar = False

app.config.from_envvar('FLASK_ADMIN', silent=True)
app.register_blueprint(otpapp)
app.register_blueprint(settingsapp)
app.register_blueprint(walletapp)
init_db()

if not app.debug and 'FLASK_ADMIN' in app.config:
    import logging
    from logging.handlers import SMTPHandler
    mail_handler = SMTPHandler('127.0.0.1', '*****@*****.**',
                               app.config['FLASK_ADMIN'],
                               'Your application Failed')
    mail_handler.setLevel(logging.ERROR)
    app.logger.addHandler(mail_handler)


# Init, teardown
@app.teardown_appcontext
def shutdown_session(exception=None):
    session.remove()
示例#8
0
def setUpModule():
    init_db()
    ctx = app.test_request_context()
    ctx.push()