Signed-off-by: Daniel Istrate <daniel.alexandrux.istr...@intel.com> --- meta/lib/oeqa/utils/ftools.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/meta/lib/oeqa/utils/ftools.py b/meta/lib/oeqa/utils/ftools.py index 64ebe3d..e396591 100644 --- a/meta/lib/oeqa/utils/ftools.py +++ b/meta/lib/oeqa/utils/ftools.py @@ -1,22 +1,26 @@ import os import re +# Replaces file (path) content with 'data' def write_file(path, data): wdata = data.rstrip() + "\n" with open(path, "w") as f: f.write(wdata) +# Append 'data' to a specified file (path) def append_file(path, data): wdata = data.rstrip() + "\n" with open(path, "a") as f: f.write(wdata) +# Returns the content of the specified file (path) def read_file(path): data = None with open(path) as f: data = f.read() return data +# Removes 'data' from a specified file (path) def remove_from_file(path, data): lines = read_file(path).splitlines() rmdata = data.strip().splitlines() -- 2.1.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core