Package conary :: Package conaryclient
[hide private]
[frames] | no frames]

Package conaryclient

source code

Submodules [hide private]

Classes [hide private]
  TroveNotFound
  VersionSuppliedError
  ConaryClient
ConaryClient is a high-level class to some useful Conary operations, including trove updates and erases.
Functions [hide private]
 
getClient(context=None, environ=None, searchCurrentDir=False, cfg=None)
Returns a ConaryClient object that has the context set as it would be if the conary command line were used.
source code
Function Details [hide private]

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.