(
      self, conn, event, bundle_id, app_version, app_path, now)
Insert usage data into application usage table.

    Args:
      conn: sqlite3.Connection object
      event: str
      bundle_id: str
      app_version: str
      app_path: str
      now: int
Insert usage data into application usage table.
Insert usage data into application usage table .
def _InsertApplicationUsage(
      self, conn, event, bundle_id, app_version, app_path, now):
    """Insert usage data into application usage table.

    Args:
      conn: sqlite3.Connection object
      event: str
      bundle_id: str
      app_version: str
      app_path: str
      now: int
    """
    # this looks weird, but it's the simplest way to do an update or insert
    # operation in sqlite, and atomically update number_times, that I could
    # figure out.  plus we avoid using transactions and multiple SQL
    # statements in most cases.

    v = (app_version, app_path, now, event, bundle_id)
    q = conn.execute(APPLICATION_USAGE_TABLE_UPDATE, v)
    if q.rowcount == 0:
      number_times = 1
      v = (event, bundle_id, app_version, app_path, now, number_times)
      conn.execute(APPLICATION_USAGE_TABLE_INSERT, v)
def _InsertApplicationUsage ( self , conn , event , bundle_id , app_version , app_path , now ) : # this looks weird, but it's the simplest way to do an update or insert # operation in sqlite, and atomically update number_times, that I could # figure out.  plus we avoid using transactions and multiple SQL # statements in most cases. v = ( app_version , app_path , now , event , bundle_id ) q = conn . execute ( APPLICATION_USAGE_TABLE_UPDATE , v ) if q . rowcount == 0 : number_times = 1 v = ( event , bundle_id , app_version , app_path , now , number_times ) conn . execute ( APPLICATION_USAGE_TABLE_INSERT , v )