作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我继承了一些目录名称中嵌入空格的代码,并且我没有重命名目录的选项。假设目录的名称是“embedded space”
现在我正在尝试访问 MANIFEST.in 文件中此目录中的一些文件
我尝试过以下方法:
recursive-include 'embedded spaces' *.dat
recursive-include "embedded spaces" *.dat
recursive-include embedded\ spaces *.dat
这些都会给出类似“警告:在目录“embedded”下找不到与“spaces”匹配的文件
我有一个解决方法
recursive-include embedded* *.dat
但我想知道是否有一种不那么黑客的方式来编码 MANIFEST.in 目录名称中的空格。
最佳答案
不,看起来不是。检查distutils.filelist
的来源,它负责解析 MANIFEST.in
的工作显示该行纯粹根据空格分割以确定操作及其参数
这是源代码(Python 2,7)
def _parse_template_line(self, line):
words = line.split()
action = words[0]
...
if action in ('include', 'exclude',
'global-include', 'global-exclude'):
...
elif action in ('recursive-include', 'recursive-exclude'):
if len(words) < 3:
raise DistutilsTemplateError, \
"'%s' expects <dir> <pattern1> <pattern2> ..." % action
dir = convert_path(words[1])
patterns = map(convert_path, words[2:])
...
关于python - 如何转义 MANIFEST.in 文件中目录名称中的空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7761130/
概述 CentOS Stream 成立于 2019 年,是“RHEL 下一步的滚动预览”。Red Hat 首席技术官 Chris Wright 和 CentOS 社区经理 Rich Bowen 各
我有一个使用 Mesosphere DC/OS 编排选项进行配置的 Azure 容器服务 (ACS) 集群。我可以在 Marathon UI 中创建一个应用程序。 但是,当我通过 Marathon U
我是一名优秀的程序员,十分优秀!