本文整理汇总了Python中SCons.Warnings类的典型用法代码示例。如果您正苦于以下问题:Python Warnings类的具体用法?Python Warnings怎么用?Python Warnings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Warnings类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RCSFactory
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
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
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: PerforceFactory
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)
示例5: SCCSFactory
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)
示例6: download
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
示例7: cmake_build
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