unify some strings and remove misleading comment

This commit is contained in:
steffen123 2010-10-09 14:02:39 +02:00
parent 9ce2e8939b
commit dfd47cfbfb
2 changed files with 11 additions and 13 deletions

View File

@ -1068,43 +1068,43 @@ class Database:
if cons:
pass
else:
print _("creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
try:
c.execute("alter table " + fk['fktab'] + " add foreign key ("
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
+ fk['rcol'] + ")")
except:
print _(" create foreign key failed: ") + str(sys.exc_info())
print _("Create foreign key failed: ") + str(sys.exc_info())
elif self.backend == self.PGSQL:
print _("creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
try:
c.execute("alter table " + fk['fktab'] + " add constraint "
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
+ " foreign key (" + fk['fkcol']
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
except:
print _(" create foreign key failed: ") + str(sys.exc_info())
print _("Create foreign key failed: ") + str(sys.exc_info())
else:
return -1
for idx in self.indexes[self.backend]:
if idx['drop'] == 1:
if self.backend == self.MYSQL_INNODB:
print _("creating mysql index "), idx['tab'], idx['col']
print _("Creating mysql index %s %s") % (idx['tab'], idx['col'])
try:
s = "alter table %s add index %s(%s)" % (idx['tab'],idx['col'],idx['col'])
c.execute(s)
except:
print _(" create foreign key failed: ") + str(sys.exc_info())
print _("Create foreign key failed: ") + str(sys.exc_info())
elif self.backend == self.PGSQL:
# pass
# mod to use tab_col for index name?
print _("creating pg index "), idx['tab'], idx['col']
print _("Creating pg index "), idx['tab'], idx['col']
try:
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
c.execute(s)
except:
print _(" create index failed: ") + str(sys.exc_info())
print _("Create index failed: ") + str(sys.exc_info())
else:
return -1
@ -1253,7 +1253,7 @@ class Database:
s = "create index %s on %s(%s)" % (idx['col'],idx['tab'],idx['col'])
self.get_cursor().execute(s)
except:
print _(" create index failed: ") + str(sys.exc_info())
print _("Create index failed: ") + str(sys.exc_info())
elif self.backend == self.PGSQL:
# mod to use tab_col for index name?
print _("Creating pgsql index %s %s") %(idx['tab'], idx['col'])
@ -1262,7 +1262,7 @@ class Database:
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
self.get_cursor().execute(s)
except:
print _(" create index failed: ") + str(sys.exc_info())
print _("Create index failed: ") + str(sys.exc_info())
elif self.backend == self.SQLITE:
print _("Creating sqlite index %s %s") %(idx['tab'], idx['col'])
log.debug(_("Creating sqlite index %s %s") %(idx['tab'], idx['col']))
@ -1278,7 +1278,7 @@ class Database:
self.connection.set_isolation_level(1) # go back to normal isolation level
except:
print _("Error creating indexes: ") + str(sys.exc_value)
raise FpdbError( "Error creating indexes " + str(sys.exc_value) )
raise FpdbError("Error creating indexes: " + str(sys.exc_value) )
#end def createAllIndexes
def dropAllIndexes(self):

View File

@ -3055,8 +3055,6 @@ class Sql:
order by stats.category, stats.limitType, stats.bigBlindDesc desc
<orderbyseats>, cast(stats.PlPosition as smallint)
"""
#elif db_server == 'sqlite':
# self.query['playerStatsByPosition'] = """ """
####################################
# Cash Game Graph query