Adjust paths for package org
This commit is contained in:
parent
2243cae653
commit
95d2cddf17
|
@ -8,9 +8,9 @@ import argparse
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
from src.article import LexiconArticle
|
from article import LexiconArticle
|
||||||
from src import build
|
import build
|
||||||
from src import utils
|
import utils
|
||||||
|
|
||||||
def is_lexicon(name):
|
def is_lexicon(name):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
import src.utils as utils
|
import utils
|
||||||
|
|
||||||
class LexiconCitation:
|
class LexiconCitation:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -5,8 +5,8 @@ import io # For writing pages out as UTF-8
|
||||||
import networkx # For pagerank analytics
|
import networkx # For pagerank analytics
|
||||||
from collections import defaultdict # For rank inversion in statistics
|
from collections import defaultdict # For rank inversion in statistics
|
||||||
|
|
||||||
from src import utils
|
import utils
|
||||||
from src.article import LexiconArticle
|
from article import LexiconArticle
|
||||||
|
|
||||||
class LexiconPage:
|
class LexiconPage:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
# Short utility functions for handling titles
|
# Short utility functions for handling titles
|
||||||
|
|
||||||
|
@ -37,8 +38,9 @@ def titlesort(s):
|
||||||
def load_resource(filename, cache={}):
|
def load_resource(filename, cache={}):
|
||||||
"""Loads files from the resources directory with caching."""
|
"""Loads files from the resources directory with caching."""
|
||||||
if filename not in cache:
|
if filename not in cache:
|
||||||
with open(os.path.join("src", "resources", filename), "r", encoding="utf-8") as f:
|
binary = pkg_resources.resource_string("resources", filename)
|
||||||
cache[filename] = f.read()
|
unistr = binary.decode("utf-8")
|
||||||
|
cache[filename] = unistr
|
||||||
return cache[filename]
|
return cache[filename]
|
||||||
|
|
||||||
def load_config(name):
|
def load_config(name):
|
||||||
|
|
Loading…
Reference in New Issue