Functions
srt_file_template_t Namespace Reference

Functions

def do_test ()
 

Function Documentation

def srt_file_template_t.do_test ( )

Definition at line 6 of file srt_file_template_t.py.

6 def do_test():
7  import srt_file_template
8 
9  mydict = {}
10 
11  #
12  # Setup everything for the simple subsitution tests
13  #
14 
15  mydict["one_line"] = "This is just a line"
16  mydict["second_line"] = "thingy"
17  mydict["first_word"] = "two"
18  mydict["second_word"] = "on it"
19  mydict["in_string"] = "with quoted text"
20  mydict["first_on_line"] = "This is the first word"
21  mydict["last_on_line"] = "this is the last word."
22 
23  #
24  # For conditional subsitution
25  #
26  mydict["do_this"] = 1
27  mydict["in_sub"] = "subed thing"
28 
29  #
30  # Great, now run it
31  #
32 
33  output = open ("srt_file_template_test.txt", "w")
34  srt_file_template.file_template (output, "srt_file_template_test.template", mydict)
35  output.close()
36 
37 #
38 # Execute the routine and let the shell know what happened.
39 #