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