mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Factored out a method to determine the final installer filename.
This commit is contained in:
		
							parent
							
								
									6fa2474b20
								
							
						
					
					
						commit
						612eb09aae
					
				
					 1 changed files with 14 additions and 9 deletions
				
			
		| 
						 | 
					@ -224,15 +224,7 @@ def create_exe (self, arcname, fullname, bitmap=None):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cfgdata = self.get_inidata()
 | 
					        cfgdata = self.get_inidata()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.target_version:
 | 
					        installer_name = self.get_installer_filename(fullname)
 | 
				
			||||||
            # if we create an installer for a specific python version,
 | 
					 | 
				
			||||||
            # it's better to include this in the name
 | 
					 | 
				
			||||||
            installer_name = os.path.join(self.dist_dir,
 | 
					 | 
				
			||||||
                                          "%s.win32-py%s.exe" %
 | 
					 | 
				
			||||||
                                           (fullname, self.target_version))
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            installer_name = os.path.join(self.dist_dir,
 | 
					 | 
				
			||||||
                                          "%s.win32.exe" % fullname)
 | 
					 | 
				
			||||||
        self.announce("creating %s" % installer_name)
 | 
					        self.announce("creating %s" % installer_name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if bitmap:
 | 
					        if bitmap:
 | 
				
			||||||
| 
						 | 
					@ -280,6 +272,19 @@ def create_exe (self, arcname, fullname, bitmap=None):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # create_exe()
 | 
					    # create_exe()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_installer_filename(self, fullname):
 | 
				
			||||||
 | 
					        # Factored out to allow overriding in subclasses
 | 
				
			||||||
 | 
					        if self.target_version:
 | 
				
			||||||
 | 
					            # if we create an installer for a specific python version,
 | 
				
			||||||
 | 
					            # it's better to include this in the name
 | 
				
			||||||
 | 
					            installer_name = os.path.join(self.dist_dir,
 | 
				
			||||||
 | 
					                                          "%s.win32-py%s.exe" %
 | 
				
			||||||
 | 
					                                           (fullname, self.target_version))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            installer_name = os.path.join(self.dist_dir,
 | 
				
			||||||
 | 
					                                          "%s.win32.exe" % fullname)
 | 
				
			||||||
 | 
					    # get_installer_filename()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_exe_bytes (self):
 | 
					    def get_exe_bytes (self):
 | 
				
			||||||
        from distutils.msvccompiler import get_build_version
 | 
					        from distutils.msvccompiler import get_build_version
 | 
				
			||||||
        # If a target-version other than the current version has been
 | 
					        # If a target-version other than the current version has been
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue