juliema / label_reconciliations

Code for reconciling multiple transcriptions for a label
MIT License
26 stars 11 forks source link

Use absolute path for loading d3.js.min #28

Closed rbruhn closed 7 years ago

rbruhn commented 7 years ago

When running the python script from PHP, the relative path used to open d3.min.js causes a file not found error. Using an absolute path allows it to work correctly

I'm not a Python programmer... so might be a better way to do this... but testing on my local server it works as expected.

import os
...
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'd3/d3.min.js')) as js_file:
            d3 = js_file.readlines()
rafelafrance commented 7 years ago

I can't think of a down side to using the absolute path here. Fixing.

rafelafrance commented 7 years ago

Tag/Release v0.2.2 created. Just in case you use them.