Refresh Preferences documentation#198
Conversation
| """ A preferences helper for the splash screen. """ | ||
|
|
||
| PREFERENCES_PATH = 'acme.ui' | ||
| preferences_path = 'acme.ui' |
There was a problem hiding this comment.
The use of PREFERENCES_PATH results in this warning message:
| node and from then on in, you don't have to pass a preferences collection in | ||
| each time you create a helper:: | ||
|
|
||
| >>> PreferencesHelper.preferences = Preferences(filename='example.ini') |
There was a problem hiding this comment.
This mutates class attribute (global state) and it also does not work... helper.bgcolor returns "", helper.width returns 0 (default of Int), etc.
| Node() {} | ||
| Node(application) {} | ||
| Node(acme) {} | ||
| Node(ui) {'bgcolor': 'blue', 'width': '50', 'ratio': '1.0', 'visible': 'True'} |
There was a problem hiding this comment.
Changed because since Python 3.7 dictionary order is preserved to match insertion order. So the output order is going to match the order in the preference file.
| @@ -1,3 +1,5 @@ | |||
| .. _preferences-in-envisage: | |||
|
|
|||
There was a problem hiding this comment.
Orthogonal... this section looks like it belongs to Envisage? Maybe a separate issue here.
aaronayres35
left a comment
There was a problem hiding this comment.
Changes LGTM! I am yet to build the docs though
just built the docs and still LGTM |
|
Thanks. I will open the issue about the suspicious "Preferences in Envisage" section. |
Closes #42
This PR updates the Preferences section in the documentation.
I re-run the code mentioned in the documentation and updated the output.
I also removed a block which advertises mutating the class attribute (which has a trait type) directly. If it had worked before, it does not work any more. I am tempted to say this is probably not a good pattern anyway to mutate global state on PreferencesHelper so I did not open a new issue.
There are some minor, opportunistic visual updates in the sections/subsections organization.

For example, a couple of sections are at the same level as "Preferences" itself, so previously the TOC looks confusing:
Now those sections are made subsections, so the TOC looks like this:

Checklist