本文整理汇总了Python中FileDict.FileDict.iteritems方法的典型用法代码示例。如果您正苦于以下问题:Python FileDict.iteritems方法的具体用法?Python FileDict.iteritems怎么用?Python FileDict.iteritems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileDict.FileDict
的用法示例。
在下文中一共展示了FileDict.iteritems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fromDir
# 需要导入模块: from FileDict import FileDict [as 别名]
# 或者: from FileDict.FileDict import iteritems [as 别名]
#.........这里部分代码省略.........
ff.write("#$ -V\n")
ff.write("#$ -l h_rt=72:00:00\n") # timeout
ff.write("#$ -l mem_free=%s\n" % (self.mem_free()))
ff.write("#$ -M [email protected]\n")
ff.write("#$ -m as\n") # a=aborted b=begining e=end s=suspended
ff.write("#$ -o %s\n" % self.logDir)
ff.write(cmd + " && echo -e \"finished\\t`date +\"%%Y-%%m-%%d %%H:%%M:%%S\"`\" >> %s\n" % (self.metaOpt.filename))
ff.write('\n')
ff.close()
return f
def prepare(self):
# java and jar
cmd = 'java'
if self.jar() != 'None':
if not os.path.isfile(self.jar()):
raise Exception('JAR file provide is not a file! ' + self.jar())
cmd += " -jar %s \\\n\t" % (self.jar())
jarMD5 = subprocess.check_output("sha1sum %s" % (self.jar()), shell=True).strip()
self.metaOpt.setValue('jar-sha1', jarMD5)
# class path, assert
cmd += ' -cp ' + self.class_path() + ' \\\n\t'
#cmd += ' -cp ' + self.class_path() + ':' + self.home + ' \\\n\t'
if self.use_asserts():
cmd += ' -ea \\\n\t'
# profiling
if self.profile():
cmd += ' -agentlib:hprof=cpu=samples,depth=20,heap=sites \\\n\t'
# java options
for k,v in self.javaOpt.iteritems():
if not k.startswith('-D'):
k = '-D'+k
cmd += " %s=\"%s\" \\\n\t" % (k,v)
# main class
cmd += ' '+self.main_class() + ' \\\n\t'
# command line arguments
args = self.command_line_args()
for a in args:
cmd += " %s \\\n\t\t" % (a)
# generate a shell script for SGE
self.writeQsubScript(cmd)
self.prepared = True
def setSubmission(self, class_path, main_class, args, jar=None, xmx='2G', mem_free='3G', \
profile=False, asserts=True, actuallySubmit=False):
f = codecs.open(os.path.join(self.home, 'command_line_args.txt'), 'w', 'utf-8')
for a in args:
f.write(a + '\n')
f.close()
xmx = canonicalMemoryDescription(xmx)
mem_free = canonicalMemoryDescription(mem_free)
if jar is None: jar = 'None'
self.metaOpt.setValue('jar', jar)
self.metaOpt.setValue('main_class', main_class)
self.metaOpt.setValue('class_path', class_path)
self.metaOpt.setValue('xmx', xmx)