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.
This commit is contained in:
Dan Winship
2014-11-16 17:07:56 -05:00
committed by Dan Winship
parent 36156b70dc
commit e43ba45f2f
4 changed files with 16 additions and 3 deletions

View File

@@ -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())))