本文整理汇总了Python中properties.Properties.save方法的典型用法代码示例。如果您正苦于以下问题:Python Properties.save方法的具体用法?Python Properties.save怎么用?Python Properties.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类properties.Properties
的用法示例。
在下文中一共展示了Properties.save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addLibrariesToProject
# 需要导入模块: from properties import Properties [as 别名]
# 或者: from properties.Properties import save [as 别名]
def addLibrariesToProject(self, libs):
if self.main:
path = self.mainPath()
mkPath = os.path.join(path, "mk.cfg")
props = Properties(mkPath)
lst = props.get("LINK_LIBS").split(",")
lst = [x for x in lst if len(x) > 0]
for l in libs:
lst.append(l)
props.assign("LINK_LIBS", ",".join(lst))
props.save(mkPath)
self.depsChanged.emit(path)
示例2: editDependencies
# 需要导入模块: from properties import Properties [as 别名]
# 或者: from properties.Properties import save [as 别名]
def editDependencies(self):
item = self.currentItem()
path = item.data(0, DirectoryRole).toString()
mkPath = os.path.join(path, "mk.cfg")
props = Properties(mkPath)
libs = re.split("\W+", props.get("LINK_LIBS"))
d = DependenciesDialog(libs)
if d.exec_():
props.assign("LINK_LIBS", ",".join(d.libs))
props.save(mkPath)
self.depsChanged.emit(path)
return True
return False
示例3: editDebugSettings
# 需要导入模块: from properties import Properties [as 别名]
# 或者: from properties.Properties import save [as 别名]
def editDebugSettings(self):
item = self.currentItem()
path = item.data(0, DirectoryRole).toString()
mkPath = os.path.join(path, "mk.cfg")
props = Properties(mkPath)
d = uis.loadDialog("debug_settings")
d.cwdEdit.setText(props.get("DEBUG_CWD"))
d.paramsEdit.setText(props.get("DEBUG_PARAMS"))
d.browseDirButton.clicked.connect(lambda: utils.browseDirectory(d.cwdEdit))
if d.exec_():
props.assign("DEBUG_CWD", d.cwdEdit.text())
props.assign("DEBUG_PARAMS", d.paramsEdit.text())
self.debug = (d.cwdEdit.text(), d.paramsEdit.text())
props.save(mkPath)
示例4: save
# 需要导入模块: from properties import Properties [as 别名]
# 或者: from properties.Properties import save [as 别名]
def save(self, path):
props = Properties(path)
for (name, tab) in self.tabs:
tab.save(props)
props.save(path)