summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2017-03-10 20:19:30 +0100
committerLubomir Rintel <lkundrak@v3.sk>2017-03-17 10:15:11 +0100
commitb0da972f5fa51608cca5837af9fe7094818204f8 (patch)
tree3ecf6f4e4c6ab8eaf5637a26fee4e3591c302407
parent3f6af3360b7e2b059e14e6d86ad2b147780bd61d (diff)
downloadNetworkManager-b0da972f5fa51608cca5837af9fe7094818204f8.tar.gz
doc: sort "connection" settings first in nm-settings manual
-rwxr-xr-xlibnm/generate-setting-docs.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py
index e1ea9723dc..0a4adae3a4 100755
--- a/libnm/generate-setting-docs.py
+++ b/libnm/generate-setting-docs.py
@@ -162,6 +162,14 @@ def get_default_value(setting, pspec, propxml):
return default_value
+def cmp_settings(x,y):
+ x_prefix = x.attrib['{%s}symbol-prefix' % ns_map['c']]
+ y_prefix = y.attrib['{%s}symbol-prefix' % ns_map['c']]
+ if x_prefix == "setting_connection":
+ # Always sort NMSettingConnection first
+ return -1;
+ return cmp(x_prefix, y_prefix)
+
def escape(val):
return str(val).replace('"', '&quot;')
@@ -186,7 +194,7 @@ settings = girxml.findall('./gi:namespace/gi:class[@parent="Setting"]', ns_map)
# Hack. Need a better way to do this
ipxml = girxml.find('./gi:namespace/gi:class[@name="SettingIPConfig"]', ns_map)
settings.extend(girxml.findall('./gi:namespace/gi:class[@parent="SettingIPConfig"]', ns_map))
-settings = sorted(settings, key=lambda setting: setting.attrib['{%s}symbol-prefix' % ns_map['c']])
+settings = sorted(settings, cmp=cmp_settings)
init_constants(girxml, settings)