Make paths relative to source file in extract_data
This commit is contained in:
parent
d0ab1a641a
commit
25e61bb9cf
@ -64,9 +64,11 @@ def make_data_extract(current_time, connection, zip_file_path):
|
|||||||
|
|
||||||
zip_file_path.parent.mkdir(parents=True, exist_ok=True)
|
zip_file_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
source_dir_path = Path(__file__).parent
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with zipfile.ZipFile(zip_file_path, mode='w') as newzip:
|
with zipfile.ZipFile(zip_file_path, mode='w') as newzip:
|
||||||
newzip.write('README.txt')
|
newzip.write(source_dir_path / 'README.txt')
|
||||||
newzip.write('/tmp/building_attributes.csv', arcname='building_attributes.csv')
|
newzip.write('/tmp/building_attributes.csv', arcname='building_attributes.csv')
|
||||||
newzip.write('/tmp/building_uprns.csv', arcname='building_uprns.csv')
|
newzip.write('/tmp/building_uprns.csv', arcname='building_uprns.csv')
|
||||||
newzip.write('/tmp/edit_history.csv', arcname='edit_history.csv')
|
newzip.write('/tmp/edit_history.csv', arcname='edit_history.csv')
|
||||||
|
Loading…
Reference in New Issue
Block a user