commit dc9a1b9e5f46d2691fa34e42de3a96afe308f2e1
Author: dsorber <david.sorber@gmail.com>
Date:   Thu Aug 28 20:44:21 2014 -0400

    Adding a picture renaming script. It's somewhat crude right now I should make it somewhat better at some point.

diff --git a/software/renamer/pic_renamer.py b/software/renamer/pic_renamer.py
new file mode 100644
index 0000000..28e986a
--- /dev/null
+++ b/software/renamer/pic_renamer.py
@@ -0,0 +1,43 @@
+import os
+import random
+import sys
+
+chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
+
+def make_new_filename(length=8):
+	new_filename = []
+	for idx in xrange(length):
+		new_filename.append(random.choice(chars))
+	new_filename.extend(['.', 'j', 'p', 'g'])
+	return ''.join(new_filename)
+
+def main():
+	""" This script is intended to rename .jpg files to a randomly selected
+	8 character name.  It could easily be extended to deal with other types
+	of files at some point.  
+
+	USAGE:
+
+	python pic_renamer.py <pictures_directory>
+	"""
+
+	if len(sys.argv) < 2:
+		print 'ERROR: not enough arguments specified'
+		return -1
+
+	dir_path = sys.argv[1]
+
+	for filename in os.listdir(dir_path):
+		if filename.endswith('.jpg') or filename.endswith('.jpeg'):
+			old_full_path = os.path.join(dir_path, filename)
+			new_filename = make_new_filename()
+			new_file_path = os.path.join(dir_path, new_filename)
+
+			os.rename(old_full_path, new_file_path)
+
+			print '{:s} - renaming - {:s}'.format(filename, new_filename)
+		else:
+			print '{:s} - skipping'.format(filename)
+
+if __name__ == '__main__':
+	sys.exit(main())
diff --git a/software/renamer/renamer.py b/software/renamer/renamer.py
deleted file mode 100644
index f8ec300..0000000
--- a/software/renamer/renamer.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import os
-import re
-import sys
-
-def main():
-    
-    if len(sys.argv) < 3:
-        print 'Not enough arguments specified!'
-        return
-
-    show_name = sys.argv[1]
-    directory = sys.argv[2]
-
-    show_name = show_name.replace(' ', '\.')
-
-    for filename in os.listdir(directory):
-        m = re.match("^(%s)\.S(\d+)E(\d+)\.(.*)\.(\w{3})$" % show_name, filename, re.IGNORECASE)
-        if m:
-            new_name = '%s - S%sE%s.%s' % (show_name.replace('\.', ' '), 
-                                           m.group(2), m.group(3), m.group(5).lower())
-
-            print '%s --- MATCH: %s' % (filename, new_name)
-            os.rename(os.path.join(directory, filename), 
-                      os.path.join(directory, new_name))
-        else:
-            print filename
-
-if __name__ == '__main__':
-    sys.exit(main())
\ No newline at end of file
diff --git a/software/renamer/show_renamer.py b/software/renamer/show_renamer.py
new file mode 100644
index 0000000..f8ec300
--- /dev/null
+++ b/software/renamer/show_renamer.py
@@ -0,0 +1,29 @@
+import os
+import re
+import sys
+
+def main():
+    
+    if len(sys.argv) < 3:
+        print 'Not enough arguments specified!'
+        return
+
+    show_name = sys.argv[1]
+    directory = sys.argv[2]
+
+    show_name = show_name.replace(' ', '\.')
+
+    for filename in os.listdir(directory):
+        m = re.match("^(%s)\.S(\d+)E(\d+)\.(.*)\.(\w{3})$" % show_name, filename, re.IGNORECASE)
+        if m:
+            new_name = '%s - S%sE%s.%s' % (show_name.replace('\.', ' '), 
+                                           m.group(2), m.group(3), m.group(5).lower())
+
+            print '%s --- MATCH: %s' % (filename, new_name)
+            os.rename(os.path.join(directory, filename), 
+                      os.path.join(directory, new_name))
+        else:
+            print filename
+
+if __name__ == '__main__':
+    sys.exit(main())
\ No newline at end of file
