本文整理匯總了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)