Skip to content

Commit

Permalink
Create download_db_file.py
Browse files Browse the repository at this point in the history
  • Loading branch information
victordomingos authored Apr 6, 2017
1 parent 0b85878 commit 3313f87
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ctt_tracking_iPhone/download_db_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import requests
import console
import time
import os
import runpy
import time
from zipfile import ZipFile
import io
import gzip

os.chdir('/private/var/mobile/Containers/Shared/AppGroup/5E22383E-122A-4BBE-9677-E4A0EF63E7C3/Pythonista3/Documents/ctt_tracking_ios')

# personalizar a linha seguinte com o URL da mini_db no Dropbox, por exemplo:
ZIP_MINI_DB = 'mini_db_PT_Tracking.sqlite.zip?raw=1'

#print("\nA obter base de dados atualizada...")
console.show_activity()
pedido = requests.get(ZIP_MINI_DB)
ficheiro = ZipFile(io.BytesIO(pedido.content))
console.hide_activity()
ficheiro.extract('mini_db_PT_Tracking.sqlite')

0 comments on commit 3313f87

Please sign in to comment.