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

Module cmdline

source code

Classes [hide private]
  TroveSpecError
Functions [hide private]
list
parseTroveSpec(specStr, allowEmptyName=True)
PUBLIC API
source code
 
_getChangeSet(path) source code
 
parseUpdateList(updateList, keepExisting, updateByDefault=True) source code
 
parseChangeList(changeSpecList, keepExisting=False, updateByDefault=True, allowChangeSets=True)
PUBLIC API Parse a change specification list, as presented on the command line.
source code
string
toTroveSpec(name, versionStr, flavor)
PUBLIC API
source code
 
askYn(prompt, default=None) source code
 
setContext(cfg, context=None, environ=None, searchCurrentDir=False) source code
Function Details [hide private]

parseTroveSpec(specStr, allowEmptyName=True)

source code 

PUBLIC API

Parse a TroveSpec string
Parameters:
  • specStr (string) - the input string
  • allowEmptyName (bool) - if set, will accept an empty string and some other variations.
Returns: list
(name, version, flavor)
Decorators:
  • @api.publicApi
Raises:
  • TroveSpecError - Raised if the input string is not a valid TroveSpec

parseChangeList(changeSpecList, keepExisting=False, updateByDefault=True, allowChangeSets=True)

source code 
PUBLIC API


Parse a change specification list, as presented on the command line.

Takes input specifying changeSpecs, such as C{foo=1.1--1.2},
and turns it into C{(name, (oldVersionSpec, oldFlavorSpec),
(newVersionSpec, newFlavorSpec), isAbsolute)} tuples.

@note:
    If a filename is passed as a changeSpec, and the file does not contain
a valid conary changeset, a sys.exit() will be called.

@param changeSpecList: a changeSpec, such as C{foo=1.1--1.2}
@type changeSpecList: string

@param keepExisting: specifies whether an installed trove should be
kept in addition to an updated version.
@type keepExisting: bool

@param updateByDefault:
@type updateByDefault: bool

@param allowChangeSets: specifies whether file-based changesets are
allowed.
@type allowChangeSets: bool

@raise TroveSpecError: Raised if an invalid TroveSpec is passed within the
ChangeSpec list.

@rtype: list
@return: a list of changes to apply, of the form
(name, (oldVersion, oldFlavor), (newVersion, newFlavor), replaceExisting)
where either the old or new version/flavor (but not both) may be 
(None, None)

Decorators:
  • @api.publicApi

toTroveSpec(name, versionStr, flavor)

source code 

PUBLIC API

Construct a TroveSpec string from name + version + flavor
Parameters:
  • name (string) - trove name
  • versionStr (string) - trove version string
  • flavor (deps.deps.Flavor) - trove flavor
Returns: string
a TroveSpec of the form name=version[flavor]
Decorators:
  • @api.publicApi