mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	Move imports close to point of usage in Python scripts
This means that you no longer need urllib2 to regenerate single header file, etc
This commit is contained in:
		@@ -6,8 +6,6 @@ import re
 | 
				
			|||||||
import string
 | 
					import string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from scriptCommon import catchPath
 | 
					from scriptCommon import catchPath
 | 
				
			||||||
import generateSingleHeader
 | 
					 | 
				
			||||||
import updateWandbox
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' )
 | 
					versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' )
 | 
				
			||||||
rootPath = os.path.join( catchPath, 'include/' )
 | 
					rootPath = os.path.join( catchPath, 'include/' )
 | 
				
			||||||
@@ -80,6 +78,8 @@ class Version:
 | 
				
			|||||||
            f.write( line + "\n" )
 | 
					            f.write( line + "\n" )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def updateReadmeFile(version):
 | 
					def updateReadmeFile(version):
 | 
				
			||||||
 | 
					    import updateWandbox
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    downloadParser = re.compile( r'<a href=\"https://github.com/philsquared/Catch/releases/download/v\d+\.\d+\.\d+/catch.hpp\">' )
 | 
					    downloadParser = re.compile( r'<a href=\"https://github.com/philsquared/Catch/releases/download/v\d+\.\d+\.\d+/catch.hpp\">' )
 | 
				
			||||||
    success, wandboxLink = updateWandbox.uploadFiles()
 | 
					    success, wandboxLink = updateWandbox.uploadFiles()
 | 
				
			||||||
    if not success:
 | 
					    if not success:
 | 
				
			||||||
@@ -142,7 +142,10 @@ def performUpdates(version):
 | 
				
			|||||||
    # First update version file, so we can regenerate single header and
 | 
					    # First update version file, so we can regenerate single header and
 | 
				
			||||||
    # have it ready for upload to wandbox, when updating readme
 | 
					    # have it ready for upload to wandbox, when updating readme
 | 
				
			||||||
    version.updateVersionFile()
 | 
					    version.updateVersionFile()
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    import generateSingleHeader
 | 
				
			||||||
    generateSingleHeader.generate(version)
 | 
					    generateSingleHeader.generate(version)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    updateReadmeFile(version)
 | 
					    updateReadmeFile(version)
 | 
				
			||||||
    updateConanFile(version)
 | 
					    updateConanFile(version)
 | 
				
			||||||
    updateConanTestFile(version)
 | 
					    updateConanTestFile(version)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user