-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Environment Variables #145
base: main
Are you sure you want to change the base?
Conversation
Started to work on - [ ] env_node.py - [ ] environment.py - [ ] base_envvar.py
@@ -0,0 +1,176 @@ | |||
# -*- coding: utf-8 -*- | |||
# ----------------------------------------------------------------------------- | |||
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright should not predate the creation of the file ideally.
""" | ||
#: List of all the children of the env_var. The list should not be | ||
#: manipulated directly by user code. | ||
#: The tag 'child' is used to mark that a member can contain child env_var |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag is not needed in that case, since we ruled out the need for multiple child location.
|
||
# In the absence of a root envvar do nothing else than inserting the | ||
# child. | ||
if self.has_root: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_root
does not exist and was removed from ComplexTask as being an horror, if you need to add a root element (not sure) the check should simply check if it None or not.
# child. | ||
if self.has_root: | ||
child.depth = self.depth + 1 | ||
child.path = self._child_path() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those attributes need to be defined.
# Give him its root so that it can proceed to any child | ||
# registration it needs to. | ||
child.parent = self | ||
child.root = self.root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here those need to be defined.
|
||
""" | ||
config = ConfigObj(indent_type=' ', encoding='utf-8') | ||
config.update(self.node.preferences_from_members()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node
needs to be defined.
#: Refrence to the parent env_var. | ||
parent = ForwardTyped(lambda: BaseEnvVar) | ||
|
||
value = Value().tag(pref=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need doc.
DEP_TYPE = 'exopy.envvar' | ||
|
||
|
||
class BaseEnvVar(Atom): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should inherit from HasPrefsAtom
|
||
metadata = Dict().tag(pref=True) | ||
|
||
def preferences_from_members(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in HasPrefsAtom
Dictionary holding the necessary classes needed when rebuilding.. | ||
|
||
""" | ||
raise NotImplementedError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be implemented using update_members_from_preferences
from HasPrefsAtom
Started to work on