From 5a26988410c6a0140af190e05600530bec990613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Tue, 30 Aug 2016 16:23:19 +0300 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 90586c7..34bee3d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ We encourage contributions to the project. To contribute: ## Changelog -See [changelog](https://github.com/Pardus-Kurumsal/lider/wiki/Changelog) to learn what we have been up to. +See [changelog](https://github.com/Pardus-Kurumsal/ahenk/wiki/Changelog) to learn what we have been up to. ## Roadmap From 252d89836047799645f98b416f0ef08159739a82 Mon Sep 17 00:00:00 2001 From: canerfyz Date: Wed, 7 Sep 2016 10:00:39 +0300 Subject: [PATCH 2/3] A util method that reads a file line by line and returns a list of read lines --- opt/ahenk/base/util/util.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opt/ahenk/base/util/util.py b/opt/ahenk/base/util/util.py index 364f3a3..c24d732 100644 --- a/opt/ahenk/base/util/util.py +++ b/opt/ahenk/base/util/util.py @@ -95,6 +95,15 @@ class Util: finally: return content + @staticmethod + def read_file_by_line(full_path, mode='r'): + line_list = list() + with open(full_path, mode) as f: + lines = f.readlines() + for line in lines: + line_list.append(line) + return line_list + @staticmethod def write_file(full_path, content, mode='w+'): file = None From 7f212b9098fa72369b997de86d2606de05fc9b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Thu, 8 Sep 2016 15:03:31 +0300 Subject: [PATCH 3/3] minor fixing util --- opt/ahenk/base/util/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opt/ahenk/base/util/util.py b/opt/ahenk/base/util/util.py index c24d732..590e8e1 100644 --- a/opt/ahenk/base/util/util.py +++ b/opt/ahenk/base/util/util.py @@ -44,7 +44,8 @@ class Util: @staticmethod def delete_file(full_path): try: - os.remove(full_path) + if Util.is_exist(full_path): + os.remove(full_path) except: raise