Last active
August 29, 2015 14:11
-
-
Save pingwin/4a86fc0daa57fa0f3794 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
import os | |
import sys | |
def main(): | |
tree(sys.argv[1] if len(sys.argv)>1 else os.getcwd()) | |
def tree(path): | |
map(lambda x: walk(*x), os.walk(path)) | |
def walk(root, dirs, files): | |
for fn in files: | |
if fn[-4:] == '.xml': | |
print_if_whited("/".join([root, fn])) | |
def print_if_whited(fn): | |
with open(fn, 'r') as fd: | |
if fd.readline()[0].isspace(): | |
for line in fd: | |
pass | |
if line[len(line)-1].isspace(): | |
print fn | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment