File tree 8 files changed +20
-16
lines changed
8 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def main():
30
30
31
31
# configure Django before model imports
32
32
if os .environ .get ("DJANGO_SETTINGS_MODULE" ) is None :
33
- os .environ ['DJANGO_SETTINGS_MODULE' ] = 'pupa.settings'
33
+ os .environ ['DJANGO_SETTINGS_MODULE' ] = 'pupa.core. settings'
34
34
35
35
try :
36
36
django .setup ()
Original file line number Diff line number Diff line change 3
3
import requests
4
4
import boto
5
5
6
- from ... import settings
6
+ from pupa . core import settings
7
7
from .base import BaseCommand , CommandError
8
8
9
9
Original file line number Diff line number Diff line change 2
2
3
3
from .base import BaseCommand
4
4
from pupa .utils .fulltext import bill_to_elasticsearch
5
- from pupa .settings import elasticsearch
5
+ from pupa .core import elasticsearch
6
6
7
7
8
8
class Command (BaseCommand ):
Original file line number Diff line number Diff line change 6
6
from django .db import transaction
7
7
8
8
from .base import BaseCommand , CommandError
9
- from pupa import settings , utils
9
+ from pupa import utils
10
+ from pupa .core import settings
10
11
from pupa .scrape import Jurisdiction , JurisdictionScraper
11
12
12
13
Original file line number Diff line number Diff line change
1
+ import pyelasticsearch
2
+
3
+ from pupa .core import settings
4
+
5
+
6
+ elasticsearch = None
7
+ if settings .ENABLE_ELASTICSEARCH :
8
+ elasticsearch = pyelasticsearch .ElasticSearch (
9
+ urls = 'http://{}' .format (settings .ELASTICSEARCH_HOST ),
10
+ timeout = settings .ELASTICSEARCH_TIMEOUT )
Original file line number Diff line number Diff line change 2
2
import importlib
3
3
import sys
4
4
import dj_database_url
5
- import pyelasticsearch
6
5
7
6
DATABASE_URL = os .environ .get ('DATABASE_URL' , 'postgis://pupa:pupa@localhost/opencivicdata' )
8
7
SECRET_KEY = 'non-secret'
65
64
66
65
67
66
sys .path .insert (1 , os .getcwd ())
68
- loader = importlib .find_loader ('pupa_settings ' )
67
+ loader = importlib .find_loader ('pupa_core_settings ' )
69
68
if loader is None :
70
69
print ('no pupa_settings on path, using defaults' )
71
70
else :
72
71
from pupa_settings import * # NOQA
73
72
74
73
75
74
DATABASES = {'default' : dj_database_url .parse (DATABASE_URL )}
76
-
77
-
78
- elasticsearch = None
79
- if ENABLE_ELASTICSEARCH :
80
- elasticsearch = pyelasticsearch .ElasticSearch (
81
- urls = 'http://{}' .format (ELASTICSEARCH_HOST ),
82
- timeout = ELASTICSEARCH_TIMEOUT )
Original file line number Diff line number Diff line change 8
8
import scrapelib
9
9
from validictory import ValidationError
10
10
11
- from pupa import utils , settings
11
+ from pupa import utils
12
+ from pupa .core import settings
12
13
13
14
14
15
class ScrapeError (Exception ):
Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ def bill_to_elasticsearch(bill):
79
79
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
80
80
81
81
es_bill = {
82
- 'jurisdiction' : bill .get_jurisdiction_name () ,
83
- 'session' : bill .get_session_name () ,
82
+ 'jurisdiction' : bill .legislative_session . jurisdiction . name ,
83
+ 'session' : bill .legislative_session . name ,
84
84
'identifier' : bill .identifier ,
85
85
'subjects' : bill .subject ,
86
86
'classifications' : bill .classification ,
You can’t perform that action at this time.
0 commit comments