Skip to content

Instantly share code, notes, and snippets.

@pingwin
Last active August 29, 2015 14:11
Show Gist options
  • Save pingwin/4a86fc0daa57fa0f3794 to your computer and use it in GitHub Desktop.
Save pingwin/4a86fc0daa57fa0f3794 to your computer and use it in GitHub Desktop.
#!/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