def maybe_create_tables(self):
try:
self.db.get("SELECT COUNT(*) from entries;")
except MySQLdb.ProgrammingError:
subprocess.check_call(['mysql',
'--host=' + options.mysql_host,
'--database=' + options.mysql_database,
'--user=' + options.mysql_user,
'--password=' + options.mysql_password],
stdin=open('schema.sql'))
评论列表
文章目录