python plugin #274

Merged
merged 2 commits into from Oct 10, 2011

Projects

None yet

3 participants

@diofeher
Contributor

hey, I've added a python plugin :)

@tristan0x tristan0x and 1 other commented on an outdated diff Apr 13, 2011
plugins/python/python.plugin.zsh
@@ -0,0 +1,5 @@
+# Find python file
+alias pyfind='find . -name "*.py"'
+
+# Remove python compiled byte-code
+alias pycrm='rm `find . | grep -E "*.(pyc|pyo)$"`'
@tristan0x
tristan0x Apr 13, 2011 Contributor

pycrm is quite complicated, and does not handle all cases (file permissions, unsafe output of find command, if a directory matches).
What about the command below instead?

find . -type f -name "*.py[co]" -exec rm -f \{\} \;

If you really need to pipe output of find, I strongly advice you to turn on the anal-mode switch :)

find ... -print0 | xargs -0 ...
@diofeher
diofeher Apr 14, 2011 Contributor

Hey @tristann0x, nice tips :)
I don't know much about these commands, so I took a read in find manual and looks your solution is way better than mine :P

@robbyrussell
Owner

Are you happy with this getting merged in now?

@robbyrussell robbyrussell merged commit 6e8c0c1 into robbyrussell:master Oct 10, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment