Commit e43ba45f authored by Dan Winship's avatar Dan Winship Committed by Dan Winship

cli, libnm: don't use D-Bus-specific documentation in nmcli

Now that nm-setting-docs.xml is more D-Bus-specific, it's less
appropriate for nmcli's internal documentation. So generate a second
copy of the docs without using the overrides file, and use that one
for nmcli's documentation.
parent 36156b70
......@@ -165,6 +165,7 @@ valgrind-*.log
/libnm/nm-ifcfg-rh-docs.xml
/libnm/nm-keyfile-docs.xml
/libnm/nm-property-docs.xml
/libnm/nm-setting-docs.xml
/libnm/nm-setting-docs-overrides.xml
/libnm/tests/test-nm-client
......
......@@ -51,7 +51,7 @@ nmcli_LDADD += $(POLKIT_LIBS)
endif
if BUILD_SETTING_DOCS
settings-docs.c: settings-docs.xsl $(top_builddir)/libnm/nm-setting-docs.xml
settings-docs.c: settings-docs.xsl $(top_builddir)/libnm/nm-property-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^
BUILT_SOURCES = settings-docs.c
......
......@@ -185,6 +185,7 @@ check-local:
if BUILD_SETTING_DOCS
noinst_DATA = \
nm-property-docs.xml \
nm-setting-docs-overrides.xml \
nm-setting-docs.xml \
nm-keyfile-docs.xml \
......@@ -195,6 +196,13 @@ docs_sources = $(filter-out nm-core-enum-types.c,$(libnm_core_sources))
nm-setting-docs-overrides.xml: generate-plugin-docs.pl $(docs_sources)
$(srcdir)/generate-plugin-docs.pl dbus $(top_srcdir)/libnm-core $@
nm-property-docs.xml: generate-setting-docs.py $(docs_sources) | NM-1.0.gir NM-1.0.typelib libnm.la
export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
$(srcdir)/generate-setting-docs.py \
--gir $(builddir)/NM-1.0.gir \
--output $@
nm-setting-docs.xml: generate-setting-docs.py $(docs_sources) nm-setting-docs-overrides.xml | NM-1.0.gir NM-1.0.typelib libnm.la
export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \
export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \
......
......@@ -173,7 +173,8 @@ settings = sorted(settings, key=lambda setting: setting.attrib['{%s}symbol-prefi
init_constants(girxml, settings)
overrides = ET.parse(args.overrides).getroot()
if args.overrides is not None:
overrides = ET.parse(args.overrides).getroot()
outfile.write("""<?xml version=\"1.0\"?>
<!DOCTYPE nm-setting-docs [
......@@ -192,7 +193,10 @@ for settingxml in settings:
outfile.write(" <setting name=\"%s\">\n" % setting.props.name)
setting_properties = { prop.name: prop for prop in GObject.list_properties(setting) }
setting_overrides = { override.attrib['name']: override for override in overrides.findall('./setting[@name="%s"]/property' % setting.props.name) }
if args.overrides is None:
setting_overrides = {}
else:
setting_overrides = { override.attrib['name']: override for override in overrides.findall('./setting[@name="%s"]/property' % setting.props.name) }
properties = sorted(set.union(set(setting_properties.keys()), set(setting_overrides.keys())))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment