Closed jacobwhall closed 2 years ago
Replaced the current check / directory change with a more flexible approach that makes sure the config exists, is the right config, and then changes to the base_directory path from the config.
See 952287b4f5d9f1279ad74e233bd47a621ae91053
This code throws an error when I run
tuff_osm.py
locally:https://github.com/aiddata/china-osm-geodata/blob/c1ff3fafd4997bf9711e4821c392886414479ddb/tuff_osm.py#L30-L33
sys only has the ps1 attribute in interactive modes.
Here is an example in the Python interpreter:
But saving the following code into a file and executing it with
python file.py
prints False:I suggest we find a better method of checking whether the program is running as a batch job, or change directories to the project's root regardless of what context the script is running in.