本文整理汇总了Python中util.call函数的典型用法代码示例。如果您正苦于以下问题:Python call函数的具体用法?Python call怎么用?Python call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了call函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: configureOpenDJ
def configureOpenDJ(d):
cwd = os.getcwd()
print 'Configure openDJ (openDS), working directory: %s' % cwd
tup = (d['dsHome'], d['ldapHost'], d['ldapDN'], d['ldapPW'], d['ldapPort'], cwd, d['dataGeneratedFile'])
if d['platform'] == "windows":
actions = ['%s\\bat\\stop-ds.bat' % d['dsHome'],
'copy %s\\%s %s\\config\\schema' % (cwd, d['schemaFN'], d['dsHome']),
'copy %s\\%s %s\\config\\schema' % (cwd, d['userSchemaFN'], d['dsHome']),
'%s\\bat\\start-ds.bat' % d['dsHome'],
'%s\\bat\\dsconfig.bat set-global-configuration-prop -h %s -p 4444 --trustAll --no-prompt -D "%s" -w %s --set single-structural-objectclass-behavior:accept' % tup[:-3],
'%s\\bat\\dsconfig.bat -h %s -p 4444 --trustAll --no-prompt -D "%s" -w %s set-password-policy-prop --policy-name "Default Password Policy" --set allow-pre-encoded-passwords:true' % tup[:-3],
'%s\\bat\\dsconfig.bat set-backend-prop --backend-name userRoot --add base-dn:%s -h %s -p 4444 -D "%s" -w %s --trustAll --noPropertiesFile --no-prompt' %
(d['dsHome'], d['suffix'], d['ldapHost'], d['ldapDN'], d['ldapPW']),
'%s\\bat\\ldapmodify.bat -h %s -D "%s" -w %s -a -p %s -f %s\\%s' % tup]
else:
actions = ['%s/bin/stop-ds' % d['dsHome'],
'cp %s/%s %s/config/schema' % (cwd, d['schemaFN'], d['dsHome']),
'cp %s/%s %s/config/schema' % (cwd, d['userSchemaFN'], d['dsHome']),
'%s/bin/start-ds' % d['dsHome'],
'%s/bin/dsconfig set-global-configuration-prop -h %s -p 4444 --trustAll --no-prompt -D "%s" -w %s --set single-structural-objectclass-behavior:accept' % tup[:-3],
'%s/bin/dsconfig -h %s -p 4444 --trustAll --no-prompt -D "%s" -w %s set-password-policy-prop --policy-name "Default Password Policy" --set allow-pre-encoded-passwords:true' % tup[:-3],
'%s/bin/dsconfig set-backend-prop --backend-name userRoot --add base-dn:%s -h %s -p 4444 -D "%s" -w %s --trustAll --noPropertiesFile --no-prompt' %
(d['dsHome'], d['suffix'], d['ldapHost'], d['ldapDN'], d['ldapPW']),
'%s/bin/ldapmodify -h %s -D "%s" -w %s -a -p %s -f %s/%s' % tup]
util.call(actions)
开发者ID:GluuFederation,项目名称:install,代码行数:27,代码来源:configureDS.py
示例2: run_test
def run_test(self, name, path, num_cores, args=[]):
"""
Run a single test.
"""
try:
# Compile the program
(exit, output) = call([COMPILE, path+'/'+name+'.sire']
+ ['-t', 'mpi', '-n', '{}'.format(num_cores)] + args)
self.assertTrue(exit)
# Simulate execution
(exit, output) = call([SIMULATE, '-np', '{}'.format(num_cores), 'a.out']
+ SIM_FLAGS)
self.assertTrue(exit)
# Check the output against the .output file
self.assertEqual(output.strip(),
read_file(path+'/'+name+'.output').strip())
except Exception as e:
sys.stderr.write('Error: {}\n'.format(e))
raise
except:
sys.stderr.write("Unexpected error: {}\n".format(sys.exc_info()[0]))
raise
开发者ID:xcore,项目名称:tool_sire,代码行数:27,代码来源:tests.py
示例3: assemble_builtins
def assemble_builtins(show_calls, v):
vmsg(v, 'Compiling builtins:')
for x in BUILTIN_FILES:
objfile = x+'.o'
vmsg(v, ' '+x+' -> '+objfile)
util.call([CC, config.MPI_SYSTEM_PATH+'/'+x,
'-o', objfile] + ASSEMBLE_FLAGS, show_calls)
开发者ID:xcore,项目名称:tool_sire,代码行数:7,代码来源:build.py
示例4: clone
def clone(self, name, **kwargs):
args = []
for k,v in kwargs:
args += ['-o', '{0}={1}'.format(k,v)]
call(['/sbin/zfs','clone'] + args + [self.name, name])
return FileSystem(name)
开发者ID:Simage,项目名称:pyzfs,代码行数:7,代码来源:zfs.py
示例5: assemble_runtime
def assemble_runtime(show_calls, v):
vmsg(v, 'Compiling runtime:')
for x in RUNTIME_FILES:
objfile = x+'.o'
vmsg(v, ' '+x+' -> '+objfile)
util.call([MPICC, config.MPI_RUNTIME_PATH+'/'+x,
'-o', objfile] + ASSEMBLE_FLAGS, show_calls)
开发者ID:xcore,项目名称:tool_sire,代码行数:7,代码来源:build.py
示例6: replace_images
def replace_images(show_calls, v):
vmsg(v, 'Creating new executable')
util.call([XCC, target_2core(), config.XS1_RUNTIME_PATH+'/container.xc', '-o', FINAL_XE])
util.call([XOBJDUMP, '--split', MASTER_XE], v=show_calls)
util.call([XOBJDUMP, FINAL_XE, '-r', '0,0,image_n0c0.elf'], v=show_calls)
util.call([XOBJDUMP, '--split', SLAVE_XE], v=show_calls)
util.call([XOBJDUMP, FINAL_XE, '-r', '0,1,image_n0c0.elf'], v=show_calls)
开发者ID:xcore,项目名称:tool_sire,代码行数:7,代码来源:build.py
示例7: start
def start(d):
tomcatBin = os.path.join(d['tomcatHome'], "bin")
tomcatHome = os.path.normpath(d['tomcatHome'])
tomcatBin = os.path.normpath(tomcatBin)
print "Set CATALINA_HOME=%s" % tomcatHome
os.environ["CATALINA_HOME"] = tomcatHome
tomcatJavaOpts = d['tomcatJavaOpts']
print "Set JAVA_OPTS=%s" % tomcatJavaOpts
os.environ["JAVA_OPTS"] = tomcatJavaOpts
if d['platform'] == "windows":
actions = [
'%s\\startup.bat -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512' % (tomcatBin) # starts tomcat
]
else:
actions = [
'%s/startup.sh -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512' % (tomcatBin) # starts tomcat
]
util.call(actions)
#start(config.getConfigDir())
开发者ID:GluuFederation,项目名称:install,代码行数:25,代码来源:starter.py
示例8: create
def create(cls, name, **kwargs):
if cls.check(name):
raise Exception("FileSystem already exists")
args = []
for k,v in kwargs:
args += ['-o', '{0}={1}'.format(k,v)]
call(['/sbin/zfs','create'] + args + [name])
return cls(name)
开发者ID:Simage,项目名称:pyzfs,代码行数:8,代码来源:zfs.py
示例9: randomHourMinutes
def randomHourMinutes():
"""
Generates random trips for an hour in Eichstaett, then simulates and outputs minutely.
"""
calls = randomHourMinutes_calls()
print 'Generating trips...'
call(calls[0])
print 'Running SUMO simulation...'
return call(calls[1])
开发者ID:orlade,项目名称:simmer-timer,代码行数:9,代码来源:sumo.py
示例10: dump_memory_use
def dump_memory_use():
TEXT = 0
DATA = 1
BSS = 2
TOTAL = 3
def size(v):
return '{:>6} {:>8}'.format(v, '({:,.2f}KB)'.format(v/1000))
s = util.call([XOBJDUMP, '--size', MASTER_XE])
m = re.findall(r' *([0-9]+) *([0-9]+) *([0-9]+) *([0-9]+)', s)
master_sizes = [int(x) for x in m[0]]
assert len(m) == 1
s = util.call([XOBJDUMP, '--size', SLAVE_XE])
m = re.findall(r' *([0-9]+) *([0-9]+) *([0-9]+) *([0-9]+)', s)
slave_sizes = [int(x) for x in m[0]]
assert len(m) == 1
print('Total memory: '+size(defs.RAM_SIZE))
print()
print('Kernel stack space: '+size(defs.KERNEL_SPACE))
print('Thread stack space: '+size(defs.THREAD_STACK_SPACE))
print('Number of threads: {:>6}'.format(defs.MAX_THREADS))
thread_stack_use = defs.MAX_THREADS*defs.THREAD_STACK_SPACE
total_stack_use = thread_stack_use+defs.KERNEL_SPACE
print('Total thread stack use: '+size(thread_stack_use))
print('Total stack use: '+size(total_stack_use))
print()
runtime_size = slave_sizes[TEXT]+slave_sizes[DATA]
program_size = master_sizes[TEXT]+master_sizes[DATA]-runtime_size
print('Runtime size: '+size(runtime_size))
print('Program size: '+size(program_size))
print()
print('Master memory use: ')
print(' text: '+size(master_sizes[TEXT]))
print(' data: '+size(master_sizes[DATA]))
print(' bss: '+size(master_sizes[BSS]))
print(' stack: '+size(total_stack_use))
print(' '+('-'*39))
master_total = master_sizes[TOTAL]+total_stack_use
master_remaining = defs.RAM_SIZE - master_total
print(' Total: '+size(master_total))
print(' Remaining: '+size(master_remaining))
print()
print('Slave memory use: ')
print(' text: '+size(slave_sizes[TEXT]))
print(' data: '+size(slave_sizes[DATA]))
print(' bss: '+size(slave_sizes[BSS]))
print(' stack: '+size(total_stack_use))
print(' '+('-'*39))
slave_total = slave_sizes[TOTAL]+total_stack_use
slave_remaining = defs.RAM_SIZE - slave_total
print(' Total: '+size(slave_total))
print(' Remaining: '+size(slave_remaining))
开发者ID:xcore,项目名称:tool_sire,代码行数:57,代码来源:build.py
示例11: update
def update(self):
changes = ['{0.name}={0.value}'.format(prop)
for prop in self.properties.values()
if prop._needsupdate()]
if len(changes) == 0:
return
call(['/sbin/zfs','set'] + changes + [self.parent])
for prop in self.properties.values():
prop.reset()
开发者ID:Simage,项目名称:pyzfs,代码行数:9,代码来源:zfs.py
示例12: configure
def configure(arguments):
""" Configures the build based on the supplied arguments. """
build_path = util.get_build_path(arguments)
try:
makedirs(build_path)
except OSError:
pass
util.call(['cmake', '-B' + build_path, '-H' + util.get_base_path()] + create_options(arguments))
开发者ID:bzsolt,项目名称:gepard,代码行数:10,代码来源:build.py
示例13: run_clean
def run_clean(arguments):
""" Cleans the build directory. """
build_path = util.get_build_path(arguments)
try:
check_configured(arguments)
except Error:
return
util.call(['make', '-s', '-C', build_path, 'clean'])
开发者ID:GepardGraphics,项目名称:gepard,代码行数:10,代码来源:build.py
示例14: _umount
def _umount(self):
if self.mount:
# check if exists
call(['/sbin/umount','-a','-F',self.mount])
if self.devfs:
call(['/sbin/umount',self.rootdir+'/dev'])
if self.procfs:
call(['/sbin/umount',self.rootdir+'/proc'])
if self.ports:
call(['/sbin/umount',self.rootdir+'/usr/ports/distfiles'])
call(['/sbin/umount',self.rootdir+'/usr/ports'])
开发者ID:wagnerrp,项目名称:pyjail,代码行数:11,代码来源:jail.py
示例15: store
def store(self, force=False):
if (self.id in self._loaded):
if not force:
return
call(['/sbin/devfs','rule','-s',str(self.id),'delset'])
self._loaded.remove(self.id)
for line in self:
call(['/sbin/devfs','rule','-s',str(self.id)]+line.split())
self._loaded.append(self.id)
开发者ID:wagnerrp,项目名称:pyjail,代码行数:11,代码来源:devfs.py
示例16: git_commit
def git_commit(self):
tmp_file = tempfile.mkstemp(suffix='.txt')
try:
f = open(tmp_file[1], 'w')
f.write(self.commit_msg)
f.close()
util.call([self.conf['git_binary'], 'commit', '-F', tmp_file[1], '-e'], cwd=self.conf['hadoop_repo_directory'])
return self
finally:
os.remove(tmp_file[1])
开发者ID:haohui,项目名称:hdcli,代码行数:11,代码来源:commit.py
示例17: compile_str
def compile_str(name, string, show_calls, v, save_temps=True):
"""
Compile a buffer containing an XC program.
"""
srcfile = name + '.xc'
outfile = name + '.S'
vmsg(v, 'Compiling '+srcfile+' -> '+outfile)
util.write_file(srcfile, string)
util.call([XCC, srcfile, '-o', outfile] + COMPILE_FLAGS, v=show_calls)
if not save_temps:
os.remove(srcfile)
开发者ID:xcore,项目名称:tool_sire,代码行数:11,代码来源:build.py
示例18: link
def link(show_calls, v):
"""
Link the complete executable.
"""
vmsg(v, 'Linking executable -> '+BINARY)
util.call([MPICC, 'program.c.o']
+ [x+'.o' for x in RUNTIME_FILES]
+ [x+'.o' for x in BUILTIN_FILES]
+ ['-o', BINARY]
+ LINK_FLAGS,
show_calls)
开发者ID:xcore,项目名称:tool_sire,代码行数:11,代码来源:build.py
示例19: assemble_str
def assemble_str(name, string, show_calls, v, cleanup=True):
"""
Assemble a buffer containing a c program.
"""
srcfile = name + '.c'
outfile = name + '.o'
vmsg(v, 'Assembling '+srcfile+' -> '+outfile)
util.write_file(srcfile, string)
util.call([MPICC, srcfile, '-o', outfile] + ASSEMBLE_FLAGS, show_calls)
if cleanup:
os.remove(srcfile)
开发者ID:xcore,项目名称:tool_sire,代码行数:11,代码来源:build.py
示例20: mktx
def mktx(input_addrs, output_addrs, amount=AMOUNT):
tf = tempfile.NamedTemporaryFile()
command = "sx mktx %s" % tf.name
inputs = query_unspent_outputs(input_addrs, amount)
if inputs is None:
return None
for tx_input in inputs:
command += " --input %s" % tx_input
for address in output_addrs:
command += " --output %s:%s" % (address, amount)
call(command)
return tf.read()
开发者ID:alt-project,项目名称:crypto,代码行数:12,代码来源:mktx.py
注:本文中的util.call函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论