"""
Includes execution logic for the commands
"""

import os
import csv
import random

def run_create(count):
	file_list = [filename for filename in os.listdir('.') if os.path.isfile(filename)]
	sets = {}
	for filename in file_list:
		content = open(os.path.join(os.curdir, filename)).read().split('\n')
		random.shuffle(content)
		sets[filename[:filename.index('.')].title()] = content
	if not os.path.exists('Lists'):
		os.mkdir('Lists')
	for i in xrange(count):
		try:
			f = open(os.path.join(os.curdir, 'Lists', str(i+1) + '.txt'), 'w')
			file_content = ''
			for category, category_list in sets.items():
				file_content += (category + ' -- ' + category_list[i] + '\n')
			f.write(file_content)
			f.close()
		except IndexError:
			break_point = i
			break
	return

@@ -433,16 +433,37 @@
 Lists')%0A
+%09break_point = count%0A
 %09for i i
@@ -778,16 +778,292 @@
 %09%09break%0A
+%09try:%0A%09%09print sets%0A%09%09for category, category_list in sets.items():%0A%09%09%09f = open(os.path.join(os.curdir, 'Remaining_' + category + '.txt'), 'w')%0A%09%09%09file_content = %22%5Cn%22.join(category_list%5Bbreak_point:%5D)%0A%09%09%09f.write(file_content)%0A%09%09%09f.close()%0A%09except NameError, e:%0A%09%09print e%0A%09%09pass%0A
 %09return%0A

Set up creating files for unused items