Created
February 8, 2012 23:37
-
-
Save tsabat/1775451 to your computer and use it in GitHub Desktop.
luke filewalker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def walk(root, is_inside=False): | |
for item in os.listdir(root): | |
if is_project(root, item): | |
print "%s is a project" %item | |
def is_project(root, item): | |
return os.path.isdir(os.path.join(root,item,"etc")) and os.path.isdir(os.path.join(root,item,".git")) | |
root = "/home/vagrant/playground" | |
walk(root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment