Example #1
0
def delete_all_templates():
    do_delete = raw_input('Print remove contents of %s? (y/n) ' % (template_dir,))
    if do_delete == 'y':
        multi_map(delete_template, structs)
        os.rmdir(template_dir)
    else:
        print 'Aborting on user request'
Example #2
0
def generate_all_templates():
    if not os.path.exists(template_dir):
        os.mkdir(template_dir)
    multi_map(generate_template, structs)
Example #3
0
    def testMultiMap(self):
        def accepts_two(x, y):
            return x + y

        self.assertEqual(functional.multi_map(accepts_two, enumerate([10, 20, 30])), [10, 21, 32])