Skip to content

Commit 16b78c0

Browse files
committed
Make the script more portable and flexible when being run from different directories or environments
1 parent 95caf9f commit 16b78c0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎generator.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import lxml.html
2020
from lxml import etree # We need to use lxml because it can handle CDATA tags
2121

22-
src_dir='.'
22+
src_dir = os.path.dirname(os.path.realpath(__file__))
2323
target_dir=os.path.join(src_dir, 'generated/')
2424

2525
# Names to use in links
@@ -225,6 +225,7 @@ def generate_images(items_dict, to_update, src_dir, processing_py_jar,
225225

226226
# Check that the processing-py.jar exists and is readable
227227
processing_py_jar_path = os.path.join(src_dir, 'processing-py.jar')
228+
print("Current working directory:", os.getcwd())
228229
print("Checking processing-py.jar at:", processing_py_jar_path)
229230
print("Exists:", os.path.exists(processing_py_jar_path))
230231
print("Permissions:", oct(os.stat(processing_py_jar_path).st_mode)[-3:])

0 commit comments

Comments
 (0)