|  |  | @ -36,3 +36,23 @@ html_context = { | 
			
		
	
		
		
			
				
					
					|  |  |  |     'github_version': 'master', |  |  |  |     'github_version': 'master', | 
			
		
	
		
		
			
				
					
					|  |  |  |     'conf_py_path': '/docs/' |  |  |  |     'conf_py_path': '/docs/' | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | # Upload function when the script is called directly | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | if __name__ == "__main__": | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     import os, sys, paramiko | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     build_dir, hostname, username, password, dest_dir = sys.argv[1:] | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     transport = paramiko.Transport((hostname, 22)) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     transport.connect(username=username, password=password) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     sftp = paramiko.SFTPClient.from_transport(transport) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     os.chdir(build_dir) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     for dirpath, dirnames, filenames in os.walk("."): | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         remote_path = os.path.join(dest_dir, dirpath) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         try: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sftp.mkdir(remote_path) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         except: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             pass | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for filename in filenames: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sftp.put( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 os.path.join(dirpath, filename), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 os.path.join(remote_path, filename) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ) | 
			
		
	
	
		
		
			
				
					|  |  | 
 |