| 10 | |
| 11 | |
| 12 | def parse_options(args=None): |
| 13 | parser = OptionParser(args) |
| 14 | parser.add_option( |
| 15 | "-s", |
| 16 | "--server", |
| 17 | dest="server", |
| 18 | default="http://openlibrary.org/", |
| 19 | help="URL of the openlibrary website (default: %default)", |
| 20 | ) |
| 21 | parser.add_option( |
| 22 | "--template-root", |
| 23 | dest="template_root", |
| 24 | default="/upstream", |
| 25 | help="Template root (default: %default)", |
| 26 | ) |
| 27 | parser.add_option( |
| 28 | "--default-plugin", |
| 29 | dest="default_plugin", |
| 30 | default="/upstream", |
| 31 | help="Default plugin (default: %default)", |
| 32 | ) |
| 33 | |
| 34 | options, args = parser.parse_args() |
| 35 | |
| 36 | options.template_root = options.template_root.rstrip("/") |
| 37 | return options, args |
| 38 | |
| 39 | |
| 40 | def write(path, text): |