当前位置: 首页>>代码示例>>Python>>正文


Python Warnings.warn方法代码示例

本文整理汇总了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)
开发者ID:ckrisgarrett,项目名称:closures-2d,代码行数:9,代码来源:RCS.py

示例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)
开发者ID:IljaGrebel,项目名称:OpenWrt-SDK-imx6_HummingBoard,代码行数:12,代码来源:Subversion.py

示例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)
开发者ID:lijenpan,项目名称:mapnik,代码行数:15,代码来源:CVS.py

示例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
开发者ID:belcour,项目名称:alta,代码行数:16,代码来源:obtain.py

示例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
开发者ID:belcour,项目名称:alta,代码行数:40,代码来源:obtain.py

示例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)
开发者ID:IljaGrebel,项目名称:OpenWrt-SDK-imx6_HummingBoard,代码行数:7,代码来源:Perforce.py

示例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)
开发者ID:601040605,项目名称:Nuitka,代码行数:8,代码来源:SCCS.py


注:本文中的SCons.Warnings.warn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。