本文整理匯總了Python中cjh.cli.Cli.text_splash方法的典型用法代碼示例。如果您正苦於以下問題:Python Cli.text_splash方法的具體用法?Python Cli.text_splash怎麽用?Python Cli.text_splash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cjh.cli.Cli
的用法示例。
在下文中一共展示了Cli.text_splash方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from cjh.cli import Cli [as 別名]
# 或者: from cjh.cli.Cli import text_splash [as 別名]
def main():
"""
Lets user browse and preview skins for the Goban class.
"""
goban = Goban(sh_obj=SHELL, size=9)
if __name__ == '__main__':
while True:
choice = Cli.make_page(func=lambda: SHELL.list_menu(LIST_OBJ))
skinfile = LIST_OBJ[choice - 1]
try:
if SHELL.py_version == 2:
goban.skin_dict = json.load(open('skins/' + skinfile, 'rb'))
elif SHELL.py_version == 3:
file_ptr = open('skins/{}'.format(skinfile), 'rb')
text_buffer = file_ptr.read().decode('utf-8')
goban.skin_dict = json.loads(text_buffer)
except IOError:
Cli.text_splash(Cli.box("File Error with '{}'".format(
skinfile)), duration=0)
SHELL.wait()
continue
goban.cursor = [0, 0]
Cli.text_splash("== Now give '{}' a try! ==".format(
skinfile), duration=1, flashes=4)
goban.view_edit()