本文整理汇总了Python中SCons.Warnings.warn方法的典型用法代码示例。如果您正苦于以下问题:Python Warnings.warn方法的具体用法?Python Warnings.warn怎么用?Python Warnings.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCons.Warnings
的用法示例。
在下文中一共展示了Warnings.warn方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RCSFactory
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def RCSFactory(env=env):
""" """
import SCons.Warnings as W
W.warn(W.DeprecatedSourceCodeWarning, """The RCS() factory is deprecated and there is no replacement.""")
act = SCons.Action.Action("$RCS_COCOM", "$RCS_COCOMSTR")
return SCons.Builder.Builder(action=act, env=env)
示例2: SubversionFactory
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def SubversionFactory(repos, module="", env=env):
""" """
# fail if repos is not an absolute path name?
import SCons.Warnings as W
W.warn(W.DeprecatedSourceCodeWarning, """The Subversion() factory is deprecated and there is no replacement.""")
if module != "":
module = os.path.join(module, "")
act = SCons.Action.Action("$SVNCOM", "$SVNCOMSTR")
return SCons.Builder.Builder(action=act, env=env, SVNREPOSITORY=repos, SVNMODULE=module)
示例3: CVSFactory
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def CVSFactory(repos, module="", env=env):
""" """
import SCons.Warnings as W
W.warn(W.DeprecatedSourceCodeWarning, """The CVS() factory is deprecated and there is no replacement.""")
# fail if repos is not an absolute path name?
if module != "":
# Don't use os.path.join() because the name we fetch might
# be across a network and must use POSIX slashes as separators.
module = module + "/"
env["CVSCOM"] = "$CVS $CVSFLAGS co $CVSCOFLAGS -d ${TARGET.dir} $CVSMODULE${TARGET.posix}"
act = SCons.Action.Action("$CVSCOM", "$CVSCOMSTR")
return SCons.Builder.Builder(action=act, env=env, CVSREPOSITORY=repos, CVSMODULE=module)
示例4: download
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def download(url, filename):
if os.path.exists(filename):
C.progress_display('Package already downloaded')
return True
try:
urllib.urlretrieve(url, filename)
return True
except IOError as e:
# In Python 2.x, 'urlretrieve' raises IOError upon HTTP errors,
# except for some errors such as 404. Oh well.
W.warn(AltaDependencyWarning,
"{0}: download failed: {1}".format(url, e.strerror))
return False
示例5: cmake_build
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def cmake_build(rep, options = ''):
os.chdir(rep)
# Construct the CMake command
build_dir = os.pardir + os.sep + 'build' + os.sep
cmake_cmd = ['cmake', '-DBUILD_SHARED_LIBS=OFF',
'-DCMAKE_INSTALL_PREFIX=' + build_dir,
'-DCMAKE_BUILD_TYPE=Release']
if os.name == 'nt' :
cmake_cmd = cmake_cmd + ['-G', 'NMake Makefiles']
try:
ret = Popen(cmake_cmd + options.split() + ['.']).wait()
if ret != 0:
C.progress_display('Warning: unable to configure package' + rep)
os.chdir(os.pardir)
return False
except OSError as e:
W.warn(AltaDependencyWarning, "execution of '{0}' failed: {1}".format(cmake_cmd, e.strerror))
os.chdir(os.pardir)
return False
# Construct the build command and run it
build_cmd = []
if os.name == 'nt':
build_cmd = build_cmd + ['nmake']
else:
build_cmd = build_cmd + ['make']
ret = Popen(build_cmd + ['install']).wait()
if ret != 0:
C.progress_display('Warning: unable to build & install package ' + rep)
os.chdir(os.pardir)
return False
os.chdir(os.pardir)
return True
示例6: PerforceFactory
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def PerforceFactory(env=env):
""" """
import SCons.Warnings as W
W.warn(W.DeprecatedSourceCodeWarning, """The Perforce() factory is deprecated and there is no replacement.""")
return SCons.Builder.Builder(action = PerforceAction, env = env)
示例7: SCCSFactory
# 需要导入模块: from SCons import Warnings [as 别名]
# 或者: from SCons.Warnings import warn [as 别名]
def SCCSFactory(env=env):
""" """
import SCons.Warnings as W
W.warn(W.DeprecatedSourceCodeWarning, """The SCCS() factory is deprecated and there is no replacement.""")
act = SCons.Action.Action('$SCCSCOM', '$SCCSCOMSTR')
return SCons.Builder.Builder(action = act, env = env)