Skip to content

Commit

Permalink
Merge pull request #3189 from mdavidsaver/show-pref-names
Browse files Browse the repository at this point in the history
doc: show full preference names
  • Loading branch information
shroffk authored Nov 20, 2024
2 parents 8559774 + 5739328 commit b681616
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ---------------------------------------
# Package org.phoebus.archive.reader.json
# ---------------------------------------

# Shall a precision of zero for a floating-point value result in this value
# using a number format without fractional digits (true) or shall it be treated
# as an indication that the value should be rendered with a default number of
Expand Down
16 changes: 16 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,31 @@ def createPreferenceAppendix(root):
""")
for pack in sorted(pref_files.keys()):
pkgname = None
pref_file = pref_files[pack]
out.write("\n")
out.write(pack + "\n")
out.write(("-" * len(pack)) + "\n")
out.write("\n")
out.write("File " + pref_file + "::\n\n")
print('processing', pref_file)
with open(pref_file) as prefs:
for line in prefs:
# expect lines like:
# 1) Special comment with package id.
# '# Package org.phoebus.applications.alarm\n'
# 2) ignore...
# '--------------\n'
# '# ... ignore ...\n'
# ' \n'
# 4) preference
# 'key = value'
line = line.strip()
if line.startswith('# Package'):
pkgname = line.split(' ')[2]
elif line[:1] not in ('', '#', '-'):
assert pkgname is not None, pref_file # preference file missing "# Package ..." name line
line = '%s/%s'%(pkgname, line)
out.write(" " + line + "\n")
out.write("\n")

Expand Down

0 comments on commit b681616

Please sign in to comment.