mirror of
				https://github.com/RGBCube/GitHubWrapper
				synced 2025-10-31 14:02:46 +00:00 
			
		
		
		
	change repr
This commit is contained in:
		
							parent
							
								
									01578c0efd
								
							
						
					
					
						commit
						9944f5ac27
					
				
					 3 changed files with 7 additions and 6 deletions
				
			
		|  | @ -41,7 +41,7 @@ class Organization(APIOBJECT): | ||||||
|                 continue |                 continue | ||||||
| 
 | 
 | ||||||
|     def __repr__(self): |     def __repr__(self): | ||||||
|         return f'<Organization; login: {self.login}, id: {self.id}, html_url: {self.html_url}, is_verified: {self.is_verified}, public_repos: {self.public_repos}, public_gists: {self.public_gists}, created_at: {self.created_at}>' |         return f'<Organization; login: {self.login!r}, id: {self.id}, html_url: {self.html_url}, is_verified: {self.is_verified}, public_repos: {self.public_repos}, public_gists: {self.public_gists}, created_at: {self.created_at}>' | ||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
|     async def from_name(cls, session: aiohttp.ClientSession, org: str) -> 'Organization': |     async def from_name(cls, session: aiohttp.ClientSession, org: str) -> 'Organization': | ||||||
|  |  | ||||||
|  | @ -61,7 +61,7 @@ class Repository(APIOBJECT): | ||||||
|                 continue |                 continue | ||||||
| 
 | 
 | ||||||
|     def __repr__(self) -> str: |     def __repr__(self) -> str: | ||||||
|         return f'<Repository; id: {self.id}, name: {self.name}, owner: {self.owner}, updated_at: {self.updated_at}, default_branch: {self.default_branch}, license: {self.license}>' |         return f'<Repository; id: {self.id}, name: {self.name!r}, owner: {self.owner}, updated_at: {self.updated_at}, default_branch: {self.default_branch!r}, license: {self.license!r}>' | ||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
|     async def from_name(cls, session: aiohttp.ClientSession,owner: str, repo_name: str) -> 'Repository': |     async def from_name(cls, session: aiohttp.ClientSession,owner: str, repo_name: str) -> 'Repository': | ||||||
|  | @ -82,8 +82,9 @@ class Issue(APIOBJECT): | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|     def __init__(self, response: dict, session: aiohttp.ClientSession) -> None: |     def __init__(self, response: dict, session: aiohttp.ClientSession) -> None: | ||||||
|  |         super().__init__(response, session) | ||||||
|         tmp = self.__slots__ + APIOBJECT.__slots__ |         tmp = self.__slots__ + APIOBJECT.__slots__ | ||||||
|         keys = {key: value for key,value in response.items() if key in tmp} |         keys = {key: value for key,value in self._response.items() if key in tmp} | ||||||
|         for key, value in keys.items(): |         for key, value in keys.items(): | ||||||
|             if key == 'user': |             if key == 'user': | ||||||
|                 setattr(self, key, PartialUser(value, session)) |                 setattr(self, key, PartialUser(value, session)) | ||||||
|  |  | ||||||
|  | @ -21,7 +21,7 @@ class _BaseUser(APIOBJECT): | ||||||
|         self.id = response.get('id') |         self.id = response.get('id') | ||||||
| 
 | 
 | ||||||
|     def __repr__(self) -> str: |     def __repr__(self) -> str: | ||||||
|         return f'<{self.__class__.__name__}; id = {self.id}, login = {self.login}>' |         return f'<{self.__class__.__name__}; id = {self.id}, login = {self.login!r}>' | ||||||
| 
 | 
 | ||||||
| class User(_BaseUser):  | class User(_BaseUser):  | ||||||
|     __slots__ = ( |     __slots__ = ( | ||||||
|  | @ -48,7 +48,7 @@ class User(_BaseUser): | ||||||
|                 continue |                 continue | ||||||
| 
 | 
 | ||||||
|     def __repr__(self) -> str: |     def __repr__(self) -> str: | ||||||
|         return f'<User; login: {self.login}, id: {self.id}, created_at: {self.created_at}>' |         return f'<User; login: {self.login!r}, id: {self.id}, created_at: {self.created_at}>' | ||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
|     async def get_user(cls, session: aiohttp.ClientSession, username: str) -> 'User': |     async def get_user(cls, session: aiohttp.ClientSession, username: str) -> 'User': | ||||||
|  | @ -70,7 +70,7 @@ class PartialUser(_BaseUser): | ||||||
|         self.avatar_url = response.get('avatar_url') |         self.avatar_url = response.get('avatar_url') | ||||||
| 
 | 
 | ||||||
|     def __repr__(self) -> str: |     def __repr__(self) -> str: | ||||||
|         return f'<PartialUser; login: {self.login}, id: {self.id}, site_admin: {self.site_admin}, html_url: {self.html_url}>' |         return f'<PartialUser; login: {self.login!r}, id: {self.id}, site_admin: {self.site_admin}, html_url: {self.html_url}>' | ||||||
| 
 | 
 | ||||||
|     async def _get_user(self) -> User: |     async def _get_user(self) -> User: | ||||||
|         """Upgrades the PartialUser to a User object."""  |         """Upgrades the PartialUser to a User object."""  | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 VarMonke
						VarMonke