mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Do away with @functools.total_ordering to restore Python 2.6 support
* Manually implement __ne__() and __lt__() * __gt__() and __ge__() not needed due to operator reflection
This commit is contained in:
		
							parent
							
								
									704ed76229
								
							
						
					
					
						commit
						caa609c438
					
				| 
						 | 
				
			
			@ -12,7 +12,7 @@ WARNING: THIS IS (STILL) WORK IN PROGRESS.
 | 
			
		|||
Main improvements over PIL version of OleFileIO:
 | 
			
		||||
------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Better compatibility with Python 2.7 (also compatible with Python 3.2+)
 | 
			
		||||
- Better compatibility with Python 2.6 (also compatible with Python 3.0+)
 | 
			
		||||
- Support for files larger than 6.8MB
 | 
			
		||||
- Robust: many checks to detect malformed files
 | 
			
		||||
- Improved API
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -224,7 +224,6 @@ import io
 | 
			
		|||
import sys
 | 
			
		||||
from PIL import _binary
 | 
			
		||||
import struct, array, os.path, datetime
 | 
			
		||||
from functools import total_ordering
 | 
			
		||||
 | 
			
		||||
#[PL] Define explicitly the public API to avoid private objects in pydoc:
 | 
			
		||||
__all__ = ['OleFileIO', 'isOleFile']
 | 
			
		||||
| 
						 | 
				
			
			@ -707,7 +706,6 @@ class _OleStream(io.BytesIO):
 | 
			
		|||
 | 
			
		||||
#--- _OleDirectoryEntry -------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
@total_ordering
 | 
			
		||||
class _OleDirectoryEntry:
 | 
			
		||||
 | 
			
		||||
    """
 | 
			
		||||
| 
						 | 
				
			
			@ -909,6 +907,12 @@ class _OleDirectoryEntry:
 | 
			
		|||
        return self.name < other.name
 | 
			
		||||
    #TODO: replace by the same function as MS implementation ?
 | 
			
		||||
    # (order by name length first, then case-insensitive order)
 | 
			
		||||
    
 | 
			
		||||
    def __ne__(self, other):
 | 
			
		||||
        return not self.__eq__(other)
 | 
			
		||||
    def __le__(self, other):
 | 
			
		||||
        return self.__eq__(other) or self.__lt__(other)
 | 
			
		||||
    # Reflected __lt__() and __le__() will be used for __gt__() and __ge__()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def dump(self, tab = 0):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user