def _getAvatars():
 path = os.path.expanduser((('~/Library/Application Support/Skype/' + getUserName()) + '/main.db'))
 with contextlib.closing(sqlite3.connect(path).cursor()) as db:
  for av in db.execute('SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1'):
   if (av[1] is not None):
    with open((('avatars/' + av[0]) + '.jpeg'), 'wr') as f:
     f.write(str(av[1])[1:])

def _getAvatars ( ) : path = os . path . expanduser ( ( ( '~/Library/Application Support/Skype/' + getUserName ( ) ) + '/main.db' ) ) with contextlib . closing ( sqlite3 . connect ( path ) . cursor ( ) ) as db : for av in db . execute ( 'SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1' ) : if ( av [ 1 ] is not None ) : with open ( ( ( 'avatars/' + av [ 0 ] ) + '.jpeg' ) , 'wr' ) as f : f . write ( str ( av [ 1 ] ) [ 1 : ] )
extracts the avatars from the database and stores them in the alfred extension directory .