MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / parse_options

Function parse_options

scripts/pull-templates.py:12–37  ·  view source on GitHub ↗
(args=None)

Source from the content-addressed store, hash-verified

10
11
12def 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
40def write(path, text):

Callers 1

mainFunction · 0.85

Calls 1

parse_argsMethod · 0.80

Tested by

no test coverage detected