get_renewees: added __str__ and __repr__ to have nice output on screen
This commit is contained in:
		
							parent
							
								
									50a8b19675
								
							
						
					
					
						commit
						e9c889e58b
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		|  | @ -114,6 +114,16 @@ class Member(object): | ||||||
|         firstname, lastname, email, token_or_last_renewed_on = csvstring.strip().split(';') |         firstname, lastname, email, token_or_last_renewed_on = csvstring.strip().split(';') | ||||||
|         return Member(firstname, lastname, email, token_or_last_renewed_on) |         return Member(firstname, lastname, email, token_or_last_renewed_on) | ||||||
|      |      | ||||||
|  |     def __str__(self): | ||||||
|  |         if False: # string.format is too recent Python | ||||||
|  |             fmt = "{firstname} {lastname} <{email}> (token_or_last_renewed_on)" | ||||||
|  |             return fmt.format(self) | ||||||
|  |         fmt = "%(firstname)s %(lastname)s <%(email)s> (%(token_or_last_renewed_on)s)" | ||||||
|  |         return fmt % self.__dict__ | ||||||
|  | 
 | ||||||
|  |     def __repr__(self): | ||||||
|  |         fmt = "<Member <%(email)s> (%(token_or_last_renewed_on)s)>" | ||||||
|  |         return fmt % self.__dict__ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Tobias Mueller
						Tobias Mueller