Skip to content

Commit

Permalink
Trying to solve #11
Browse files Browse the repository at this point in the history
  • Loading branch information
eFrane committed Dec 9, 2017
1 parent bc13924 commit 0f5df43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from core.cache import Cache
from core.exceptions import EndpointNotReachableException, EndpointIsNotAnOParlEndpointException
from core.output import Output
#from core.validator import get_validator_version

gi.require_version('OParl', '0.2')
from gi.repository import OParl
Expand All @@ -49,6 +50,11 @@ def __init__(self, endpoint):
'encodings': []
}

# default_headers = requests.utils.default_headers()
# headers.update({
# 'User-Agent': 'OParlValidator/{} (https://dev.oparl.org/validator)'.format(get_validator_version())
# })

if not self.is_reachable():
raise EndpointNotReachableException()

Expand Down
10 changes: 6 additions & 4 deletions core/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
from core.seen_list import SeenList
from core.validation_worker import ValidationWorker

# TODO: Auto-update this line via .gitattributes
VALIDATOR_VERSION = '0.9'

VALID_OPARL_VERSIONS = [
"https://schema.oparl.org/1.0/"
Expand All @@ -57,7 +59,7 @@ class Validator:

# TODO: these should be options
NUM_VALIDATION_WORKERS = 3
ENTITY_QUEUE_SIZE = 10000
ENTITY_QUEUE_SIZE = 10

def __init__(self, endpoint, options = None):
self.endpoint = endpoint
Expand Down Expand Up @@ -152,9 +154,6 @@ def validate(self):
for thread in worker_threads:
thread.start()

for thread in walker_threads:
thread.join()

for thread in worker_threads:
thread.join()

Expand All @@ -177,3 +176,6 @@ def handle_result(self, result):
exit(0)

print(formatted_result)

def get_validator_version():
return VALIDATOR_VERSION

0 comments on commit 0f5df43

Please sign in to comment.