Add function read_directories_file.
This commit is contained in:
parent
1abe5a615b
commit
eed52e5247
1 changed files with 6 additions and 1 deletions
|
@ -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 ' '
|
||||||
|
|
Loading…
Reference in a new issue