mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

misc: Functions for transform object to other types. path: Functions for path handling. test: Functions for operations related to test cases and suites. [YOCTO #10232] (From OE-Core rev: 102d04ccca3ca89d41b76a8c44e0ca0f436b7004) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
20 lines
441 B
Python
20 lines
441 B
Python
# Copyright (C) 2016 Intel Corporation
|
|
# Released under the MIT license (see COPYING.MIT)
|
|
|
|
import os
|
|
import sys
|
|
|
|
def findFile(file_name, directory):
|
|
"""
|
|
Search for a file in directory and returns its complete path.
|
|
"""
|
|
for r, d, f in os.walk(directory):
|
|
if file_name in f:
|
|
return os.path.join(r, file_name)
|
|
return None
|
|
|
|
def remove_safe(path):
|
|
if os.path.exists(path):
|
|
os.remove(path)
|
|
|