from app.views.export import write_all_measurements_csv
import tempfile
import os

f = open("app/static/exports/AllMeasurements_inprogress.csv", "w")

try:
    write_all_measurements_csv(f)

finally:
    f.close

os.rename("app/static/exports/AllMeasurements_inprogress.csv", "app/static/exports/AllMeasurements.csv")


from app.views.export import write_all_measurements_csv
import tempfile
import os

f = open("{}/app/static/exports/AllMeasurements_inprogress.csv".format(os.path.dirname(os.path.realpath(__file__))), "w")

try:
    write_all_measurements_csv(f)

finally:
    f.close

os.rename("app/static/exports/AllMeasurements_inprogress.csv", "app/static/exports/AllMeasurements.csv")


Add application directory to export directory
Add application directory to export directory

  from app.views.export import write_all_measurements_csv
  import tempfile
  import os
  
- f = open("app/static/exports/AllMeasurements_inprogress.csv", "w")
+ f = open("{}/app/static/exports/AllMeasurements_inprogress.csv".format(os.path.dirname(os.path.realpath(__file__))), "w")
  
  try:
      write_all_measurements_csv(f)
  
  finally:
      f.close
  
  os.rename("app/static/exports/AllMeasurements_inprogress.csv", "app/static/exports/AllMeasurements.csv")
  
  
Add application directory to export directory
## Code Before:
from app.views.export import write_all_measurements_csv
import tempfile
import os

f = open("app/static/exports/AllMeasurements_inprogress.csv", "w")

try:
    write_all_measurements_csv(f)

finally:
    f.close

os.rename("app/static/exports/AllMeasurements_inprogress.csv", "app/static/exports/AllMeasurements.csv")


## Instruction:
Add application directory to export directory
## Code After:
from app.views.export import write_all_measurements_csv
import tempfile
import os

f = open("{}/app/static/exports/AllMeasurements_inprogress.csv".format(os.path.dirname(os.path.realpath(__file__))), "w")

try:
    write_all_measurements_csv(f)

finally:
    f.close

os.rename("app/static/exports/AllMeasurements_inprogress.csv", "app/static/exports/AllMeasurements.csv")

