Browse files

a script to remove games with heroes

  • Loading branch information...
1 parent 01c5dc1 commit 9f7668c70e97b905f56b0d9c8ffb94df86784163 @syhw committed Apr 18, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 remove_games_with_heroes.py
View
16 remove_games_with_heroes.py
@@ -0,0 +1,16 @@
+import glob, sys, shutil
+fnamelist = glob.iglob(sys.argv[1] + '/*.rgd')
+to_remove = []
+for fname in fnamelist:
+ f = open(fname)
+ header = True
+ for line in f:
+ if 'Created' in line and 'Hero' in line:
+ to_remove.append(fname[:-3])
+ break
+ f.close()
+#print to_remove
+for fname in to_remove:
+ shutil.move(fname+'rld', 'trash_games/'+fname.split('/')[-1]+'rld')
+ shutil.move(fname+'rgd', 'trash_games/'+fname.split('/')[-1]+'rgd')
+ shutil.move(fname+'rod', 'trash_games/'+fname.split('/')[-1]+'rod')

0 comments on commit 9f7668c

Please sign in to comment.