本文整理汇总了Python中java.util.Properties.store方法的典型用法代码示例。如果您正苦于以下问题:Python Properties.store方法的具体用法?Python Properties.store怎么用?Python Properties.store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Properties
的用法示例。
在下文中一共展示了Properties.store方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_versions
# 需要导入模块: from java.util import Properties [as 别名]
# 或者: from java.util.Properties import store [as 别名]
def save_versions(self):
print "save versions"
versionsProperties = Properties()
outFile = FileOutputStream(self.versionsFileName)
versionsProperties.setProperty("script", self.app.SCRIPTVERSION)
versionsProperties.setProperty("tools", self.app.TOOLSVERSION)
versionsProperties.store(outFile, None)
outFile.close()
示例2: savePreviousArguments
# 需要导入模块: from java.util import Properties [as 别名]
# 或者: from java.util.Properties import store [as 别名]
def savePreviousArguments(managedServerName):
from java.io import File
from java.io import FileOutputStream
from java.util import Properties
from java.util import Date
from java.text import SimpleDateFormat
import string
startToEdit()
# parameter on the wsdl ant task call
fileLocation = sys.argv[1].replace("\\","/")
print "The backup file location is"
print fileLocation
try:
dateFormat = SimpleDateFormat('_d_MMM_yyyy_HH_mm_ss')
date = Date()
formattedDate = dateFormat.format(date)
print formattedDate
except:
print "The date cannot be created/formatted"
try:
propsFile = File(fileLocation+ managedServerName + formattedDate+"_config.bkp");
print propsFile.exists()
if(propsFile.exists() == 0):
propsFile.createNewFile()
except:
print "The file cannot be created on:"
print propsFile.getAbsoluteFile()
dumpStack()
previousProperties = Properties()
print '===> Saving the previous arguments - ' + managedServerName
cd('/Servers/'+managedServerName)
print "Getting the VMArgs"
vmArgs = cmo.getServerStart().getArguments()
print vmArgs
if vmArgs == None:
vmArgs = ""
previousProperties.setProperty("vmArgs", vmArgs)
print "Saving Arguments to file"
previousProperties.store(FileOutputStream(propsFile),None)
print '===> Saved arguments! Please verify the file on:'+ fileLocation + "in" + managedServerName