mirror of
https://github.com/jlengrand/Ivolution.git
synced 2026-03-10 08:21:18 +00:00
Prepares for changing images background. Bug in there for now.
This commit is contained in:
@@ -65,8 +65,10 @@ class FacemovieThread(threading.Thread, Observable, Observer):
|
||||
#self.console_logger.debug(message)
|
||||
self.my_logger.debug(message)
|
||||
if message[0] == "FILEADD":
|
||||
print "got it !"
|
||||
self.notify(["Interface", [message[0], message[1], 0]])
|
||||
elif message[0] == "FILEDONE":
|
||||
print "tointerface"
|
||||
self.notify(["Interface", message])
|
||||
else:
|
||||
# notify gui about small updates
|
||||
self.notify(["Interface", ["STATUS", message[0], message[1]]])
|
||||
|
||||
@@ -154,6 +154,7 @@ class FaceMovie(object, Observable, Observer):
|
||||
for a_guy in self.guys:
|
||||
ptr += 1
|
||||
if self.run:
|
||||
faceres = 0
|
||||
a_guy.search_face(self.face_params)
|
||||
|
||||
# notifying the Observers
|
||||
@@ -162,10 +163,13 @@ class FaceMovie(object, Observable, Observer):
|
||||
if a_guy.has_face(): # face(s) have been found
|
||||
self.console_logger.info("Face found for %s" % (a_guy.name))
|
||||
self.my_logger.info("Face found for %s" % (a_guy.name))
|
||||
faceres = 1 # for notifying
|
||||
else:
|
||||
self.console_logger.warning("No face found for %s. Skipped . . ." % (a_guy.name))
|
||||
self.my_logger.warning("No face found for %s. Skipped . . ." % (a_guy.name))
|
||||
|
||||
self.notify(["Application", ["FILEDONE", a_guy.name, faceres]])
|
||||
|
||||
def percent(self, num, den):
|
||||
"""
|
||||
Returns a float between 0 and 1, being the percentage given by num / den
|
||||
|
||||
@@ -300,6 +300,8 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable):
|
||||
wx.MutexGuiEnter() # to avoid thread problems
|
||||
self.filelist.InsertItem(item)
|
||||
wx.MutexGuiLeave()
|
||||
elif message[0] == "FILEDONE":
|
||||
print "Done : %s" % (message[1])
|
||||
|
||||
elif len(message) > 1: # system commands shall be ignored
|
||||
self.console_logger.debug("Unrecognized command")
|
||||
|
||||
Reference in New Issue
Block a user