-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch 'osc.conf.config' from dict to Options class with type checking
- Loading branch information
Showing
7 changed files
with
1,318 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,12 @@ | |
# | ||
import os | ||
import sys | ||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) | ||
import textwrap | ||
|
||
TOPDIR = os.path.dirname(os.path.abspath(__file__)) | ||
sys.path.insert(0, os.path.join(TOPDIR, "..")) | ||
|
||
import osc.conf | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
@@ -52,6 +57,23 @@ | |
master_doc = 'index' | ||
|
||
|
||
# -- Generate documents ------------------------------------------------- | ||
|
||
osc.conf._model_to_rst( | ||
cls=osc.conf.Options, | ||
title="Configuration file", | ||
description=textwrap.dedent( | ||
""" | ||
The configuration file path is ``$XDG_CONFIG_HOME/osc/oscrc``, which usually translates into ``~/.config/osc/oscrc``. | ||
""" | ||
), | ||
sections={ | ||
"Host options": osc.conf.HostOptions, | ||
}, | ||
output_file=os.path.join(TOPDIR, "oscrc.rst"), | ||
) | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
|
@@ -64,3 +86,11 @@ | |
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
|
||
|
||
# -- Options for MAN output ------------------------------------------------- | ||
|
||
# (source start file, name, description, authors, manual section). | ||
man_pages = [ | ||
("oscrc", "oscrc", "openSUSE Commander configuration file", "openSUSE project <[email protected]>", 5), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ API: | |
|
||
api/modules | ||
plugins/index | ||
oscrc | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.