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
daf_persistence: Tickets/dm 10340 #61
Conversation
support putting RepsositoryCfg in the parents list of a RepositoryCfg
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.
Looks OK to me but I cannot say I understood completely how it works. Please check comments
The Repository class instance. | ||
|
||
parentRepoDatas : list of RepoData | ||
The are parents of this Repository, as indicated this Repository's RepositoryCfg. If this is a new |
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 parents"?
repository, i.e. even though there is not a RepositoryCfg file, one will not be generated. | ||
If False, this is a New Butler repository and is specified by RepositoryCfg file. | ||
|
||
tags : set |
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.
set
of what?
"parentRepoDatas={},\n\t" + | ||
"isV1Repository={},\n\t" | ||
"role={},\n\t" + | ||
"parentRegistry={})\n\t").format( |
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.
Do you need trailing \n\t
?
origin : string | ||
'new', 'existing', or 'nested' | ||
root : string | ||
URI or absolute path to the location of the RepositoryCfg.yaml file. |
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.
isV1Repository
is not documented
|
||
def getParentRepoDatas(self, context=None): | ||
"""Get the parents & grandparents etc of this repo data, in depth-first search order. | ||
|
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.
context
is undocumeted
if repoData.cfg.parents is None: | ||
repoDataIdx += 1 | ||
continue # if there are no parents then there's nothing to do. | ||
for repoParentIdx in range(len(repoData.cfg.parents)): |
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.
enumerate
is probably more idiomatic
# if repoData is new, add the parent RepositoryCfgs to it. | ||
if repoData.cfgOrigin == 'new': | ||
repoData.cfg.addParents(parents) | ||
elif repoData.cfgOrigin == 'existing' or repoData.cfgOrigin == 'nested': |
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.
repoData.cfgOrigin in ('existing', 'nested')
?
@@ -0,0 +1,124 @@ | |||
#!/usr/bin/env python |
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.
It is not an executable script, no need for shebang
|
||
Parameters | ||
---------- | ||
newParents : string or RepoistoryCfg instance |
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.
Is it a list of strings?
|
||
@dirty.setter | ||
def dirty(self, val): | ||
self._dirty = val |
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.
Property does not do anything special, could just use attribute?
5f9c866
to
76d7dcc
Compare
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.
This review is for commit 76d7dc (safeFileIo.py). The logic there feels rather complicated, needed some verbal explanation for a dumb programmer like me. I think there is a benefit in making that logic simpler by not adding too much protection (avoiding writes to temporary file).
log.debug("Acquiring blocking shared lock on {}", name) | ||
fcntl.flock(f, fcntl.LOCK_SH) | ||
else: | ||
raise e |
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.
raise
without object is usually used for re-raising exception
48678c2
to
0348948
Compare
No description provided.