Exemple #1
0
try:
    app.driver = driver.RouterDriver("/dev/ttyAMA0", app.software_only)
    app.driver.open()
except I2CIOError:
    print
    print "Cannot open I2C interface to a router board."
    print
    print_software_only_notice()
    sys.exit(-1)
except SerialIOError:
    print
    print "Cannot open serial interface to a router board."
    print
    print_software_only_notice()
    sys.exit(-1)

logging.info("Found %d dispensers." % app.driver.count())

app.options = load_options()
app.mixer = mixer.Mixer(app.driver, app.mc)
if app.software_only:
    logging.info(
        "Running SOFTWARE ONLY VERSION. No communication between software and hardware chain will happen!"
    )

logging.info("Bartendro starting")
app.debug = args.debug

if __name__ == '__main__':
    app.run(host=args.host, port=args.port)
        print
        print_software_only_notice()
        sys.exit(-1)
except:
    err = traceback.format_exc()
    if have_uwsgi:
        startup_err = err
    else:
        print
        print err
        print
        print_software_only_notice()
        sys.exit(-1)

app.startup_err = startup_err
if app.startup_err:
    logger.info("Bartendro failed to start:")
    logger.error(err)
else:
    app.options = load_options()
    app.mixer = mixer.Mixer(app.driver, app.mc)
    if app.software_only:
        logging.info("Running SOFTWARE ONLY VERSION. No communication between software and hardware chain will happen!")

    logging.info("Bartendro started")
    app.debug = args.debug
    app.version = version

if __name__ == '__main__':
    app.run(host=args.host, port=args.port)
    debug = False

try:
    app.software_only = int(os.environ['BARTENDRO_SOFTWARE_ONLY'])
    app.num_dispensers = 15
except KeyError:
    app.software_only = 0

# Create a memcache connection and flush everything
app.mc = memcache.Client(['127.0.0.1:11211'], debug=0)
app.mc.flush_all()

app.log = logging.getLogger('bartendro')

app.driver = driver.RouterDriver("/dev/ttyAMA0", app.software_only,
                                 mini_router)
app.driver.open()
app.log.info("Found %d dispensers." % app.driver.count())

app.mixer = mixer.Mixer(app.driver, app.mc, liquid_out)

if app.software_only:
    app.log.info(
        "Running SOFTWARE ONLY VERSION. No communication between software and hardware chain will happen!"
    )

app.log.info("Bartendro starting")

app.debug = debug
app.run(host='0.0.0.0', port=8080)
if len(sys.argv) > 1 and sys.argv[1] == "--debug":
    debug = True
else:
    debug = False

try: 
    app.software_only = int(os.environ['BARTENDRO_SOFTWARE_ONLY'])
    app.num_dispensers = 15
except KeyError:
    app.software_only = 0

# Create a memcache connection and flush everything
app.mc = memcache.Client(['127.0.0.1:11211'], debug=0)
app.mc.flush_all()

app.log = logging.getLogger('bartendro')

app.driver = driver.RouterDriver("/dev/ttyAMA0", app.software_only);
app.driver.open()
app.log.info("Found %d dispensers." % app.driver.count())

app.mixer = mixer.Mixer(app.driver, app.mc, liquid_out)

if app.software_only:
    app.log.info("Running SOFTWARE ONLY VERSION. No communication between software and hardware chain will happen!")

app.log.info("Bartendro starting")

app.debug = debug
app.run(host='0.0.0.0', port=8080)
    sys.exit(-1)


try:
    app.driver = driver.RouterDriver("/dev/ttyAMA0", app.software_only);
    app.driver.open()
except I2CIOError:
    print
    print "Cannot open I2C interface to a router board."
    print
    print_software_only_notice()
    sys.exit(-1)
except SerialIOError:
    print
    print "Cannot open serial interface to a router board."
    print
    print_software_only_notice()
    sys.exit(-1)

if app.software_only:
    app.log.info("Running SOFTWARE ONLY VERSION. No communication between software and hardware chain will happen!")

app.log.info("Found %d dispensers." % app.driver.count())

app.mixer = mixer.Mixer(app.driver, app.mc)

app.log.info("Bartendro starting")

app.debug = debug
app.run(host='127.0.0.1', port=8080)