本文整理汇总了Python中octoprint.util.dict_merge方法的典型用法代码示例。如果您正苦于以下问题:Python util.dict_merge方法的具体用法?Python util.dict_merge怎么用?Python util.dict_merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类octoprint.util
的用法示例。
在下文中一共展示了util.dict_merge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_slicer_profile
# 需要导入模块: from octoprint import util [as 别名]
# 或者: from octoprint.util import dict_merge [as 别名]
def save_slicer_profile(self, path, profile, allow_overwrite=True, overrides=None):
from octoprint.util import dict_merge
if overrides is not None:
new_profile = dict_merge(profile.data, overrides)
else:
new_profile = profile.data
self._save_profile(path, new_profile, allow_overwrite=allow_overwrite, display_name=profile.display_name, description=profile.description)
示例2: __init__
# 需要导入模块: from octoprint import util [as 别名]
# 或者: from octoprint.util import dict_merge [as 别名]
def __init__(self):
import logging
global default_settings
self._logger = logging.getLogger("octoprint.plugins.flashforge")
self._logger.debug("__init__")
self._comm = None
self._serial_obj = None
self._currentFile = None
self._upload_percent = 0
self._vendor_id = 0
self._vendor_name = ""
self._device_id = 0
# FlashForge friendly default connection settings
self._conn_settings = {
'neverSendChecksum': True,
'sdAlwaysAvailable': True,
'timeout': {
'temperature': 2,
'temperatureAutoreport': 0,
'sdStatusAutoreport': 0
},
'helloCommand': "M601 S0",
'abortHeatupOnCancel': False
}
self._feature_settings = {
'autoUppercaseBlacklist': ['M146'] # LED control requires lowercase r,g,b
}
default_settings["serial"] = dict_merge(default_settings["serial"], self._conn_settings)
default_settings["feature"] = dict_merge(default_settings["feature"], self._feature_settings)
##~~ SettingsPlugin mixin