#!/usr/bin/python # # This python script converts a file containing a list of commands # into a perl script for use with the demotools.pm module. # import sys print """#!/usr/bin/perl -w use demotools; #-------------------------------------------------- # main """ for arg in sys.argv[1:]: print '\n#', arg print 'system("clear");' for line in open(arg): line = line.strip() if line == '': print '\nsystem("clear");' else: line = line.replace('\\', '\\\\') line = line.replace('"', '\\"') print 'printf("\\n"); demotools::cmd("%s");' % (line)