Ejemplo n.º 1
0
 def open_db_temp(self, tmpfile):
     self.database = tmpfile
     self.db = sqlite.connect(self.database)  #, isolation_level=None)
     self.db.text_factory = lambda x: unicode(x, "utf-8", "ignore")
     self.cursor = self.db.cursor(factory=DictCursor)
     if not os.path.exists(thumbnails.get_dir()):
         os.mkdir(thumbnails.get_dir())
Ejemplo n.º 2
0
	def open_db_temp(self, tmpfile):
		self.database = tmpfile
		self.db = sqlite.connect(self.database) #, isolation_level=None )
		self.db.text_factory = lambda x: unicode(x, "utf-8", "ignore")
		self.cursor = self.db.cursor( factory=DictCursor )
		if not os.path.exists(thumbnails.get_dir()):
			os.mkdir(thumbnails.get_dir())
Ejemplo n.º 3
0
 def __extract_thumbnails_from_db(self):
     print("Extracting thumbnails from database")
     rows = self.sql("select id, img from thumbnails")
     if not os.path.exists(thumbnails.get_dir()):
         os.mkdir(thumbnails.get_dir())
     for row in rows:
         open('/tmp/gnomecatalog_icon.png', 'wb').write(row['img'])
         thumbnails.save_from_file(row['id'], '/tmp/gnomecatalog_icon.png')
Ejemplo n.º 4
0
	def __extract_thumbnails_from_db(self):
		print "Extracting thumbnails from database"
		rows = self.sql("select id, img from thumbnails")
		if not os.path.exists(thumbnails.get_dir()):
			os.mkdir(thumbnails.get_dir())
		for row in rows:
			open('/tmp/gnomecatalog_icon.png', 'wb').write(row['img'])
			thumbnails.save_from_file(row['id'], '/tmp/gnomecatalog_icon.png')
Ejemplo n.º 5
0
	def open_db_temp(self, tmpfile):
		self.database = tmpfile
		self.db = sqlite.connect(self.database) #, isolation_level=None )
		self.cursor = self.db.cursor( factory=DictCursor )
		if not os.path.exists(thumbnails.get_dir()):
			os.mkdir(thumbnails.get_dir())