本文整理汇总了Python中database.DatabaseManager.create_tables方法的典型用法代码示例。如果您正苦于以下问题:Python DatabaseManager.create_tables方法的具体用法?Python DatabaseManager.create_tables怎么用?Python DatabaseManager.create_tables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database.DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager.create_tables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cli
# 需要导入模块: from database import DatabaseManager [as 别名]
# 或者: from database.DatabaseManager import create_tables [as 别名]
def cli(ctx, verbose, no_prompts):
ctx.obj = dict() # Context object that stores application state in dict, could make class at some point
ctx.obj['VERBOSE'] = verbose
ctx.obj['NO_PROMPTS'] = no_prompts
# Check for ucon64
try:
devnull = open(os.devnull)
subprocess.Popen(['ucon64'], stdout=devnull, stderr=devnull).communicate()
except OSError as e:
if e.errno == os.errno.ENOENT:
click.echo("WARNING: ucon64 not installed. Required for NES, SNES and N64 rom info.")
# Check for data root
if not os.path.exists(LOCAL_DATA_ROOT):
click.echo("Local data root not found, creating {}".format(LOCAL_DATA_ROOT))
os.makedirs(LOCAL_DATA_ROOT)
# Check for tables, extracted, game citation and performance citation
dbm.create_tables()
# Check for data directory
for data_path, path_name in ((LOCAL_GAME_DATA_STORE, "game data"), (LOCAL_CITATION_DATA_STORE, "citation data")):
if not os.path.exists(data_path):
click.echo("Local {} store: '{}' not found, creating...".format(path_name, data_path))
os.makedirs(data_path)