Commit 06b6a772 authored by alexandre's avatar alexandre
Browse files

Made settings more generic

parent 5c45f4d8
......@@ -9,6 +9,7 @@ from django.test import Client
import html5lib
from rdflib.plugins.memory import IOMemory
import rdflib
from ... import settings as app_settings
def tidy(string):
......@@ -32,11 +33,7 @@ class Conf(object):
'HtmlSniffer',
]
STORE = {
'ENGINE': 'sqlite',
'NAME': 'aasniff.sqlite',
}
STORE = app_settings.STORE
class Command(BaseCommand):
args = ''
......
......@@ -4,6 +4,7 @@ from django.contrib.sites.models import Site
from django.urls import reverse
from aasniff import AAApp
import rdflib
from ... import settings as app_settings
class Conf(object):
......@@ -12,22 +13,18 @@ class Conf(object):
'HtmlSniffer',
]
STORE = {
'ENGINE': 'sqlite',
'NAME': 'aasniff.sqlite',
}
STORE = app_settings.STORE
class Command(BaseCommand):
args = ''
help = 'Indexes pages'
help = 'Print indexed data and texts'
def handle(self, *args, **options):
app = AAApp(conf=Conf)
# print(rt)
# for quad in graph.quads():
# print(quad)
for quad in app.graph.quads():
print(quad)
node = rdflib.URIRef("http://purl.org/dc/terms/title")
NS = {
......@@ -54,7 +51,6 @@ class Command(BaseCommand):
}
""", initBindings={'predicate': node}, initNs=NS)
print(as_predicate)
for i in as_predicate:
print(i[1])
......
from django.conf import settings
# OPTION_C = getattr(settings, '_'.join([NAMESPACE, 'OPTION_C']), None)
# if OPTION_C is None:
# raise ImproperlyConfigured('...')
STORE = getattr(settings, "ETHERTOFF_RDF_STORE", {
'ENGINE': 'sqlite',
'NAME': 'aasniff.sqlite',
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment