From eed52e5247ed7712110e57df9362a4727d076244 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 28 Jan 2020 01:14:35 -0800 Subject: [PATCH] Add function read_directories_file. --- gitcheckup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gitcheckup.py b/gitcheckup.py index 94432af..6032d29 100644 --- a/gitcheckup.py +++ b/gitcheckup.py @@ -101,7 +101,7 @@ def checkup(directory, do_fetch=False): 'push_details': push_details, } -def gitcheckup(do_fetch=False): +def read_directories_file(): directories_file = os.path.join(os.path.dirname(__file__), 'gitcheckup.txt') try: handle = open(directories_file, 'r') @@ -115,6 +115,11 @@ def gitcheckup(do_fetch=False): directories = [line.strip() for line in directories] directories = [line for line in directories if line] + return directories + +def gitcheckup(do_fetch=False): + directories = read_directories_file() + for directory in directories: result = checkup(directory, do_fetch=do_fetch) committed = 'C' if result['committed'] else ' '