# -*- coding: utf-8 -*- import sqlite3 import urllib # TwitterBase is supposed to be a shared log/cache of Twitter information class TwitterBase (): def __init__ ( self ): self.con = sqlite3.connect( "TwitterBase.sqlite" ); self.cursor = self.con.cursor(); def __del__ ( self ): self.close(); def getIcon ( self, url ): # Check DB first # Look in cache # Fetch if needed try: urllib.urlretrieve( url, filename ); except: return "missing.png"