mirror of
				https://github.com/searxng/searxng.git
				synced 2025-11-02 18:47:05 -05:00 
			
		
		
		
	print error if https rewrite directory is not found, #116
This commit is contained in:
		
							parent
							
								
									5740cfbf1c
								
							
						
					
					
						commit
						6ecf03c736
					
				@ -18,7 +18,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
 | 
				
			|||||||
import re
 | 
					import re
 | 
				
			||||||
from lxml import etree
 | 
					from lxml import etree
 | 
				
			||||||
from os import listdir
 | 
					from os import listdir
 | 
				
			||||||
from os.path import isfile, join
 | 
					from os.path import isfile, isdir, join
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# https://gitweb.torproject.org/\
 | 
					# https://gitweb.torproject.org/\
 | 
				
			||||||
@ -120,9 +120,10 @@ def load_single_https_ruleset(filepath):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# load all https rewrite rules
 | 
					# load all https rewrite rules
 | 
				
			||||||
def load_https_rules(rules_path):
 | 
					def load_https_rules(rules_path):
 | 
				
			||||||
    # add / to path if not set yet
 | 
					    # check if directory exists
 | 
				
			||||||
    if rules_path[-1:] != '/':
 | 
					    if not isdir(rules_path):
 | 
				
			||||||
        rules_path += '/'
 | 
					        print("[E] directory not found: '" + rules_path + "'")
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # search all xml files which are stored in the https rule directory
 | 
					    # search all xml files which are stored in the https rule directory
 | 
				
			||||||
    xml_files = [join(rules_path, f)
 | 
					    xml_files = [join(rules_path, f)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user