本文整理汇总了Python中console.Console.corrupt_settings方法的典型用法代码示例。如果您正苦于以下问题:Python Console.corrupt_settings方法的具体用法?Python Console.corrupt_settings怎么用?Python Console.corrupt_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类console.Console
的用法示例。
在下文中一共展示了Console.corrupt_settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _load_cfg
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import corrupt_settings [as 别名]
def _load_cfg(self):
"""
Laad settings uit config bestand.
"""
if not os.path.exists(SETTINGSPATH):
os.makedirs(SETTINGSPATH)
try:
with open(SETTINGSFILE, 'rb') as f:
self.music, self.sound = pickle.load(f)
Console.load_settings()
except (pickle.UnpicklingError, FileNotFoundError, EOFError):
Console.corrupt_settings()
self.music, self.sound = True, True
self.write_cfg()
示例2: _load_cfg
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import corrupt_settings [as 别名]
def _load_cfg(self):
"""
Laad settings uit config bestand.
"""
if not os.path.exists(SETTINGSPATH):
os.makedirs(SETTINGSPATH)
try:
with open(SETTINGSFILE, 'rb') as f:
self.fullscreen, self.window_frame = pickle.load(f)
Console.load_settings()
except (pickle.UnpicklingError, FileNotFoundError, EOFError, TypeError):
Console.corrupt_settings()
self.fullscreen = False
self.window_frame = True
self.write_cfg()