Esempio n. 1
0
def main():
    if '--with-redis' in sys.argv:
        redis_requested = True
        sys.argv.remove('--with-redis')
    else:
        redis_requested = False

    app = create_app(os.environ['OSMPOINT_WORKDIR'])
    manager = Manager(app, default_server_actions=True)
    manager.add_action('migrate_to_redis', migrate_to_redis_cmd)

    with maybe_redis_server(app, redis_requested):
        manager.run()
Esempio n. 2
0
def main():

    # from dbtruck.util import get_logger
    # _log = get_logger(fname='/tmp/dbtruck.log')
    from dbtrucksite import app
    # DEC2FLOAT = psycopg2.extensions.new_type(
    #     psycopg2.extensions.DECIMAL.values,
    #     'DEC2FLOAT',
    #     lambda value, curs: float(value) if value is not None else None)
    # psycopg2.extensions.register_type(DEC2FLOAT)
    app.debug = True
    print 'running'
    manager = Manager(app, default_server_actions=True)
    manager.run()
Esempio n. 3
0
def main():
    if '--with-redis' in sys.argv:
        redis_requested = True
        sys.argv.remove('--with-redis')
    else:
        redis_requested = False

    app = create_app(os.environ['OSMPOINT_WORKDIR'])
    manager = Manager(app, default_server_actions=True)
    manager.add_action('migrate_to_redis', migrate_to_redis_cmd)

    with maybe_redis_server(app, redis_requested):
        manager.run()
Esempio n. 4
0
#!/usr/bin/env python2
# -*- encoding:utf-8 -*-

from flask import Flask
from flaskext.actions import Manager
import settings
from helloproject import app

app.config.from_object(settings)
manager = Manager(app)

if __name__ == "__main__":
    manager.run()
Esempio n. 5
0
from webapp.models.instances import Instances
from webapp.models.addresses import Addresses

from webapp.libs.utils import query_yes_no, pprinttable, message
from webapp.libs.coinbase import coinbase_get_addresses, coinbase_checker
from webapp.libs.images import download_images
from webapp.libs.pool import pool_salesman, pool_connect

# configuration file
if os.path.isfile('./DEV'):
    app.config.from_object('config.DebugConfiguration')
else:
    app.config.from_object('config.BaseConfiguration')

# manager handler
manager = Manager(app, default_help_actions=False)


# user, what to do?
def configure_blurb():
    # get the appliance configuration
    appliance = db.session.query(Appliance).first()
    print "Visit http://%s/ to setup your appliance." % appliance.local_ip


# USERLAND METHODS
# reset the entire system
default_ip = "0.0.0.0"


def reset(app):
Esempio n. 6
0
# -*- encoding:utf-8 -*-
""" This management script is for compiling the database from lexicon
files, and testing that it has worked. Other Flask-Actions actions
are available here too. """

from flask import Flask
from flaskext.actions import Manager
from media_serv import create_app

import os

app, db = create_app()
app.test_request_context().push()

manager = Manager(app, default_server_actions=True)


def thing():
    from lexicon_models import Concept
    a = Concept(lemma='omg')
    b = Concept(lemma='bbq')
    a.translations_to.append(b)
    b.translations_from.append(a)


@manager.register('generate_key')
def generate_key(*args, **kwargs):
    import os

    def action():
        with open('secret_key', 'w') as F:
Esempio n. 7
0
# manage.py
#
# Some CLI Tools
#
# -*- encoding:utf-8 -*-

from flask import Flask
from flaskext.actions import Manager
import ponyexpress.manage

app = Flask(__name__)
app.config.from_envvar('PONYEXPRESS_CFG')
manager = Manager(app)


@manager.register('couch_sync')
def couch_sync(app):
    """
	Syncronize the locale views to couchdb
	"""
    return ponyexpress.manage.couch_sync


@manager.register('queue')
def queue(app):
    """
	Send all messages in a status of "queued"
	"""
    return ponyexpress.manage.queue

Esempio n. 8
0
def main():
    app = create_app(os.environ['OSMPOINT_WORKDIR'])
    manager = Manager(app, default_server_actions=True)
    manager.run()
Esempio n. 9
0
#!/usr/bin/env python2
# -*- encoding:utf-8 -*-

from flask import Flask
from flaskext.actions import Manager
import settings
from gioloveszoi import app
from gunicorn_server import run_gunicorn_server

app.config.from_object(settings)
manager = Manager(app)
manager.add_action("run_gunicorn", run_gunicorn_server)

if __name__ == "__main__":
    manager.run()

Esempio n. 10
0
#-*- coding:utf-8 -*-
from funtyping import app
from flaskext.actions import Manager

if __name__ == '__main__':
    manager = Manager(app, default_help_actions=False)
    manager.run()
Esempio n. 11
0
# manage.py
# -*- encoding:utf-8 -*-

from flask import Flask
from flaskext.actions import Manager
from edacc.web import app
from edacc import models
import re

manager = Manager(app)

def add_property(app):
    def action(db_name=('db','EDACC'), propertyType=('type', 0),
               propertySource=('source', 0), name=('name', ''), description=('desc', ''),
               regExp=('regExp', ''), value_type=('value_type', ''),
               multiple=('multiple', 0)):
        """Add a new property to the database.

        propertyType: Instance = 0, Result = 1
        propertySource: Instance = 0, InstanceName = 1, LauncherOutput = 2, Parameter = 3, SolverOutput = 4, VerifierOutput = 5, WatcherOutput = 6
        value_type: name of a PropertyValueType
        multiple: multiple occurences 1/0 for true/false

        Arguments in order:
        """
        db = models.get_database(db_name)

        p = db.session.query(db.Property).filter_by(name=name).first()
        if p is None:
            p = db.Property()
        p.propertyType = int(propertyType)
Esempio n. 12
0
from webapp.models.instances import Instances
from webapp.models.addresses import Addresses

from webapp.libs.utils import query_yes_no, pprinttable, message
from webapp.libs.coinbase import coinbase_get_addresses, coinbase_checker
from webapp.libs.pool import pool_salesman, pool_connect
from webapp.libs import task_lock

# configuration file
if os.path.isfile('./DEV'): 
	app.config.from_object('config.DebugConfiguration')
else:
	app.config.from_object('config.BaseConfiguration')

# manager handler
manager = Manager(app, default_help_actions=False)

# user, what to do?
def configure_blurb():
	# get the appliance configuration
	appliance = db.session.query(Appliance).first()
	print "Visit http://%s/ to setup your appliance." % appliance.local_ip

# USERLAND METHODS
# reset the entire system
default_ip = "0.0.0.0"
def reset(app):
	def action(ip=('i', default_ip)):
		"""
		Restores the appliance to factory default settings.
		"""
Esempio n. 13
0
# manage.py
# -*- encoding:utf-8 -*-

from flask import Flask
from flaskext.actions import Manager
from edacc.web import app
from edacc import models
import re

manager = Manager(app)


def add_property(app):
    def action(db_name=('db', 'EDACC'),
               propertyType=('type', 0),
               propertySource=('source', 0),
               name=('name', ''),
               description=('desc', ''),
               regExp=('regExp', ''),
               value_type=('value_type', ''),
               multiple=('multiple', 0)):
        """Add a new property to the database.

        propertyType: Instance = 0, Result = 1
        propertySource: Instance = 0, InstanceName = 1, LauncherOutput = 2, Parameter = 3, SolverOutput = 4, VerifierOutput = 5, WatcherOutput = 6
        value_type: name of a PropertyValueType
        multiple: multiple occurences 1/0 for true/false

        Arguments in order:
        """
        db = models.get_database(db_name)