zulip_bots: Add function to get absolute path to the bots/ dir.
This is part of our efforts to have the documentation for a particular bot live in this repo but still be able to render it in the main repo (in a way similar to how we render the webhooks docs). This function allows the calling code to get the absolute path to the bots/ directory. This will allow us to specify an arbitrary path (jinja2.env.loader.searchpath) to look for templates for bots' documentation.
This commit is contained in:
		
					parent
					
						
							
								824000f32b
							
						
					
				
			
			
				commit
				
					
						aee564825f
					
				
			
		
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -35,6 +35,11 @@ def get_bot_logo_path(name):
 | 
			
		|||
 | 
			
		||||
    return None
 | 
			
		||||
 | 
			
		||||
def get_bots_directory_path():
 | 
			
		||||
    # type: () -> str
 | 
			
		||||
    current_dir = os.path.dirname(os.path.abspath(__file__))
 | 
			
		||||
    return os.path.join(current_dir, 'bots')
 | 
			
		||||
 | 
			
		||||
class RateLimit(object):
 | 
			
		||||
    def __init__(self, message_limit, interval_limit):
 | 
			
		||||
        # type: (int, int) -> None
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue