本文整理汇总了Python中kivy.config.ConfigParser.items方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigParser.items方法的具体用法?Python ConfigParser.items怎么用?Python ConfigParser.items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.config.ConfigParser
的用法示例。
在下文中一共展示了ConfigParser.items方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_program
# 需要导入模块: from kivy.config import ConfigParser [as 别名]
# 或者: from kivy.config.ConfigParser import items [as 别名]
def update_program(self):
"""Проверяет наличие обновлений на сервере github,com.
Проверяестя версия программы, версии плагинов, наличие измененных
программых файлов."""
if platform != "android":
print("Проверка обновлений:")
print("------------------------------------")
temp_path = "{}/Data/temp".format(core.prog_path)
if not os.path.exists(temp_path):
os.mkdir(temp_path)
update_file = urllib.urlopen(
"https://github.com/HeaTTheatR/HeaTDV4A/raw/master/"
"Data/uploadinfo.ini").read()
open("{}/uploadinfo.ini".format(temp_path), "w").write(
update_file)
config_update = ConfigParser()
config_update.read("{}/uploadinfo.ini".format(temp_path))
info_list_update = []
new_version_program = \
config_update.getfloat("info_update", "new_version_program")
updated_files_program = \
eval(config_update.get("info_update", "updated_files_program"))
dict_official_plugins_program = \
config_update.items("plugin_update")
official_plugins_program = dict(dict_official_plugins_program)
install_user_plugins = self.started_plugins
current_version_program = __version__
if platform != "android":
print("Проверка версии программы ...")
print("Проверка актуальности плагинов ...")
for plugin in install_user_plugins.keys():
try:
info_official_plugin = eval(official_plugins_program[plugin])
if info_official_plugin[plugin]['plugin-version'] > \
install_user_plugins[plugin]['plugin-version']:
info_list_update.append(info_official_plugin)
if platform != "android":
print("Плагин '{}' обновился до версии '{}'!".format(
plugin, info_official_plugin[plugin][
'plugin-version']))
except KeyError:
continue
if platform != "android":
print("Проверка обновлений завершена ...")
print("------------------------------------")
print()
if len(info_list_update) or new_version_program > \
current_version_program:
self.update = True
if platform != "android":
print("Доступны обновления!")
print("------------------------------------")
print()
else:
if platform != "android":
print("Обновлений нет!")
print("------------------------------------")
print()
示例2: Backlight_Control
# 需要导入模块: from kivy.config import ConfigParser [as 别名]
# 或者: from kivy.config.ConfigParser import items [as 别名]
# ===========================
# Control The Backlight
# ===========================
def Backlight_Control(light_status):
subproces.call('echo 0 > Light.SATUS')
# ========================
# Load the Defaults
# ========================
config = ConfigParser()
config.read('doorbell.ini')
CODES = ConfigParser()
CODES.read('codes.ini')
CODES_DICT = {s:dict(CODES.items(s)) for s in CODES.sections()}
NUMBERS = ConfigParser()
NUMBERS.read('numbers.ini')
NUMBERS_DICT = {s:dict(NUMBERS.items(s)) for s in NUMBERS.sections()}
LANGUAGES = ConfigParser()
LANGUAGES.read('languages.ini')
LANGUAGES_DICT = {s:dict(LANGUAGES.items(s)) for s in LANGUAGES.sections()}
# ===========================
# Load the Sound Effects
# ===========================
Sound_Click = SoundLoader.load(config.get('Sounds','Sound_Click'))