Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Fix path to stoplists

Daoud Clarke5ef09fc170cc
diff --git a/crawl.py b/crawl.py
index 7f093e5..b38c595 100644
--- a/crawl.py
+++ b/crawl.py
@@ -63,6 +63,7 @@ def process_batch_continuously():
def process_batch():
user_id = "test"
urls = url_queue.get_batch(user_id)
+ logger.info(f"Processing batch of {len(urls)} URLs")
results = crawl_batch(urls, 20)
for result in results:
print("Result", result)
diff --git a/mwmbl/justext/utils.py b/mwmbl/justext/utils.py
index 42e5074..bf04e3a 100644
--- a/mwmbl/justext/utils.py
+++ b/mwmbl/justext/utils.py
@@ -7,6 +7,7 @@ import re
import os
import sys
import pkgutil
+from pathlib import Path
MULTIPLE_WHITESPACE_PATTERN = re.compile(r"\s+", re.UNICODE)
@@ -36,8 +37,7 @@ def is_blank(string):
def get_stoplists():
"""Returns a collection of built-in stop-lists."""
- path_to_stoplists = os.path.dirname(sys.modules["justext"].__file__)
- path_to_stoplists = os.path.join(path_to_stoplists, "stoplists")
+ path_to_stoplists = Path(__file__).parent / "stoplists"
stoplist_names = []
for filename in os.listdir(path_to_stoplists):