Skip to content

Commit

Permalink
Adapt paths for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzsommer committed Jul 7, 2024
1 parent e31a6c5 commit e38f37e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.ini.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ port=8125
fallback_semantic_matching_service=https://example.org/semantic_matching_service
eclass_semantic_matching_service=https://example.org/semantic_matching_service
cdd_semantic_matching_service=https://example.org/semantic_matching_service
debug_semantic_matching_service_endpoints=../debug_endpoints.json
debug_semantic_matching_service_endpoints=debug_endpoints.json
5 changes: 4 additions & 1 deletion semantic_id_resolver/resolver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import enum
from pathlib import Path
from typing import Optional, Dict
from urllib.parse import urlparse
import json
Expand All @@ -24,7 +25,9 @@ def __init__(self, debug_endpoints: Dict[str, str]):

@classmethod
def from_file(cls, filename: str) -> "DebugSemanticMatchingServiceEndpoints":
with open(filename, "r") as file:
base_dir = str(Path(__file__).resolve().parent.parent)
resource_path = base_dir + "/" + filename
with open(resource_path, "r") as file:
debug_endpoints = json.load(file)
return DebugSemanticMatchingServiceEndpoints(debug_endpoints)

Expand Down
2 changes: 1 addition & 1 deletion test_resources/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ port=8125
fallback_semantic_matching_service=https://example.org/fallback_semantic_matching_service
eclass_semantic_matching_service=https://example.org/eclass_semantic_matching_service
cdd_semantic_matching_service=https://example.org/cdd_semantic_matching_service
debug_semantic_matching_service_endpoints=../test_resources/debug_endpoints.json
debug_semantic_matching_service_endpoints=test_resources/debug_endpoints.json

0 comments on commit e38f37e

Please sign in to comment.