import os
import sys
import lipd

# import pythonAdapter, assumes in ../python-adapter/
tests_dir = os.path.dirname(os.path.realpath(__file__))
fc_dir = os.path.dirname(tests_dir)
python_adapter_dir = os.path.join(fc_dir, "python-adapter")
sys.path.append(python_adapter_dir)

import adapter


def fake_model(adapter):
    # check to see inside function
    print("\n---\nStart of the fake_model function\n---\n")

    # the parameters are handed to you by the adapter
    files = adapter.get_files()

    # use the parameters given by the adapter to get the binary data of the LiPD file
    lipd.readLipd(files['weldeab'])

    # get the binary data of the NetCDF file
    net_cdf_path = files['net_cdf']

    # mark the NetCDF file as an output file
    adapter.set_output_files(net_cdf_path)
    adapter.set_output_files("lipd-files\\")

    return

# have to call adapter in the adapter.py file as adapter.adapter
adapter = adapter.global_adapter

adapter.register(fake_model)
adapter.start_server()

[((153, 179), 'os.path.dirname', 'os.path.dirname', (['tests_dir'], {}), '(tests_dir)\n', (168, 179), False, 'import os\n'), ((201, 239), 'os.path.join', 'os.path.join', (['fc_dir', '"""python-adapter"""'], {}), "(fc_dir, 'python-adapter')\n", (213, 239), False, 'import os\n'), ((240, 275), 'sys.path.append', 'sys.path.append', (['python_adapter_dir'], {}), '(python_adapter_dir)\n', (255, 275), False, 'import sys\n'), ((952, 980), 'adapter.register', 'adapter.register', (['fake_model'], {}), '(fake_model)\n', (968, 980), False, 'import adapter\n'), ((981, 1003), 'adapter.start_server', 'adapter.start_server', ([], {}), '()\n', (1001, 1003), False, 'import adapter\n'), ((116, 142), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (132, 142), False, 'import os\n'), ((481, 500), 'adapter.get_files', 'adapter.get_files', ([], {}), '()\n', (498, 500), False, 'import adapter\n'), ((592, 623), 'lipd.readLipd', 'lipd.readLipd', (["files['weldeab']"], {}), "(files['weldeab'])\n", (605, 623), False, 'import lipd\n'), ((756, 794), 'adapter.set_output_files', 'adapter.set_output_files', (['net_cdf_path'], {}), '(net_cdf_path)\n', (780, 794), False, 'import adapter\n'), ((799, 839), 'adapter.set_output_files', 'adapter.set_output_files', (['"""lipd-files\\\\"""'], {}), "('lipd-files\\\\')\n", (823, 839), False, 'import adapter\n')]