Add function read_directories_file.

This commit is contained in:
voussoir 2020-01-28 01:14:35 -08:00
parent 1abe5a615b
commit eed52e5247

View file

@ -101,7 +101,7 @@ def checkup(directory, do_fetch=False):
'push_details': push_details, 'push_details': push_details,
} }
def gitcheckup(do_fetch=False): def read_directories_file():
directories_file = os.path.join(os.path.dirname(__file__), 'gitcheckup.txt') directories_file = os.path.join(os.path.dirname(__file__), 'gitcheckup.txt')
try: try:
handle = open(directories_file, 'r') handle = open(directories_file, 'r')
@ -115,6 +115,11 @@ def gitcheckup(do_fetch=False):
directories = [line.strip() for line in directories] directories = [line.strip() for line in directories]
directories = [line for line in directories if line] directories = [line for line in directories if line]
return directories
def gitcheckup(do_fetch=False):
directories = read_directories_file()
for directory in directories: for directory in directories:
result = checkup(directory, do_fetch=do_fetch) result = checkup(directory, do_fetch=do_fetch)
committed = 'C' if result['committed'] else ' ' committed = 'C' if result['committed'] else ' '