本文整理汇总了Python中pip.log.logger.warn方法的典型用法代码示例。如果您正苦于以下问题:Python logger.warn方法的具体用法?Python logger.warn怎么用?Python logger.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块pip.log.logger的用法示例。

在下文中一共展示了logger.warn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: switch

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def switch(self, dest, url, rev_options):

repo_config = os.path.join(dest, self.dirname, 'hgrc')

config = ConfigParser.SafeConfigParser()

try:

config.read(repo_config)

config.set('paths', 'default', url)

config_file = open(repo_config, 'w')

config.write(config_file)

config_file.close()

except (OSError, ConfigParser.NoSectionError):

e = sys.exc_info()[1]

logger.warn(

'Could not switch Mercurial repository to %s: %s'

% (url, e))

else:

call_subprocess([self.cmd, 'update', '-q'] + rev_options, cwd=dest)

开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:18,

示例2: check_rev_options

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def check_rev_options(self, rev, dest, rev_options):

"""Check the revision options before checkout to compensate that tags

and branches may need origin/ as a prefix.

Returns the SHA1 of the branch or tag if found.

"""

revisions = self.get_refs(dest)

origin_rev = 'origin/%s' % rev

if origin_rev in revisions:

# remote branch

return [revisions[origin_rev]]

elif rev in revisions:

# a local tag or branch name

return [revisions[rev]]

else:

logger.warn("Could not find a tag or branch '%s', assuming commit." % rev)

return rev_options

开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:19,

示例3: get_info

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def get_info(self, location):

"""Returns (url, revision), where both are strings"""

assert not location.rstrip('/').endswith(self.dirname), 'Bad directory: %s' % location

output = call_subprocess(

[self.cmd, 'info', location], show_stdout=False, extra_environ={'LANG': 'C'})

match = _svn_url_re.search(output)

if not match:

logger.warn('Cannot determine URL of svn checkout %s' % display_path(location))

logger.info('Output that cannot be parsed: \n%s' % output)

return None, None

url = match.group(1).strip()

match = _svn_revision_re.search(output)

if not match:

logger.warn('Cannot determine revision of svn checkout %s' % display_path(location))

logger.info('Output that cannot be parsed: \n%s' % output)

return url, None

return url, match.group(1)

开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:19,

示例4: _copy_file

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def _copy_file(filename, location, content_type, link):

copy = True

download_location = os.path.join(location, link.filename)

if os.path.exists(download_location):

response = ask_path_exists(

'The file %s exists. (i)gnore, (w)ipe, (b)ackup ' %

display_path(download_location), ('i', 'w', 'b'))

if response == 'i':

copy = False

elif response == 'w':

logger.warn('Deleting %s' % display_path(download_location))

os.remove(download_location)

elif response == 'b':

dest_file = backup_dir(download_location)

logger.warn('Backing up %s to %s'

% (display_path(download_location), display_path(dest_file)))

shutil.move(download_location, dest_file)

if copy:

shutil.copy(filename, download_location)

logger.notify('Saved %s' % display_path(download_location))

开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:22,

示例5: check_compatibility

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def check_compatibility(version, name):

"""

Raises errors or warns if called with an incompatible Wheel-Version.

Pip should refuse to install a Wheel-Version that's a major series

ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when

installing a version only minor version ahead (e.g 1.2 > 1.1).

version: a 2-tuple representing a Wheel-Version (Major, Minor)

name: name of wheel or package to raise exception about

:raises UnsupportedWheel: when an incompatible Wheel-Version is given

"""

if not version:

raise UnsupportedWheel(

"%s is in an unsupported or invalid wheel" % name

)

if version[0] > VERSION_COMPATIBLE[0]:

raise UnsupportedWheel(

"%s's Wheel-Version (%s) is not compatible with this version "

"of pip" % (name, '.'.join(map(str, version)))

)

elif version > VERSION_COMPATIBLE:

logger.warn('Installing from a newer Wheel-Version (%s)'

% '.'.join(map(str, version)))

开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:27,

示例6: add_filename_to_pth

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def add_filename_to_pth(self, filename):

path = os.path.dirname(filename)

dest = filename + '.pth'

if path not in self.paths():

logger.warn('Adding .pth file %s, but it is not on sys.path' % display_path(dest))

if not self.simulate:

if os.path.exists(dest):

f = open(dest)

lines = f.readlines()

f.close()

if lines and not lines[-1].endswith('\n'):

lines[-1] += '\n'

lines.append(filename + '\n')

else:

lines = [filename + '\n']

f = open(dest, 'wb')

f.writelines(lines)

f.close()

开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:20,

示例7: check_rev_options

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def check_rev_options(self, rev, dest, rev_options):

"""Check the revision options before checkout to compensate that tags

and branches may need origin/ as a prefix.

Returns the SHA1 of the branch or tag if found.

"""

revisions = self.get_tag_revs(dest)

revisions.update(self.get_branch_revs(dest))

origin_rev = 'origin/%s' % rev

if origin_rev in revisions:

# remote branch

return [revisions[origin_rev]]

elif rev in revisions:

# a local tag or branch name

return [revisions[rev]]

else:

logger.warn("Could not find a tag or branch '%s', assuming commit." % rev)

return rev_options

开发者ID:jwvanderbeck,项目名称:krpcScripts,代码行数:20,

示例8: _copy_file

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def _copy_file(filename, location, content_type, link):

copy = True

download_location = os.path.join(location, link.filename)

if os.path.exists(download_location):

response = ask_path_exists(

'The file %s exists. (i)gnore, (w)ipe, (b)ackup ' %

display_path(download_location), ('i', 'w', 'b'))

if response == 'i':

copy = False

elif response == 'w':

logger.warn('Deleting %s' % display_path(download_location))

os.remove(download_location)

elif response == 'b':

dest_file = backup_dir(download_location)

logger.warn('Backing up %s to %s'

% (display_path(download_location), display_path(dest_file)))

shutil.move(download_location, dest_file)

if copy:

shutil.copy(filename, download_location)

logger.indent -= 2

logger.notify('Saved %s' % display_path(download_location))

开发者ID:jwvanderbeck,项目名称:krpcScripts,代码行数:23,

示例9: remove_filename_from_pth

​点赞 3

# 需要导入模块: from pip.log import logger [as 别名]

# 或者: from pip.log.logger import warn [as 别名]

def remove_filename_from_pth(self, filename):

for pth in self.pth_files():

f = open(pth, 'r')

lines = f.readlines()

f.close()

new_lines = [

l for l in lines if l.strip() != filename]

if lines != new_lines:

logger.info('Removing reference to %s from .pth file %s'

% (display_path(filename), display_path(pth)))

if not [line for line in new_lines if line]:

logger.info('%s file would be empty: deleting' % display_path(pth))

if not self.simulate:

os.unlink(pth)

else:

if not self.simulate:

f = open(pth, 'wb')

f.writelines(new_lines)

f.close()

return

logger.warn('Cannot find a reference to %s in any .pth file' % display_path(filename))

开发者ID:jwvanderbeck,项目名称:krpcScripts,代码行数:23,

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

python logger.exception_Python logger.warn方法代码示例相关推荐

  1. python cpu count_Python multiprocessing.cpu_count方法代码示例

    本文整理汇总了Python中multiprocessing.cpu_count方法的典型用法代码示例.如果您正苦于以下问题:Python multiprocessing.cpu_count方法的具体用 ...

  2. python args keargs_Python metrics.silhouette_score方法代码示例

    本文整理汇总了Python中sklearn.metrics.silhouette_score方法的典型用法代码示例.如果您正苦于以下问题:Python metrics.silhouette_score ...

  3. python中weekday_Python calendar.weekday方法代码示例

    本文整理汇总了Python中calendar.weekday方法的典型用法代码示例.如果您正苦于以下问题:Python calendar.weekday方法的具体用法?Python calendar. ...

  4. python里config_Python config.get_config方法代码示例

    本文整理汇总了Python中config.get_config方法的典型用法代码示例.如果您正苦于以下问题:Python config.get_config方法的具体用法?Python config. ...

  5. python socket connection_Python socket.create_connection方法代码示例

    本文整理汇总了Python中gevent.socket.create_connection方法的典型用法代码示例.如果您正苦于以下问题:Python socket.create_connection方 ...

  6. python socket send_Python socket.send方法代码示例

    本文整理汇总了Python中socket.send方法的典型用法代码示例.如果您正苦于以下问题:Python socket.send方法的具体用法?Python socket.send怎么用?Pyth ...

  7. python apache benchmark_Python cudnn.benchmark方法代码示例

    本文整理汇总了Python中torch.backends.cudnn.benchmark方法的典型用法代码示例.如果您正苦于以下问题:Python cudnn.benchmark方法的具体用法?Pyt ...

  8. python中close_Python pool.close方法代码示例

    本文整理汇总了Python中multiprocessing.pool.close方法的典型用法代码示例.如果您正苦于以下问题:Python pool.close方法的具体用法?Python pool. ...

  9. python cv2 imwrite_Python cv2.imwrite方法代码示例

    本文整理汇总了Python中cv2.imwrite方法的典型用法代码示例.如果您正苦于以下问题:Python cv2.imwrite方法的具体用法?Python cv2.imwrite怎么用?Pyth ...

最新文章

  1. C语言中整型浮点型在计算机中的存储
  2. python希尔排序的优缺点_Python排序搜索基本算法之希尔排序实例分析
  3. 微服务架构 — 服务治理 — 服务注册与发现、服务订阅与通知
  4. win7系统下配置openCV python环境附加 numpy +scipy安装
  5. googlehelper手机版ios_二次元漫画控iOS苹果手机版下载v1.0.0下载|免费二次元漫画控iOS苹果手机版下载绿色版...
  6. 【数据结构总结】第二章:线性表
  7. Chapter3-2_Speech Separation(TasNet)
  8. pip换源,解决pip下载超时,连接失败等问题
  9. 如果每天给你888元,只能看书学习,不能玩手机电脑,你能坚持多少天?
  10. python机器学习:决策树ID3、C4.5
  11. 如何操作反射中构造方法、属性和普通方法?
  12. matlab晶格图,科学网-MATLAB软件绘制一维双原子晶格的格波色散曲线-李金磊的博文...
  13. python调用arcpy函数_AGS Python开发-ArcPy开发基础
  14. (matlab)地震数据频谱分析-频谱图代码
  15. 牛腩新闻发布--TODO
  16. ma5671怎么设置_电信/联通/移动,更换华为MA5671光猫详细教程
  17. 产品 · B端生意的定义和分类
  18. 浅谈千万级高性能高并发网站架构
  19. H3C CAS 5.0 虚拟机备份与还原
  20. matlab曲面的最小值,MATLAB中标准三维曲面

热门文章

  1. i5 10400f和i7 9700f哪个强
  2. 不同时区时间戳是一样的吗_十一假期去贵州想玩点不一样的体验吗?这段时间过去可以算错峰游了!...
  3. 帮助fy学长元旦礼品分组
  4. 让你的app体验更丝滑的11种方法!冲击手机应用榜单Top3指日可待
  5. Mac 使用 FFmpeg 处理视频
  6. 网络安全-端口扫描神器Nmap使用详解与参数指导
  7. Collection接口和Map接口的主要实现类
  8. 外贸新人,如何寻找和触达潜在客户?
  9. 智慧停车(十七) 怎么提升官网的信任度?
  10. 联想Y720安装ubuntu18.04双系统,解决wifi问题并安装GTX1060显卡驱动记录