Hi Steve,
Quickly handwaved:
```
from traitlets import Configurable, Unicode
class MyCustomContentManager(Configurable):
# the class attribute will be AutoMagically be made a instance one
and accessible via self.parameter.
parameter = Unicode('default', config=True, help='Frobulate
parameter as Unicode from the command line or config files.')
def __init__(self, ..., parent=None, config=None):
super().__init__(...,parent=parent, config=config) # important
...
```
You can set the value of parameter with
`c.MyCustomContentManager.parameter = 'Whatever'` in any config file.
This pattern is in many places of our codebase[1] and uses metaclasses.
If your content manager inherit from ours , then
`c.ContentManager.parameter = 'Whatever'` should work as well.
Does that make some sens ? There is a bit more magic involved if you
want advanced features, but I guess that might be already a lot to
digest.
Cheers,
--
M
[1]:
https://github.com/jupyter/notebook/blob/master/notebook/services/contents/manager.py#L65-L95
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
jupyter+u...@googlegroups.com.
> To post to this group, send email to
jup...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/jupyter/193be8d9-3321-4dca-b058-6c9ce266355b%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.