From fec8f06135a4f47e0964438f8ed381e39c8b57f4 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 24 Aug 2012 18:21:19 -0400 Subject: [PATCH] cc-3936: - added get_owner to actually get the owner of the file for event objects. - removed possibly annoying logging. --- python_apps/media-monitor2/media/monitor/owners.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python_apps/media-monitor2/media/monitor/owners.py b/python_apps/media-monitor2/media/monitor/owners.py index a8a39cd7d..9d9c043bf 100644 --- a/python_apps/media-monitor2/media/monitor/owners.py +++ b/python_apps/media-monitor2/media/monitor/owners.py @@ -11,6 +11,14 @@ def reset_owners(): global owners owners = {} + +def get_owner(f): + """ + Get the owner id of the file 'f' + """ + return owners[f] if f in owners else -1 + + def add_file_owner(f,owner): """ Associate file f with owner. If owner is -1 then do we will not record it @@ -40,7 +48,5 @@ def remove_file_owner(f): if f in owners: del owners[f] return True - else: - log.warn("Trying to delete file that does not exist: '%s'" % f) - return False + else: return False