change in list jobs function

This commit is contained in:
Muzahid 2022-03-03 21:01:14 +05:30
parent f165f98422
commit 806174e39c
Signed by: cis-muzahid
GPG Key ID: 1DC85E7D3AB613EA
1 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,5 @@
from os import listdir, walk
from os.path import exists, isfile, join, islink
from os.path import exists, isfile, join, islink, isdir
import requests
import re
@ -60,11 +60,12 @@ def list_jobs(directory=".buildbot"):
"""
results = []
files = ["Dockerfile", "build.sh", "test.sh"]
for file in files:
print(join(directory, file))
print(exists(join(directory, file)))
if exists(join(directory, file)) and not islink(join(directory, file)):
results.append(file)
for item in listdir(directory):
print(item)
if isdir(join(directory, item)) and not islink(join(directory, item)):
for file in listdir(join(directory, item)):
if file in files and isfile(join(directory, item, file)) and not islink(join(directory, item, file)):
results.append(file)
return results