本文整理汇总了Python中distutils.util.split_quoted方法的典型用法代码示例。如果您正苦于以下问题:Python util.split_quoted方法的具体用法?Python util.split_quoted怎么用?Python util.split_quoted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.util
的用法示例。
在下文中一共展示了util.split_quoted方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_f77flags
# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import split_quoted [as 别名]
def get_f77flags(src):
"""
Search the first 20 lines of fortran 77 code for line pattern
`CF77FLAGS(<fcompiler type>)=<f77 flags>`
Return a dictionary {<fcompiler type>:<f77 flags>}.
"""
flags = {}
f = open_latin1(src, 'r')
i = 0
for line in f:
i += 1
if i>20: break
m = _f77flags_re.match(line)
if not m: continue
fcname = m.group('fcname').strip()
fflags = m.group('fflags').strip()
flags[fcname] = split_quoted(fflags)
f.close()
return flags
# TODO: implement get_f90flags and use it in _compile similarly to get_f77flags
示例2: flaglist
# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import split_quoted [as 别名]
def flaglist(s):
if is_string(s):
return split_quoted(s)
else:
return s
示例3: set_command
# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import split_quoted [as 别名]
def set_command(self, key, value):
if not key in self._executable_keys:
raise ValueError(
"unknown executable '%s' for class %s" %
(key, self.__class__.__name__))
if is_string(value):
value = split_quoted(value)
assert value is None or is_sequence_of_strings(value[1:]), (key, value)
self.executables[key] = value
######################################################################
## Methods that subclasses may redefine. But don't call these methods!
## They are private to FCompiler class and may return unexpected
## results if used elsewhere. So, you have been warned..
示例4: set_executables
# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import split_quoted [as 别名]
def set_executables(self, **args):
"""Define the executables (and options for them) that will be run
to perform the various stages of compilation. The exact set of
executables that may be specified here depends on the compiler
class (via the 'executables' class attribute), but most will have:
compiler the C/C++ compiler
linker_so linker used to create shared objects and libraries
linker_exe linker used to create binary executables
archiver static library creator
On platforms with a command-line (Unix, DOS/Windows), each of these
is a string that will be split into executable name and (optional)
list of arguments. (Splitting the string is done similarly to how
Unix shells operate: words are delimited by spaces, but quotes and
backslashes can override this. See
'distutils.util.split_quoted()'.)
"""
# Note that some CCompiler implementation classes will define class
# attributes 'cpp', 'cc', etc. with hard-coded executable names;
# this is appropriate when a compiler class is for exactly one
# compiler/OS combination (eg. MSVCCompiler). Other compiler
# classes (UnixCCompiler, in particular) are driven by information
# discovered at run-time, since there are many different ways to do
# basically the same things with Unix C compilers.
for key in args.keys():
if key not in self.executables:
raise ValueError, \
"unknown executable '%s' for class %s" % \
(key, self.__class__.__name__)
self.set_executable(key, args[key])
示例5: set_executable
# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import split_quoted [as 别名]
def set_executable(self, key, value):
if isinstance(value, str):
setattr(self, key, split_quoted(value))
else:
setattr(self, key, value)
示例6: set_executable
# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import split_quoted [as 别名]
def set_executable(self, key, value):
if isinstance(value, basestring):
setattr(self, key, split_quoted(value))
else:
setattr(self, key, value)