From 3e05bc8d7828b496894d1457e72eb44045fdbec7 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Mon, 28 Jul 2014 16:06:05 +1200 Subject: [PATCH] Added "find" helper function --- couchpotato/core/helpers/variable.py | 8 ++++++++ 1 file changed, 8 insertions(+) mode change 100644 => 100755 couchpotato/core/helpers/variable.py diff --git a/couchpotato/core/helpers/variable.py b/couchpotato/core/helpers/variable.py old mode 100644 new mode 100755 index fc844aaf..db68da2f --- a/couchpotato/core/helpers/variable.py +++ b/couchpotato/core/helpers/variable.py @@ -380,3 +380,11 @@ def getFreeSpace(directories): free_space[folder] = size return free_space + + +def find(func, iterable): + for item in iterable: + if func(item): + return item + + return None