Rubykuby

diff.py

Apr 27th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. import os
  2.  
  3. ama_dir = os.path.join("amanda", "src")
  4. res_dir = os.path.join("amanda-resources", "Amanda205", "Amalib")
  5. caps = True
  6.  
  7. def main():
  8.     print("ama_dir: {}".format(ama_dir))
  9.     print("res_dir: {}".format(res_dir))
  10.    
  11.     # Makes a list (files) of all files in ama_dir.
  12.     for root, _, files in os.walk(ama_dir):
  13.         # Loops through the list of files
  14.         for f in files:
  15.             if caps: target_f = "{}{}".format(f[0].upper(), f[1:])
  16.             else:    target_f = f
  17.             cmd = "diff {} {}".format(os.path.join(ama_dir, f),
  18.                                       os.path.join(res_dir, target_f))
  19.             print(cmd)
  20.             os.system(cmd)
  21.        
  22. if __name__ == "__main__":
  23.     main()
Advertisement
Add Comment
Please, Sign In to add comment