getClient(context=None,
environ=None,
searchCurrentDir=False,
cfg=None)
| source code
|
Returns a ConaryClient object that has the context set as it would be
if the conary command line were used.
This means it checks for the explicit "context" variable
passed in manually. It follows by checking the eviron dict (defaults to
os.environ) for the CONARY_CONTEXT variable. It then falls back to the
CONARY file and looks for a context set there. Finally, if these checks
fail to find a context, it will look at the context specified in the cfg
variable.
- Parameters:
context - a context override string or None
environ - a dict representing the current environment or None to use
os.environ
searchCurrentDir - if True, look in the current directory for a CONARY file and
set the context from there if needed. Otherwise, do not look for
a CONARY file. (Default False)
cfg - ConaryConfiguration to use. If None, read the configuration
as conary would, from /etc/conaryrc, ~/.conaryrc, and
./conaryrc.
|