简体   繁体   English

不要在Xcode 4项目导航器中显示.pyc文件

[英]Don't display .pyc files in the Xcode 4 project navigator

I'm working on a fairly large django-project in Xcode 4. I prefer not to see all the automatically generated .pyc files in the project navigator. 我正在Xcode 4中处理一个相当大的django项目。我不希望在项目导航器中看不到所有自动生成的.pyc文件。

Does anyone know a way to hide the .pyc files from the interface? 有谁知道从界面隐藏.pyc文件的方法吗?

I don't necessarily want to remove them from disk. 我不一定要从磁盘中删除它们。

Thanks. 谢谢。

- --

What fails: 什么失败:

  1. Checking "Show only files with source-control status" hides all files except the .pyc files... If only there is a way to invert this selection. 选中“仅显示具有源代码管理状态的文件”会隐藏除.pyc文件之外的所有文件...如果只有一种方法可以反转此选择。
  2. Showing files with matching name will also only give me a solution for solely showing the .pyc files. 显示具有匹配名称的文件也只会为我提供仅显示.pyc文件的解决方案。 Typing ".py" also yields .pyc files... 键入“ .py”也会产生.pyc文件...

The best I can come with is the way I do it: By dragging only the .py files into the XCode project at the start. 我所能提供的最好的方法是:首先将.py文件拖到XCode项目中。 It's not ideal; 这不理想; there should be a way to filter out build files. 应该有一种方法可以过滤出构建文件。 This method also isn't great for sub-folders, since you have to create each folder and then drag the .py files in for each folder by hand. 此方法对于子文件夹也不是很好,因为您必须创建每个文件夹,然后手动将每个文件夹中的.py文件拖入其中。 But it works, and now I have no .pyc files in my project. 但这有效,现在我的项目中没有.pyc文件。 Also, irritatingly, I can't delete .pyc files from the project once they're in there, so controlling things from the outset is the only solution I found. 另外,令人烦恼的是,一旦项目中存在.pyc文件,我便无法删除它们,因此从一开始就控制一切是我找到的唯一解决方案。

given that this has not been answered directly here is an alternative solution using another programming software which is Coda 2. 鉴于尚未直接回答,这里是使用另一种编程软件Coda 2的替代解决方案。

You can create a rule that will hide those files, here is how to proceed : 您可以创建一个规则来隐藏这些文件,这是如何继续进行操作:

  • First open your preferences from the main menu 首先从主菜单打开您的首选项
  • Second go to the rules tab and create a new rule using the lower left "+" button 其次,转到“规则”标签,并使用左下方的“ +”按钮创建新规则
  • Give the rule a name, such as "Python compiled Files" 给规则起一个名字,例如“ Python Compiled Files”
  • Select "Hide" from the right menu instead of "Skip" 从右侧菜单中选择“隐藏”,而不是“跳过”
  • Edit the first rule as showed to apply it to files which "Name" ends with "pyc" 如图所示,编辑第一个规则以将其应用到“名称”以“ pyc”结尾的文件
  • Close the preferences pane and voilà, you are all set to keep being an efficient Coda user 关闭“首选项”窗格并打开菜单,一切都准备就绪,成为高效的Coda用户

This is taken from this website for sourcing purpose. 这是从本网站获取的用于采购目的。 It contains images illustrating this. 它包含说明这一点的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM