Skip to content

Commit

Permalink
add delete images in time-lapse
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardosgeral committed Feb 26, 2019
1 parent 6c68679 commit 2a36149
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions camera_timelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

import threading
import datetime, subprocess, os
from time import sleep

import re
class capture(threading.Thread):

def __init__(self, picsLocation, testname, testtype, elapsed, flowrate):
Expand Down Expand Up @@ -42,4 +41,10 @@ def CaptureImage(self):
pass

def run(self):
self.CaptureImage()
self.CaptureImage()


def delImages(picsLocation):
for f in os.listdir(picsLocation):
if re.search(".jpg", f): # if the file has the extension .jpg
os.remove(os.path.join(picsLocation, f)) #remove the file
3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ def read_display_write(e_rdw): # read and display data in page "record" and writ

if delImages == 1:
# delete images
#todo
pass
cm.delImages(picsLocation)

# disconnect from database
test_end() # morse code sounds to alert for final test
Expand Down

0 comments on commit 2a36149

Please sign in to comment.