def evcam(camera, freq=1.0, maxrate=None, loglevel=0, logfile=None, pidfile=None, timer=None, app=None):
 app = app_or_default(app)
 if pidfile:
  platforms.create_pidlock(pidfile)
 app.log.setup_logging_subsystem(loglevel, logfile)
 print(u'-> evcam: Taking snapshots with {0} (every {1} secs.)'.format(camera, freq))
 state = app.events.State()
 cam = instantiate(camera, state, app=app, freq=freq, maxrate=maxrate, timer=timer)
 cam.install()
 conn = app.connection_for_read()
 recv = app.events.Receiver(conn, handlers={u'*': state.event})
 try:
  recv.capture(limit=None)
 except KeyboardInterrupt:
  raise SystemExit
 finally:
  cam.cancel()
  conn.close()

def evcam ( camera , freq = 1.0 , maxrate = None , loglevel = 0 , logfile = None , pidfile = None , timer = None , app = None ) : app = app_or_default ( app ) if pidfile : platforms . create_pidlock ( pidfile ) app . log . setup_logging_subsystem ( loglevel , logfile ) print ( u'-> evcam: Taking snapshots with {0} (every {1} secs.)' . format ( camera , freq ) ) state = app . events . State ( ) cam = instantiate ( camera , state , app = app , freq = freq , maxrate = maxrate , timer = timer ) cam . install ( ) conn = app . connection_for_read ( ) recv = app . events . Receiver ( conn , handlers = { u'*' : state . event } ) try : recv . capture ( limit = None ) except KeyboardInterrupt : raise SystemExit finally : cam . cancel ( ) conn . close ( )
start snapshot recorder .