Added "find" helper function
This commit is contained in:
8
couchpotato/core/helpers/variable.py
Normal file → Executable file
8
couchpotato/core/helpers/variable.py
Normal file → Executable file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user