Skip to content

Commit

Permalink
Modify the main script to process files & dirs
Browse files Browse the repository at this point in the history
* topy.py (main): The arguments now allow for a directory, if a
  directory is encountered we recursively apply the rules for all non
  binary files and non hidden directories (in *nix like systems)

Fixes intgr#3
  • Loading branch information
theanalyst committed Aug 9, 2014
1 parent 765105a commit 2498bb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions topy.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def main():
path = os.path.join(os.path.dirname(__file__), RETF_FILENAME)
regs = load_rules(path)

for filename in sys.argv[1:]:
apply_to_file(regs, filename)

for filename in flatten_files(sys.argv[1:]):
if not is_binary(filename):
apply_to_file(regs,filename)

if __name__ == '__main__':
main()

0 comments on commit 2498bb1

Please sign in to comment.