示例#1
0
def main():
    
    try:
        
        
        parse_command_line()
        Configuration.initialize()
        import features.logging as chikka_sms_api_logger
        l = chikka_sms_api_logger.GeneralLogger()
        
        app_type = options.app
        port = options.port
        debug = True
        

        if debug:
            print "[!!!DEBUG MODE!!!]"
            bind_to_cpu = -2

        log_method='file'
        scribe_host=None
        scribe_port = 1234
        category = 'smsapi_access'
        server_ip = '10.11.2.225'

        app = application_factory[app_type]



        ghttp_args = {
                      "port": port,
                      "bind_to_cpu": int(bind_to_cpu)
                      }


        l.info('running gtornado at %s/%s' %  ( os.path.dirname(os.path.realpath(__file__)), __file__ ), { 'settings': ghttp_args} )

        if options.config != 'prod':
            ghttp_args['log_method'] = 'file'

        
        http_server = GHTTPServer(app, **ghttp_args )
        
        #start the server
        http_server.start()
        GIOLoop.instance().start()
        
        
        
    except KeyboardInterrupt:
        
        pass
示例#2
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 )