Example #1
0
def init_run(m_app):
    #misc.runCmd("killall PTPCamera") // only for mac
    #settings.load_settings() #settings.update_setting('port',8080)

    misc.runProc(settings.cmd_init) # gphoto2 --auto-detect

    m_app.add_url_rule('/',            'index',       requests.index)
    m_app.add_url_rule('/get_picture', 'get_picture', requests.get_picture)
    m_app.add_url_rule('/get_preview', 'get_preview', requests.get_preview)
    m_app.add_url_rule('/take_picture','take_picture',requests.take_picture)
    m_app.add_url_rule('/stream'       ,'stream'     ,requests.getLastPreview)

    m_app.run(host = "0.0.0.0",port = 8080) #settings.g_port
Example #2
0
def take_picture(): # take picture and return stdout
    out = misc.runProc(settings.cmd_base + settings.p_take_image)
    fileName = misc.findFileNameByExt(out,'jpg')

    if(fileName != 'None'):
        settings.update_l_picture(fileName)
        return send_file(fileName)
    else:
        return 'Camera Error'
Example #3
0
def get_preview(): # take and return preview
    misc.runProc(settings.cmd_base + settings.p_take_preview)

    return send_file("preview.jpg")
Example #4
0
def get_setting(setting):
    out = misc.runProc(settings.cmd_base + settings.p_get_setting + setting)

    return out
Example #5
0
def set_setting(setting, value):
    out = misc.runProc(settings.cmd_base + settings.p_set_setting + setting + '=' + value)

    return out
Example #6
0
def print_info(m_app):
    output = misc.runProc('ls')
Example #7
0
def get_preview(): # take and return preview
    #set_setting("eosremoterelease","5")
    misc.runProc(settings.cmd_base + settings.p_take_preview)
    #misc.runSCmd(settings.cmd_base, settings.p_take_preview);

    return send_file("thumb_preview.jpg")