mirror of
				https://git.launchpad.net/ubuntu-dev-tools
				synced 2025-10-31 22:14:03 +00:00 
			
		
		
		
	lpapicache: add Archive.getMySubscriptionURL()
Private PPA require using username/password to access their files, so make this information available. This gets the currently logged in user's "subscription URL", which includes the authentication data.
This commit is contained in:
		
							parent
							
								
									dbd453876e
								
							
						
					
					
						commit
						6e18d60de4
					
				| @ -764,6 +764,17 @@ class Archive(BaseWrapper): | ||||
|             )) | ||||
|         return self._pkgset_uploaders[key] | ||||
| 
 | ||||
|     def getMySubscriptionURL(self): | ||||
|         '''Get the "subscription URL" for the logged in user | ||||
| 
 | ||||
|         If this is a private archive (i.e. private PPA), this returns | ||||
|         the "subscription URL" including authentication; otherwise | ||||
|         this returns None. | ||||
|         ''' | ||||
|         if self.private: | ||||
|             return PersonTeam.me.getArchiveSubscriptionURL(archive=self._lpobject) | ||||
|         return None | ||||
| 
 | ||||
| 
 | ||||
| class SourcePackagePublishingHistory(BaseWrapper): | ||||
|     ''' | ||||
| @ -1294,7 +1305,8 @@ class MetaPersonTeam(MetaWrapper): | ||||
|         ''' | ||||
|         if '_me' not in cls.__dict__: | ||||
|             try: | ||||
|                 cls._me = PersonTeam(Launchpad.me) | ||||
|                 # We have to use me.self_link due to LP: #504297 | ||||
|                 cls._me = PersonTeam(Launchpad.me.self_link) | ||||
|             except HTTPError as error: | ||||
|                 if error.response.status == 401: | ||||
|                     # Anonymous login | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user