--- /dev/null
+# mysql2sqlite: a program written, composed, and directed by danny campbell because sqlite and mysql are apparently too stupid to talk to each other. Possibly too stupid to live. --danny
+
+import MySQLdb
+import sqlite3
+
+# dominion dump from here: (mysql singlefile) http://www.eveonline.com/ingameboard.asp?a=topic&threadID=1258009
+# didn't use the sqlite singlefile because I only needed a tiny drop of the DB for the skil information. --danny
+mysqldb = MySQLdb.connect( user = "root", passwd = "password", db = "dominion_dump" )
+
+# grab all the group types that belong to category type 16. probably shouldn't hardcode these... --danny
+mysqlc = mysqldb.cursor()
+mysqlc.execute( """SELECT * FROM `invTypes` WHERE `groupID` = 255 OR `groupID` = 256 OR `groupID` = 257 OR `groupID` = 258 OR `groupID` = 266 OR `groupID` = 267 OR `groupID` = 268 OR `groupID` = 269 OR `groupID` = 270 OR `groupID` = 271 OR `groupID` = 272 OR `groupID` = 273 OR `groupID` = 274 OR `groupID` = 275 OR `groupID` = 278 OR `groupID` = 505 OR `groupID` = 989""" )
+
+# grab all rows from the query. --danny
+skills = mysqlc.fetchall()
+
+mysqlc.close()
+
+# add error checking, danny! --danny
+sqliteconn = sqlite3.connect( '/tmp/invTypes.sqlite' )
+sqlitec = sqliteconn.cursor()
+
+# the question marks just fill in the blanks using the tuple --danny
+for skill in skills:
+ sqlitec.execute( 'INSERT INTO invTypes VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )', skill )
+
+# why don't I need to commit on MySQLdb? --danny
+sqliteconn.commit()
+sqlitec.close()
--- /dev/null
+# skill_lookup.py: initialize it with the typeID from the XML file, and it will fetch the information we need that we can't find in the API, from the SQLite skills database I made. --danny
+
+import sqlite3
+
+class db_skill():
+
+ def __init__( self, type_id ):
+
+ # open the custom skill dump from cur dir. --danny
+ conn = sqlite3.connect( './invTypes.sqlite' )
+ c = conn.cursor()
+
+ # create a tuple out of the typeID --danny
+ t = ( type_id, )
+ c.execute( 'SELECT typeName, description, graphicID FROM invTypes WHERE typeID = ?', t )
+ # break up the tuple returned --danny
+ ( self.sk_name, self.sk_desc, self.sk_graphic_id ) = c.fetchone()
+ c.close()
+
+ # ( I don't even know if this how you should do this sort of thing, just playing around with classes.) --danny
+
+ def get_name( self ):
+ return self.sk_name
+
+ def get_desc( self ):
+ return self.sk_desc
--- /dev/null
+CREATE TABLE invTypes (
+ typeID smallint(6) NOT NULL,
+ groupID smallint(6) default NULL,
+ typeName varchar(100) default NULL,
+ description varchar(3000) default NULL,
+ graphicID smallint(6) default NULL,
+ radius double default NULL,
+ mass double default NULL,
+ volume double default NULL,
+ capacity double default NULL,
+ portionSize int(11) default NULL,
+ raceID tinyint(3) default NULL,
+ basePrice double default NULL,
+ published tinyint(1) default NULL,
+ marketGroupID smallint(6) default NULL,
+ chanceOfDuplicating double default NULL
+);