Mercurial > hg > config
comparison python/s5ify.py @ 763:e047129c84bc
ch ch ch changes
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Wed, 06 Jan 2016 09:44:57 -0800 |
| parents | 1758ead4ad2f |
| children |
comparison
equal
deleted
inserted
replaced
| 762:1758ead4ad2f | 763:e047129c84bc |
|---|---|
| 25 input = options.input | 25 input = options.input |
| 26 if not os.path.isfile(input): | 26 if not os.path.isfile(input): |
| 27 parser.error("Not a file: '{}'".format(input)) | 27 parser.error("Not a file: '{}'".format(input)) |
| 28 input = os.path.abspath(options.input) | 28 input = os.path.abspath(options.input) |
| 29 | 29 |
| 30 # get output name from input | |
| 31 output_filename = os.path.splitext(os.path.basename(input))[0] + '.html' | |
| 32 output = os.path.join(os.path.dirname(input), output_filename) | |
| 33 | |
| 34 # build command line | |
| 35 options = [] | |
| 36 command = ['rst2s5.py'] | |
| 37 command.extend(options) | |
| 38 command.extend([input, output]) | |
| 39 print subprocess.list2cmdline(command) | |
| 40 | |
| 41 # call it | |
| 42 subprocess.call(command) | |
| 43 | |
| 30 if __name__ == '__main__': | 44 if __name__ == '__main__': |
| 31 main() | 45 main() |
