本文整理汇总了Python中siputils.inform函数的典型用法代码示例。如果您正苦于以下问题:Python inform函数的具体用法?Python inform怎么用?Python inform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了inform函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: patch_files
def patch_files():
"""Patch any files that need it."""
patched = (
("siplib", "sip.h"),
("siplib", "siplib.c"),
("siplib", "siplib.sbf")
)
# The siplib directory may not exist if we are building away from the
# source directory.
try:
os.mkdir("siplib")
except OSError:
pass
for f in patched:
dst_fn = os.path.join(*f)
src_fn = os.path.join(src_dir, dst_fn + ".in")
siputils.inform("Creating %s..." % dst_fn)
dst = open(dst_fn, "w")
src = open(src_fn)
for line in src:
line = line.replace("@[email protected]", opts.sip_module)
line = line.replace("@[email protected]", sip_module_base)
dst.write(line)
dst.close()
src.close()
开发者ID:Narengowda,项目名称:web-mouse,代码行数:33,代码来源:configure.py
示例2: create_config
def create_config(module, template, macros):
"""Create the SIP configuration module so that it can be imported by build
scripts.
module is the module file name.
template is the template file name.
macros is the dictionary of build macros.
"""
siputils.inform("Creating %s..." % module)
content = {
"sip_config_args": sys.argv[1:],
"sip_version": sip_version,
"sip_version_str": sip_version_str,
"platform": opts.platform,
"sip_bin": os.path.join(opts.sipbindir, "sip"),
"sip_inc_dir": opts.sipincdir,
"sip_mod_dir": opts.sipmoddir,
"default_bin_dir": plat_bin_dir,
"default_mod_dir": plat_py_site_dir,
"default_sip_dir": opts.sipsipdir,
"py_version": py_version,
"py_inc_dir": plat_py_inc_dir,
"py_conf_inc_dir": plat_py_conf_inc_dir,
"py_lib_dir": plat_py_lib_dir,
"universal": opts.universal
}
siputils.create_config_module(module, template, content, macros)
开发者ID:h4ck3rm1k3,项目名称:sip,代码行数:29,代码来源:configure.py
示例3: patch_files
def patch_files():
"""Patch any files that need it."""
patched = (
("siplib", "sip.h"),
("siplib", "siplib.c"),
("siplib", "siplib.sbf")
)
for f in patched:
dst_fn = os.path.join(*f)
src_fn = os.path.join(src_dir, dst_fn + ".in")
siputils.inform("Creating %s..." % dst_fn)
dst = open(dst_fn, "w")
src = open(src_fn)
for line in src:
line = line.replace("@[email protected]", opts.sip_module)
line = line.replace("@[email protected]", sip_module_base)
dst.write(line)
dst.close()
src.close()
开发者ID:Kanma,项目名称:sip,代码行数:26,代码来源:configure.py
示例4: main
def main(argv):
"""Create the configuration module module.
argv is the list of command line arguments.
"""
siputils.inform("This is SIP %s for Python %s on %s." % (sip_version_str, sys.version.split()[0], sys.platform))
if py_version < 0x020300:
siputils.error("This version of SIP requires Python v2.3 or later.")
# Basic initialisation.
set_platform_directories()
# Build up the list of valid specs.
for s in os.listdir("specs"):
platform_specs.append(s)
# Parse the command line.
global opts
set_defaults()
p = create_optparser()
print argv
opts, args = p.parse_args(argv[1:])
# Handle the query options.
if opts.show_platforms or opts.show_build_macros:
if opts.show_platforms:
show_platforms()
if opts.show_build_macros:
show_macros()
sys.exit()
# Convert the boolean 'universal' option to a string.
if opts.universal:
if '/' in opts.sdk:
opts.universal = os.path.abspath(opts.sdk)
else:
opts.universal = '/Developer/SDKs/' + opts.sdk
if not os.path.isdir(opts.universal):
siputils.error("Unable to find the SDK directory %s. Use the -s flag to specify the name of the SDK (e.g. %s) or its full path." % (opts.universal, DEFAULT_MACOSX_SDK))
else:
opts.universal = ''
# Get the platform specific macros for building.
macros = siputils.parse_build_macros(os.path.join("specs", opts.platform),
build_macro_names, args)
if macros is None:
p.print_help()
sys.exit(2)
# Tell the user what's been found.
inform_user()
# Install the configuration module.
create_config("sipconfig.py", "siputils.py", macros)
# Create the Makefiles.
create_makefiles(macros)
开发者ID:h4ck3rm1k3,项目名称:sip,代码行数:63,代码来源:configure.py
示例5: inform_user
def inform_user():
"""Tell the user the option values that are going to be used.
"""
siputils.inform("The SIP code generator will be installed in %s." % opts.sipbindir)
siputils.inform("The SIP module will be installed in %s." % opts.sipmoddir)
siputils.inform("The SIP header file will be installed in %s." % opts.sipincdir)
siputils.inform("The default directory to install .sip files in is %s." % opts.sipsipdir)
siputils.inform("The platform/compiler configuration is %s." % opts.platform)
if opts.universal:
siputils.inform("MacOS/X universal binaries will be created using %s." % opts.universal)
开发者ID:h4ck3rm1k3,项目名称:sip,代码行数:11,代码来源:configure.py
示例6: main
def main(argv):
"""Create the configuration module module.
argv is the list of command line arguments.
"""
siputils.inform("This is SIP %s for Python %s on %s." % (sip_version_str, sys.version.split()[0], sys.platform))
if py_version < 0x020300:
siputils.error("This version of SIP requires Python v2.3 or later.")
# Basic initialisation.
set_platform_directories()
# Build up the list of valid specs.
for s in os.listdir(os.path.join(src_dir, "specs")):
platform_specs.append(s)
# Parse the command line.
global opts
set_defaults()
p = create_optparser()
opts, args = p.parse_args()
# Make sure MacOS specific options get initialised.
if sys.platform != 'darwin':
opts.universal = ''
opts.arch = []
opts.sdk = ''
# Handle the query options.
if opts.show_platforms or opts.show_build_macros:
if opts.show_platforms:
show_platforms()
if opts.show_build_macros:
show_macros()
sys.exit()
# Convert the list 'arch' option to a string. Multiple architectures
# imply a universal binary.
if len(opts.arch) > 1:
opts.universal = True
opts.arch = ' '.join(opts.arch)
# Convert the boolean 'universal' option to a string.
if opts.universal:
if '/' in opts.sdk:
opts.universal = os.path.abspath(opts.sdk)
else:
opts.universal = MACOSX_SDK_DIR + '/' + opts.sdk
if not os.path.isdir(opts.universal):
siputils.error("Unable to find the SDK directory %s. Use the --sdk flag to specify the name of the SDK or its full path." % opts.universal)
if opts.arch == '':
opts.arch = DEFAULT_MACOSX_ARCH
else:
opts.universal = ''
# Get the platform specific macros for building.
macros = siputils.parse_build_macros(
os.path.join(src_dir, "specs", opts.platform), build_macro_names,
args)
if macros is None:
p.print_help()
sys.exit(2)
# Tell the user what's been found.
inform_user()
# Install the configuration module.
create_config("sipconfig.py", os.path.join(src_dir, "siputils.py"),
macros)
# Create the Makefiles.
create_makefiles(macros)
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:80,代码来源:configure.py
示例7: inform_user
def inform_user():
"""Tell the user the option values that are going to be used.
"""
siputils.inform("The SIP code generator will be installed in %s." % opts.sipbindir)
siputils.inform("The %s module will be installed in %s." % (sip_module_base, opts.sipmoddir))
siputils.inform("The sip.h header file will be installed in %s." % opts.sipincdir)
siputils.inform("The default directory to install .sip files in is %s." % opts.sipsipdir)
siputils.inform("The platform/compiler configuration is %s." % opts.platform)
if opts.arch:
siputils.inform("MacOS/X binaries will be created for %s." % (", ".join(opts.arch.split())))
if opts.universal:
siputils.inform("MacOS/X universal binaries will be created using %s." % opts.universal)
if opts.deployment_target:
siputils.inform("MacOS/X deployment target is %s." % opts.deployment_target)
开发者ID:Narengowda,项目名称:web-mouse,代码行数:17,代码来源:configure.py
示例8: main
def main(argv):
"""Create the configuration module module.
argv is the list of command line arguments.
"""
siputils.inform("This is SIP %s for Python %s on %s." % (sip_version_str, sys.version.split()[0], sys.platform))
global py_version, build_platform
if py_version < 0x020300:
siputils.error("This version of SIP requires Python v2.3 or later.")
# Basic initialisation.
set_platform_directories()
set_build_platform()
# Build up the list of valid specs.
for s in os.listdir(os.path.join(src_dir, "specs")):
platform_specs.append(s)
# Determine the directory containing the default OS/X SDK.
if sys.platform == "darwin":
for sdk_dir in MACOSX_SDK_DIRS:
if os.path.isdir(sdk_dir):
break
else:
sdk_dir = MACOSX_SDK_DIRS[0]
else:
sdk_dir = ""
# Parse the command line.
global opts
p = create_optparser(sdk_dir)
opts, args = p.parse_args()
# Override defaults that affect subsequent configuration.
if opts.target_py_version is not None:
py_version = opts.target_py_version
if opts.sysroot is not None:
global sysroot
sysroot = opts.sysroot
# Make sure MacOS specific options get initialised.
if sys.platform != "darwin":
opts.universal = ""
opts.arch = []
opts.sdk = ""
opts.deployment_target = ""
# Handle the query options.
if opts.show_platforms or opts.show_build_macros:
if opts.show_platforms:
show_platforms()
if opts.show_build_macros:
show_macros()
sys.exit()
# Convert the list 'arch' option to a string. Multiple architectures
# imply a universal binary.
if len(opts.arch) > 1:
opts.universal = True
opts.arch = " ".join(opts.arch)
# Convert the boolean 'universal' option to a string.
if opts.universal:
if "/" in opts.sdk:
opts.universal = os.path.abspath(opts.sdk)
else:
opts.universal = sdk_dir + "/" + opts.sdk
if not os.path.isdir(opts.universal):
siputils.error(
"Unable to find the SDK directory %s. Use the --sdk flag to specify the name of the SDK or its full path."
% opts.universal
)
if opts.arch == "":
opts.arch = DEFAULT_MACOSX_ARCH
else:
opts.universal = ""
# Apply the overrides from any configuration file.
global plat_bin_dir, plat_py_conf_inc_dir, plat_py_inc_dir
global plat_py_lib_dir, plat_py_site_dir, plat_sip_dir
global sip_bin_dir, sip_inc_dir, sip_module_dir, sip_sip_dir
# Set defaults.
sip_bin_dir = plat_bin_dir
sip_inc_dir = plat_py_venv_inc_dir
sip_module_dir = plat_py_site_dir
sip_sip_dir = plat_sip_dir
if opts.config_file is not None:
update_from_configuration_file(opts.config_file)
elif sysroot != "":
#.........这里部分代码省略.........
开发者ID:z80,项目名称:lcu03,代码行数:101,代码来源:configure.py
示例9: update_from_configuration_file
def update_from_configuration_file(config_file):
""" Update a number of globals from values read from a configuration file.
"""
siputils.inform("Reading configuration from %s..." % config_file)
config = {}
# Read the file into the dict.
cfg = open(config_file)
line_nr = 0
for l in cfg:
line_nr += 1
# Strip comments and blank lines.
l = l.split("#")[0].strip()
if l == "":
continue
parts = l.split("=", 1)
if len(parts) == 2:
name = parts[0].strip()
value = parts[1].strip()
else:
name = value = ""
if name == "" or value == "":
siputils.error("%s:%d: Invalid line." % (config_file, line_nr))
config[name] = value
last_name = name
cfg.close()
# Enforce the presets.
version = siputils.version_to_string(py_version).split(".")
config["py_major"] = version[0]
config["py_minor"] = version[1]
config["sysroot"] = sysroot
# Override the relevent values.
global py_platform, plat_py_conf_inc_dir, plat_py_inc_dir, plat_py_lib_dir
global sip_bin_dir, sip_inc_dir, sip_module_dir, sip_sip_dir
py_platform = _get_configuration_value(config, "py_platform", py_platform)
plat_py_inc_dir = _get_configuration_value(config, "py_inc_dir", plat_py_inc_dir)
plat_py_lib_dir = _get_configuration_value(config, "py_pylib_dir", plat_py_lib_dir)
# The pyconfig.h directory defaults to the Python.h directory.
plat_py_conf_inc_dir = _get_configuration_value(config, "py_conf_inc_dir", plat_py_inc_dir)
sip_bin_dir = _get_configuration_value(config, "sip_bin_dir", sip_bin_dir)
sip_module_dir = _get_configuration_value(config, "sip_module_dir", sip_module_dir)
# Note that this defaults to any 'py_inc_dir' specified in the
# configuration file.
sip_inc_dir = _get_configuration_value(config, "sip_inc_dir", plat_py_inc_dir)
# Note that this is only used when creating sipconfig.py.
sip_sip_dir = _get_configuration_value(config, "sip_sip_dir", sip_sip_dir)
开发者ID:z80,项目名称:lcu03,代码行数:61,代码来源:configure.py
示例10: inform_user
def inform_user():
""" Tell the user the option values that are going to be used. """
if not opts.no_tools:
siputils.inform("The SIP code generator will be installed in %s." % sip_bin_dir)
siputils.inform("The %s module will be installed in %s." % (sip_module_base, sip_module_dir))
if opts.static:
siputils.inform("The %s module will be built as a static library." % sip_module_base)
siputils.inform("The sip.h header file will be installed in %s." % sip_inc_dir)
siputils.inform("The default directory to install .sip files in is %s." % sip_sip_dir)
if opts.use_qmake is None:
siputils.inform("The platform/compiler configuration is %s." % build_platform)
if opts.arch:
siputils.inform("MacOS/X binaries will be created for %s." % (", ".join(opts.arch.split())))
if opts.universal:
siputils.inform("MacOS/X universal binaries will be created using %s." % opts.universal)
if opts.deployment_target:
siputils.inform("MacOS/X deployment target is %s." % opts.deployment_target)
开发者ID:z80,项目名称:lcu03,代码行数:25,代码来源:configure.py
注:本文中的siputils.inform函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论