Package conary :: Package repository :: Module netclient :: Class NetworkRepositoryClient
[hide private]
[frames] | no frames]

Class NetworkRepositoryClient

source code

                              object --+    
                                       |    
              xmlshims.NetworkConvertors --+
                                           |
repository.AbstractTroveDatabase --+       |
                                   |       |
          repository.IdealRepository --+   |
                                       |   |
           repository.AbstractRepository --+
                                           |
     trovesource.AbstractTroveSource --+   |
                                       |   |
       trovesource.SearchableTroveSource --+
                                           |
                                          NetworkRepositoryClient
Known Subclasses:
shimclient.ShimNetClient

Instance Methods [hide private]
 
__init__(self, repMap, userMap, localRepository=None, pwPrompt=None, entitlementDir=None, downloadRateLimit=0, uploadRateLimit=0, entitlements=None, proxy=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__del__(self) source code
 
close(self, *args) source code
 
open(self, *args) source code
 
reopen(self, hostname=None) source code
 
getUserMap(self)
The user/password map can be updated at runtime since we're prompting the user for passwords.
source code
 
getPwPrompt(self) source code
 
updateMetadata(self, troveName, branch, shortDesc, longDesc='', urls=[], licenses=[], categories=[], source='local', language='C') source code
 
updateMetadataFromXML(self, troveName, branch, xmlStr) source code
 
getMetadata(self, troveList, label, language='C') source code
 
addUser(self, label, user, newPassword) source code
 
addUserByMD5(self, label, user, salt, password) source code
 
addRole(self, label, role) source code
 
addDigitalSignature(self, name, version, flavor, digsig) source code
 
addMetadataItems(self, itemList) source code
 
addNewAsciiPGPKey(self, label, user, keyData) source code
 
addNewPGPKey(self, label, user, keyData) source code
 
getAsciiOpenPGPKey(self, label, keyId) source code
 
listUsersMainKeys(self, label, userId) source code
 
listSubkeys(self, label, fingerprint) source code
 
getOpenPGPKeyUserIds(self, label, keyId) source code
 
changePGPKeyOwner(self, label, user, key) source code
 
deleteUserByName(self, label, user) source code
 
deleteUserById(self, label, userId) source code
 
deleteRole(self, label, role) source code
 
addRoleMember(self, label, role, username) source code
 
getRoleMembers(self, label, role) source code
 
updateRoleMembers(self, label, role, members) source code
 
setRoleCanMirror(self, reposLabel, role, canMirror) source code
 
setRoleIsAdmin(self, reposLabel, role, admin) source code
 
addTroveAccess(self, role, troveList) source code
 
deleteTroveAccess(self, role, troveList) source code
 
listTroveAccess(self, serverName, role) source code
 
listAcls(self, reposLabel, role) source code
 
addAcl(self, reposLabel, role, trovePattern, label, write=False, remove=False) source code
 
editAcl(self, reposLabel, role, oldTrovePattern, oldLabel, trovePattern, label, write=False, canRemove=False) source code
 
deleteAcl(self, reposLabel, role, trovePattern, label) source code
 
changePassword(self, label, user, newPassword) source code
 
getRoles(self, label) source code
 
addEntitlementKeys(self, serverName, entClass, entKeys) source code
 
deleteEntitlementKeys(self, serverName, entClass, entKeys) source code
 
addEntitlementClass(self, serverName, entClass, role) source code
 
deleteEntitlementClass(self, serverName, entClass) source code
 
addEntitlementClassOwner(self, serverName, role, entClass) source code
 
deleteEntitlementClassOwner(self, serverName, role, entClass) source code
 
listEntitlementKeys(self, serverName, entClass) source code
 
listEntitlementClasses(self, serverName) source code
 
getEntitlementClassesRoles(self, serverName, classList) source code
 
setEntitlementClassesRoles(self, serverName, classInfo) source code
 
listRoles(self, serverName) source code
 
troveNames(self, label, troveTypes=1) source code
 
troveNamesOnServer(self, server, troveTypes=1) source code
 
getTroveLeavesByPath(self, pathList, label) source code
 
getTroveVersionsByPath(self, pathList, label) source code
 
iterFilesInTrove(self, troveName, version, flavor, sortByPath=False, withFiles=False)
Returns a generator for (pathId, path, fileId, version) tuples for all of the files in the trove.
source code
 
_mergeTroveQuery(self, resultD, response) source code
 
_setTroveTypeArgs(self, serverIdent, *args, **kwargs) source code
dict of lists
getAllTroveLeaves(self, serverName, troveNameList, troveTypes=1)
PUBLIC API
source code
dict of lists
getTroveVersionList(self, serverName, troveNameList, troveTypes=1)
PUBLIC API
source code
dict of lists
getTroveLeavesByLabel(self, troveSpecs, bestFlavor=False, troveTypes=1)
Returns a dictionary indexed by the items in troveNameList.
source code
 
getTroveLatestByLabel(self, troveSpecs, bestFlavor=False, troveTypes=1) source code
dict of lists
getTroveVersionsByLabel(self, troveSpecs, bestFlavor=False, troveTypes=1)
Returns a dictionary indexed by troveNameList.
source code
 
getTroveVersionFlavors(self, troveSpecs, bestFlavor=False, troveTypes=1)
Takes {n : { Version : [f,...]}} dict
source code
dict
getAllTroveFlavors(self, troveDict)
Converts a dictionary of the format retured by getAllTroveLeaves() to contain dicts of { version : flavorList } sets instead of containing lists of versions.
source code
 
_getTroveInfoByVerInfoTuples(self, troveSpecs, bestFlavor, method, branches=False, labels=False, versions=False, troveTypes=1, getLeaves=False, splitByBranch=False) source code
 
_getTroveInfoByVerInfo(self, troveSpecs, bestFlavor, method, branches=False, labels=False, versions=False, troveTypes=1, getLeaves=False, splitByBranch=False) source code
 
getTroveLeavesByBranch(self, troveSpecs, bestFlavor=False, troveTypes=1)
Takes {n : { Version : [f,...]}} dict
source code
 
getTroveVersionsByBranch(self, troveSpecs, bestFlavor=False, troveTypes=1) source code
versions.Version
getTroveLatestVersion(self, troveName, branch, troveTypes=1)
Returns the version of the latest version of a trove on a particular branch.
source code
 
getTroveReferences(self, serverName, troveInfoList)
troveInfoList is a list of (name, version, flavor) tuples.
source code
 
getTroveDescendants(self, serverName, troveList)
troveList is a list of (name, branch, flavor) tuples.
source code
boolean
hasTrove(self, name, version, flavor)
Tests if the repository contains a particular version of a trove.
source code
 
hasTroves(self, troveInfoList, hidden=False) source code
trove.Trove
getTrove(self, troveName, troveVersion, troveFlavor, withFiles=True, callback=None)
PUBLIC API
source code
 
getTroves(self, troves, withFiles=True, callback=None)
PUBLIC API
source code
 
getChangeSetSize(self, jobList) source code
 
_clearHostCache(self) source code
 
_cacheHostLookups(self, hosts) source code
 
createChangeSet(self, jobList, withFiles=True, withFileContents=True, excludeAutoSource=False, recurse=True, primaryTroveList=None, callback=None) source code
 
createChangeSetFile(self, jobList, fName, recurse=True, primaryTroveList=None, callback=None, changesetVersion=None, mirrorMode=False)
Create a changeset file based on a job list.
source code
 
_getChangeSet(self, chgSetList, recurse=True, withFiles=True, withFileContents=True, target=None, excludeAutoSource=False, primaryTroveList=None, callback=None, forceLocalGeneration=False, changesetVersion=None, mirrorMode=False) source code
 
resolveDependencies(self, label, depList, leavesOnly=False) source code
 
resolveDependenciesByGroups(self, groupTroves, depList) source code
 
getFileVersions(self, fullList, lookInLocal=False, allowMissingFiles=False)
Returns the file objects for the (pathId, fileId, version) pairs in list; the order returns is the same order in the list.
source code
 
getFileVersion(self, pathId, fileId, version)
Returns the file object for the given (pathId, fileId, version).
source code
 
getFileContents(self, fileList, tmpFile=None, lookInLocal=False, callback=None, compressed=False) source code
 
getPackageBranchPathIds(self, sourceName, branch, dirnames=[], fileIds=None)
Searches all of the troves generated from sourceName on the given branch, and returns the latest pathId for each path as a dictionary indexed by path.
source code
 
getCollectionMembers(self, troveName, branch)
Returns all members of any collection named troveName on branch.
source code
 
getTrovesBySource(self, sourceName, sourceVersion)
Returns (troveName, version, flavor) lists of all of the troves on the server built from sourceVersion.
source code
 
getPackageCreatorTroves(self, reposName)
Returns ((name, version, flavor), pkgData) tuples for all troves in the repository which have packageCreatorData troveinfo available.
source code
 
commitChangeSetFile(self, fName, mirror=False, callback=None, hidden=False) source code
 
presentHiddenTroves(self, serverName) source code
 
commitChangeSet(self, chgSet, callback=None, mirror=False, hidden=False) source code
 
commitCheck(self, troveList) source code
 
getTroveSigs(self, troveList) source code
 
setTroveSigs(self, itemList) source code
 
getMirrorMark(self, host) source code
 
setMirrorMark(self, host, mark) source code
 
getNewSigList(self, host, mark) source code
 
getNewTroveInfo(self, host, mark, infoTypes=[], labels=[], thaw=True) source code
 
setTroveInfo(self, info, freeze=True) source code
 
getNewTroveList(self, host, mark) source code
 
addPGPKeyList(self, host, keyList) source code
 
getNewPGPKeys(self, host, mark) source code
list of Stream objects or None
getTroveInfo(self, infoType, troveList)
Returns a list of trove infoType streams for a list of (name, version, flavor) troves.
source code
dict
findTroves(self, labelPath, troves, defaultFlavor=None, acrossLabels=False, acrossFlavors=False, affinityDatabase=None, allowMissing=False, getLeaves=True, bestFlavor=True, troveTypes=1, exactFlavors=False, requireLatest=False)
PUBLIC API
source code
 
findTrove(self, labelPath, (name, versionStr, flavor), defaultFlavor=None, acrossLabels=False, acrossFlavors=False, affinityDatabase=None, getLeaves=True, bestFlavor=True, troveTypes=1, exactFlavors=False)
PUBLIC API
source code
 
getConaryUrl(self, version, flavor) source code
 
_commit(self, chgSet, fName, callback=None, mirror=False, hidden=False) source code

Inherited from xmlshims.NetworkConvertors: freezeVersion, fromBranch, fromDepSet, fromEntitlement, fromFile, fromFileAsStream, fromFileId, fromFlavor, fromLabel, fromPath, fromPathId, fromTroveTup, fromVersion, thawVersion, toBranch, toDepSet, toEntitlement, toFile, toFileAsStream, toFileId, toFlavor, toLabel, toPath, toPathId, toTroveTup, toVersion

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Inherited from repository.AbstractRepository: hasTroveByName

Inherited from repository.IdealRepository: createBranch, queryMerge

Inherited from repository.AbstractTroveDatabase: iterAllTroveNames

Inherited from trovesource.SearchableTroveSource: filterByFlavor, filterByFlavors, filterTrovesByPreferences, isSearchAsDatabase, searchAsDatabase, searchAsRepository, searchLeavesOnly, searchWithFlavor, trovesByName

Inherited from trovesource.AbstractTroveSource: getDepsForTroveList, getFlavorPreferenceList, getLabelsForTroveName, getPathHashesForTroveList, mergeDepSuggestions, requiresLabelPath, searchableByType, setFlavorPreferenceList, setFlavorPreferencesByFlavor, walkTroveSet

Class Variables [hide private]
  FILE_CONTAINER_VERSION_FILEID_IDX = 2007022001
  FILE_CONTAINER_VERSION_WITH_REMOVES = 2006071301
  FILE_CONTAINER_VERSION_NO_REMOVES = 2005101901
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, repMap, userMap, localRepository=None, pwPrompt=None, entitlementDir=None, downloadRateLimit=0, uploadRateLimit=0, entitlements=None, proxy=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

getUserMap(self)

source code 
The user/password map can be updated at runtime since we're prompting the user for passwords. We may need to get those passwords back out again to avoid having to reprompt for passwords.

iterFilesInTrove(self, troveName, version, flavor, sortByPath=False, withFiles=False)

source code 
Returns a generator for (pathId, path, fileId, version) tuples for all of the files in the trove. This is equivlent to trove.iterFileList(), but if withFiles is set this is *much* more efficient.
Overrides: repository.AbstractTroveDatabase.iterFilesInTrove
(inherited documentation)

getAllTroveLeaves(self, serverName, troveNameList, troveTypes=1)

source code 
PUBLIC API
Returns: dict of lists
Decorators:
  • @api.publicApi
Overrides: repository.IdealRepository.getAllTroveLeaves

getTroveVersionList(self, serverName, troveNameList, troveTypes=1)

source code 
PUBLIC API
Returns: dict of lists
Decorators:
  • @api.publicApi
Overrides: repository.IdealRepository.getTroveVersionList

getTroveLeavesByLabel(self, troveSpecs, bestFlavor=False, troveTypes=1)

source code 
Returns a dictionary indexed by the items in troveNameList. Each item in the dictionary is a list of all of the leaf versions for that trove which are on a branch w/ the given label. If a trove does not have any branches for the given label, the version list for that trove name will be empty. The versions returned include timestamps.
Returns: dict of lists
Overrides: repository.IdealRepository.getTroveLeavesByLabel
(inherited documentation)

getTroveLatestByLabel(self, troveSpecs, bestFlavor=False, troveTypes=1)

source code 
Overrides: trovesource.SearchableTroveSource.getTroveLatestByLabel

getTroveVersionsByLabel(self, troveSpecs, bestFlavor=False, troveTypes=1)

source code 
Returns a dictionary indexed by troveNameList. Each item in the dictionary is a list of all of the versions of that trove on the given branch, and newer versions appear later in the list.
Returns: dict of lists
Overrides: repository.IdealRepository.getTroveVersionsByLabel
(inherited documentation)

getTroveVersionFlavors(self, trove