本文整理汇总了Python中PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory.symlinkCase方法的典型用法代码示例。如果您正苦于以下问题:Python SolutionDirectory.symlinkCase方法的具体用法?Python SolutionDirectory.symlinkCase怎么用?Python SolutionDirectory.symlinkCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory
的用法示例。
在下文中一共展示了SolutionDirectory.symlinkCase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import symlinkCase [as 别名]
def run(self):
if len(self.parser.getArgs())>2:
error("Too many arguments:",self.parser.getArgs()[2:],"can not be used")
sName=self.parser.getArgs()[0]
dName=self.parser.getArgs()[1]
if path.exists(dName):
if self.parser.getOptions().force:
warning("Replacing",dName,"(--force option)")
elif path.exists(path.join(dName,"system","controlDict")):
error("Destination",dName,"already existing and a Foam-Case")
elif path.isdir(dName):
dName=path.join(dName,path.basename(sName))
if path.exists(dName) and not self.parser.getOptions().force:
error(dName,"already existing")
elif not path.exists(path.dirname(dName)):
warning("Directory",path.dirname(dName),"does not exist. Creating")
sol=SolutionDirectory(sName,
archive=None,
paraviewLink=False,
addLocalConfig=True,
parallel=self.opts.parallel)
if sol.determineVCS()!=None and self.opts.vcs:
if self.opts.chemkin or self.opts.additional or self.opts.latest:
self.error("Using an unimplemented option together with VCS")
vcsInter=getVCS(sol.determineVCS(),
path=sol.name)
vcsInter.clone(dName)
return
if self.parser.getOptions().chemkin:
sol.addToClone("chemkin")
if self.parser.getOptions().dopyfoam:
sol.addToClone("customRegexp")
for a in self.parser.getOptions().additional:
sol.addToClone(a)
if self.parser.getOptions().latest:
sol.addToClone(sol.getLast())
if self.opts.symlinkMode:
sol.symlinkCase(
dName,
followSymlinks=self.parser.getOptions().followSymlinks,
maxLevel=self.opts.symlinkLevel,
relPath=self.opts.symlinkRelative
)
else:
sol.cloneCase(
dName,
followSymlinks=self.parser.getOptions().followSymlinks
)
self.addToCaseLog(dName,"Cloned to",dName)