mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Tabs to spaces and other flake8 fixes
This commit is contained in:
		
							parent
							
								
									f820c5184d
								
							
						
					
					
						commit
						b17384cfca
					
				| 
						 | 
					@ -168,19 +168,20 @@ class FreeTypeFont:
 | 
				
			||||||
        return im, offset
 | 
					        return im, offset
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def font_variant(self, font=None, size=None, index=None, encoding=None):
 | 
					    def font_variant(self, font=None, size=None, index=None, encoding=None):
 | 
				
			||||||
		"""
 | 
					        """
 | 
				
			||||||
		Create a copy of this FreeTypeFont object,
 | 
					        Create a copy of this FreeTypeFont object,
 | 
				
			||||||
		using any specified arguments to override the settings.
 | 
					        using any specified arguments to override the settings.
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		Parameters are identical to the parameters used to initialize this object,
 | 
					        Parameters are identical to the parameters used to initialize this
 | 
				
			||||||
		minus the deprecated 'file' argument.
 | 
					        object, minus the deprecated 'file' argument.
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		:return: A FreeTypeFont object.
 | 
					        :return: A FreeTypeFont object.
 | 
				
			||||||
		"""
 | 
					        """
 | 
				
			||||||
        return FreeTypeFont(font = self.path if font == None else font,
 | 
					        return FreeTypeFont(font=self.path if font is None else font,
 | 
				
			||||||
                            size = self.size if size == None else size,
 | 
					                            size=self.size if size is None else size,
 | 
				
			||||||
                            index = self.index if index == None else index,
 | 
					                            index=self.index if index is None else index,
 | 
				
			||||||
                            encoding = self.encoding if encoding == None else encoding)
 | 
					                            encoding=self.encoding if encoding is None else
 | 
				
			||||||
 | 
					                            encoding)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# Wrapper that creates a transposed font from any existing font
 | 
					# Wrapper that creates a transposed font from any existing font
 | 
				
			||||||
| 
						 | 
					@ -275,8 +276,8 @@ def truetype(font=None, size=10, index=0, encoding="", filename=None):
 | 
				
			||||||
        elif sys.platform in ('linux', 'linux2'):
 | 
					        elif sys.platform in ('linux', 'linux2'):
 | 
				
			||||||
            lindirs = os.environ.get("XDG_DATA_DIRS", "")
 | 
					            lindirs = os.environ.get("XDG_DATA_DIRS", "")
 | 
				
			||||||
            if not lindirs:
 | 
					            if not lindirs:
 | 
				
			||||||
                #According to the freedesktop spec, XDG_DATA_DIRS should
 | 
					                # According to the freedesktop spec, XDG_DATA_DIRS should
 | 
				
			||||||
                #default to /usr/share
 | 
					                # default to /usr/share
 | 
				
			||||||
                lindirs = '/usr/share'
 | 
					                lindirs = '/usr/share'
 | 
				
			||||||
            lindirs = lindirs.split(":")
 | 
					            lindirs = lindirs.split(":")
 | 
				
			||||||
            for lindir in lindirs:
 | 
					            for lindir in lindirs:
 | 
				
			||||||
| 
						 | 
					@ -286,7 +287,8 @@ def truetype(font=None, size=10, index=0, encoding="", filename=None):
 | 
				
			||||||
                        filepath = os.path.join(walkroot, ttf_filename)
 | 
					                        filepath = os.path.join(walkroot, ttf_filename)
 | 
				
			||||||
                        return FreeTypeFont(filepath, size, index, encoding)
 | 
					                        return FreeTypeFont(filepath, size, index, encoding)
 | 
				
			||||||
        elif sys.platform == 'darwin':
 | 
					        elif sys.platform == 'darwin':
 | 
				
			||||||
            macdirs = ['/Library/Fonts/', '/System/Library/Fonts/', os.path.expanduser('~/Library/Fonts/')]
 | 
					            macdirs = ['/Library/Fonts/', '/System/Library/Fonts/',
 | 
				
			||||||
 | 
					                       os.path.expanduser('~/Library/Fonts/')]
 | 
				
			||||||
            for macdir in macdirs:
 | 
					            for macdir in macdirs:
 | 
				
			||||||
                filepath = os.path.join(macdir, ttf_filename)
 | 
					                filepath = os.path.join(macdir, ttf_filename)
 | 
				
			||||||
                if os.path.exists(filepath):
 | 
					                if os.path.exists(filepath):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user