def udpateDatabaseFromKippt():
 global settings
 if (not os.path.exists(os.path.join(alp.local(), settings['sqliteDB']))):
  createDatabase()
 clips = readAllClips()
 if (clips == None):
  return
 conn = lite.connect(settings['sqliteDB'])
 with conn:
  cur = conn.cursor()
  cur.execute('DELETE FROM Clips')
  for clip in clips:
   title = clip['title']
   subtitle = clip['title']
   url = clip['url']
   app_url = clip['app_url']
   notes = clip['notes']
   sql = 'INSERT INTO Clips VALUES(NULL,'
   sql += ('"%s",' % title)
   sql += ('"%s",' % subtitle)
   sql += ('"%s",' % url)
   sql += ('"%s",' % app_url)
   sql += ('"%s"' % notes)
   sql += ')'
   cur.execute(sql)

def udpateDatabaseFromKippt ( ) : global settings if ( not os . path . exists ( os . path . join ( alp . local ( ) , settings [ 'sqliteDB' ] ) ) ) : createDatabase ( ) clips = readAllClips ( ) if ( clips == None ) : return conn = lite . connect ( settings [ 'sqliteDB' ] ) with conn : cur = conn . cursor ( ) cur . execute ( 'DELETE FROM Clips' ) for clip in clips : title = clip [ 'title' ] subtitle = clip [ 'title' ] url = clip [ 'url' ] app_url = clip [ 'app_url' ] notes = clip [ 'notes' ] sql = 'INSERT INTO Clips VALUES(NULL,' sql += ( '"%s",' % title ) sql += ( '"%s",' % subtitle ) sql += ( '"%s",' % url ) sql += ( '"%s",' % app_url ) sql += ( '"%s"' % notes ) sql += ')' cur . execute ( sql )
update the sqlite database with all clips from kippt .