def setup_output(cssd=None, jsd=None, imgd=None):
<EOL>if os.path.isdir(livvkit.index_dir):<EOL><INDENT>print("<STR_LIT>")<EOL>print('<STR_LIT>')<EOL>try:<EOL><INDENT>f = open(os.path.join(livvkit.index_dir, "<STR_LIT>"), "<STR_LIT:r>")<EOL>prev_time = f.readline().replace("<STR_LIT::>", "<STR_LIT>").replace("<STR_LIT:->", "<STR_LIT>").replace("<STR_LIT:U+0020>", "<STR_LIT:_>").rstrip()<EOL>f.close()<EOL><DEDENT>except IOError:<EOL><INDENT>prev_time = "<STR_LIT>"+datetime.now().strftime("<STR_LIT>")<EOL><DEDENT>print('<STR_LIT>')<EOL>print('<STR_LIT:U+0020>' + livvkit.index_dir + "<STR_LIT:_>" + prev_time)<EOL>print("<STR_LIT>")<EOL>shutil.move(livvkit.index_dir, livvkit.index_dir + "<STR_LIT:_>" + prev_time)<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>if cssd:<EOL><INDENT>shutil.copytree(cssd, os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>shutil.copytree(os.path.join(livvkit.resource_dir, "<STR_LIT>"),<EOL>os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL><DEDENT>if jsd:<EOL><INDENT>shutil.copytree(jsd, os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>shutil.copytree(os.path.join(livvkit.resource_dir, "<STR_LIT>"),<EOL>os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL><DEDENT>if imgd:<EOL><INDENT>shutil.copytree(imgd, os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>shutil.copytree(os.path.join(livvkit.resource_dir, "<STR_LIT>"),<EOL>os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL><DEDENT>shutil.copy(os.path.join(livvkit.resource_dir, "<STR_LIT>"),<EOL>os.path.join(livvkit.index_dir, "<STR_LIT>"))<EOL>with open(os.path.join(livvkit.index_dir, "<STR_LIT>"), "<STR_LIT:w>") as f:<EOL><INDENT>f.write(livvkit.timestamp + "<STR_LIT:\n>")<EOL>f.write(livvkit.comment)<EOL><DEDENT>
Set up the directory structure for the output.  Copies old run
data into a timestamped directory and sets up the new directory