Exemplo n.º 1
0
def main():
    values = Configuration.values()

    print values
    dbconn = SQLUtils(
        host=values['mysql-db']['sms_api_config']['host'],
        port=values['mysql-db']['sms_api_config']['port'],
        database=values['mysql-db']['sms_api_config']['db'],
        user=values['mysql-db']['sms_api_config']['user'],
        password=values['mysql-db']['sms_api_config']['password'])

    result = dbconn.run_query(query_type="select", query=query, fetchall=True)

    q = []

    for r in result:
        client_id = create_sha256_signature(r['suffix'], r['email'])
        secret_key = create_client_id(r['email'])
        print client_id, secret_key, r['email']

        print update_query % (client_id, secret_key, r['id'])
        q.append(update_query % (client_id, secret_key, r['id']))
        dbconn.run_query("update", update_query, None, None)
        '-------------------------'

    for i in q:
        print i + ';'
Exemplo n.º 2
0
def web( *args, **kwargs ):
    
    
    configuration = { 'log_method' : 'file'}
    configuration.update( Configuration.values() )
    
    from application import Application
    return Application( configuration )
Exemplo n.º 3
0
    def __init__(self):
        '''
            @description:
                - initializes DB connections
                and other configurations
        '''
        self.pool = Pool(1000)  # used for spawning threads

        values = Configuration.values()

        # -- initializes DB --
        self.dbconn = SQLUtils(
            host=values['mysql-db']['sms_api_config']['host'],
            port=values['mysql-db']['sms_api_config']['port'],
            database=values['mysql-db']['sms_api_config']['db'],
            user=values['mysql-db']['sms_api_config']['user'],
            password=values['mysql-db']['sms_api_config']['password'])

        print '-------'
        print 'DB:'
        print 'port: %s' % values['mysql-db']['sms_api_config']['host']
        print 'host: %s' % values['mysql-db']['sms_api_config']['port']
        print 'db: %s' % values['mysql-db']['sms_api_config']['db']
        print 'user: %s' % values['mysql-db']['sms_api_config']['user']
        print 'password: %s' % values['mysql-db']['sms_api_config']['password']
        print '-------'

        # -- initializes dragonpay related config --
        self.api_url = values['dragonpay']['api_url']
        self.merchant_id = values['dragonpay']['merchant_id']
        self.secret_key = values['dragonpay']['secret_key']
        self.host = values['dragonpay']['host']
        self.api_get_txn_status_url = values['dragonpay'][
            'api_get_txn_status_url']
        self.uri = values['dragonpay']['uri']

        parse_command_line()

        if options.config == 'prod':
            url = URL('https://%s' % values['dragonpay']['host'])
        else:
            url = URL('http://%s' % values['dragonpay']['host'])

        self.http_conn = HTTPClient.from_url(url, concurrency=10)
Exemplo n.º 4
0
from gevent.monkey import patch_all
patch_all()
from tornado.options import define, options, parse_command_line, print_help
from features.configuration import Configuration


define("config", default='debug', help="run configuration settings", type=str)
define("local_settings", default="true", help="enable/disable use of local settings", type=str)


if __name__ == '__main__':


    parse_command_line()
    Configuration.initialize()
    
    values = Configuration.values()
    
    from features.paypal.paypal_checkout_model import PaypalPaymentCheckout

    checkout = PaypalPaymentCheckout.get( checkout_id=372 ) 
    #checkout.set_paypal_pending_payment_flag()

    checkout.clear_paypal_pending_payment_flag()



    print 'flag is for', checkout.get_paypal_pending_payment_flag( account_id=checkout.account_id )
Exemplo n.º 5
0
the reason why it is in a separate directory is because it must be initialized 
independently from other utils. this is to avoid loading connections before the app starts

it was a case when loading the fluent logger util loads its parent util __init__.py which should
not be allowed

@author: vincent agudelo

'''

print 'init fluent logger'

from features.configuration import Configuration
from pprint import pprint

general_config = Configuration.values()

fluent_config = general_config['fluent_logger']
fluentd_config = {}

cfg = fluent_config['general']
fluentd_config['general_config'] = {
    'tag': cfg['tag'],
    'host': cfg['host'],
    'port': cfg['port'],
    'verbose': cfg['verbose']
}
cfg = fluent_config['payment']
fluentd_config['payment_config'] = {
    'tag': cfg['tag'],
    'host': cfg['host'],
Exemplo n.º 6
0
def undermaintenance( *args, **kwargs ):    
    configuration = { 'log_method' : 'file'}
    configuration.update( Configuration.values() )
    
    from application_undermaintenance import ApplicationUnderMaintenance
    return ApplicationUnderMaintenance( configuration )