contrib_bots: Allow to import code from subdirectory of lib
				
					
				
			Allow to import code from subdirectory of `contrib_bots/lib`. Because sometimes bot requires grouping in their directory, especially for the bot that has configuartion file and documentation.
This commit is contained in:
		
							parent
							
								
									c96681eef5
								
							
						
					
					
						commit
						746d9d2b6b
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -22,7 +22,7 @@ class RestrictedClient(object):
 | 
			
		|||
 | 
			
		||||
def get_lib_module(lib_fn):
 | 
			
		||||
    lib_fn = os.path.abspath(lib_fn)
 | 
			
		||||
    if os.path.dirname(lib_fn) != os.path.join(our_dir, 'lib'):
 | 
			
		||||
    if not os.path.dirname(lib_fn).startswith(os.path.join(our_dir, 'lib')):
 | 
			
		||||
        print('Sorry, we will only import code from contrib_bots/lib.')
 | 
			
		||||
        sys.exit(1)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue