Mercurial > hg > ltpdarepo
changeset 31:28b5b21ce8dd
Whitespace.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Mon, 27 Jun 2011 19:04:27 +0200 |
parents | 1b37af4b842c |
children | d0d44e440598 |
files | src/ltpdarepo/database.py |
diffstat | 1 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ltpdarepo/database.py Mon Jun 27 18:57:46 2011 +0200 +++ b/src/ltpdarepo/database.py Mon Jun 27 19:04:27 2011 +0200 @@ -20,7 +20,7 @@ class Database(object): __slots__ = ('id', 'name', 'description') - + def __init__(self, id='', name='', description=''): self.id = id self.name = name @@ -45,8 +45,8 @@ def create(self): curs = g.db.cursor() - - curs.execute("""CREATE DATABASE `%s`""" % self.id) + + curs.execute("""CREATE DATABASE `%s`""" % self.id) curs.execute("""INSERT INTO available_dbs (db_name, name, description) VALUES (%s, %s, %s)""", (self.id, self.name, self.description)) @@ -76,7 +76,7 @@ g.db.commit() -def initdb(conn, database): +def initdb(conn, database): curs = conn.cursor() # store current database @@ -97,7 +97,7 @@ `mdlfilename` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `bobjs` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `obj_id` int(11) default NULL COMMENT 'ID of the object this data set belongs to', @@ -105,21 +105,21 @@ PRIMARY KEY (`id`), KEY `object_index` (`obj_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `cdata` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `xunits` text COMMENT 'Units of the x axis', `yunits` text COMMENT 'Units of the y axis', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `collections` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `nobjs` int(11) default NULL COMMENT 'Number of objects in a collection', `obj_ids` text COMMENT 'List of objects in a collection', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `fsdata` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `xunits` text COMMENT 'Units of the x axis', @@ -127,7 +127,7 @@ `fs` DOUBLE default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `mfir` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `obj_id` int(11) default NULL COMMENT 'The ID of the object this data set belongs to', @@ -135,7 +135,7 @@ `fs` DOUBLE default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `miir` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `obj_id` int(11) default NULL COMMENT 'ID of the object this data set belongs to', @@ -143,7 +143,7 @@ `fs` DOUBLE default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `objmeta` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'A unique ID of every data set in this table', `obj_id` int(11) default NULL COMMENT 'The ID of the object this data set belongs to', @@ -168,7 +168,7 @@ `author` TEXT DEFAULT NULL COMMENT 'Author of the object', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `objs` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every object in this database', `xml` longtext COMMENT 'Raw XML representation of the object', @@ -176,7 +176,7 @@ `hash` text COMMENT 'MD5 hash of an object', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `transactions` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `obj_id` int(11) default NULL COMMENT 'ID of the object the transaction belongs to', @@ -185,7 +185,7 @@ `direction` text COMMENT 'Direction of the transaction', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `tsdata` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `xunits` text COMMENT 'Units of the x axis', @@ -195,7 +195,7 @@ `t0` datetime default NULL COMMENT 'Starting time of the time series', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `users` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `firstname` text COMMENT 'The first name of the user', @@ -206,7 +206,7 @@ `institution` text COMMENT 'Institution of the user', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1""") - + curs.execute("""CREATE TABLE `xydata` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID of every data set in this table', `xunits` text COMMENT 'Units of the x axis',