|
@@ -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -120,9 +120,10 @@ def load_single_https_ruleset(filepath):
|
|
|
|
|
|
|
|
|
|
def load_https_rules(rules_path):
|
|
def load_https_rules(rules_path):
|
|
-
|
|
+
|
|
- if rules_path[-1:] != '/':
|
|
+ if not isdir(rules_path):
|
|
- rules_path += '/'
|
|
+ print("[E] directory not found: '" + rules_path + "'")
|
|
|
|
+ return
|
|
|
|
|
|
|
|
|
|
xml_files = [join(rules_path, f)
|
|
xml_files = [join(rules_path, f)
|