Skip to content

Commit

Permalink
change to relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
fvolz committed Oct 17, 2024
1 parent 2e385a1 commit 962cf12
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions fx_python_sdk_cli/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
import base64 # in python
import yaml # MIT
import json
import os

from .utils import get_data_offer, offer2et, create_poc_ContractRequest_body, str_edc_catalog

current_dir = os.path.dirname(os.path.abspath(__file__))
yaml_file_path = os.path.join(current_dir, 'consumer_cfg.yaml')

# --- variables ---
with open('consumer_cfg.yaml', 'r') as file:
with open(yaml_file_path, 'r') as file:
consumer_cfg = yaml.safe_load(file)

# - control plane -
Expand All @@ -24,7 +28,7 @@
def get_edrs_for_object(object_of_agreement):
# see if there are some edrs which have been negotiated for
# Load the JSON from the file
with open('agreement_body.json', 'r') as f:
with open(os.path.join(current_dir, 'agreement_body.json'), 'r') as f:
loaded_agreement_body = json.load(f)

# Replace the placeholder with the actual object of agreement
Expand Down Expand Up @@ -57,7 +61,7 @@ def get_data(et_dict):
def request_assets_from_provider():
# obtain all offers from the data provider using a catalog request:
# Load the JSON from the file
with open('catalog_request_body', 'r') as f:
with open(os.path.join(current_dir, 'catalog_request_body'), 'r') as f:
loaded_catalog_request_body = json.load(f)
# Replace the placeholders with actual values
loaded_catalog_request_body["counterPartyId"] = edc_provider_bpn
Expand Down
6 changes: 5 additions & 1 deletion fx_python_sdk_cli/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
import uuid
import base64 # in python
import yaml # MIT
import os

from .utils import make_create_secure_asset_body, create_generic_Access_PolicyDefinitionRequest_body, create_generic_Usage_PolicyDefinitionRequest_body, create_generic_ContractDefinitionRequest_body, print_edc_assets

current_dir = os.path.dirname(os.path.abspath(__file__))
yaml_file_path = os.path.join(current_dir, 'provider_cfg.yaml')

# --- variables ---
with open('provider_cfg.yaml', 'r') as file:
with open(yaml_file_path, 'r') as file:
provider_cfg = yaml.safe_load(file)

# - control plane -
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="fx-python-sdk-cli",
version="0.1.2",
version="0.1.3",
author="FX",
author_email="fx@fx.com",
description="Interact with FX Port to share / retrieve AAS Submodel",
Expand Down

0 comments on commit 962cf12

Please sign in to comment.