Enable looking for other HTML files than erg.htm
This commit is contained in:
parent
80fdfdc786
commit
724ac95886
@ -4,21 +4,24 @@ import logging
|
||||
class HtmlLocator:
|
||||
def __init__(self):
|
||||
self.l = logging.getLogger('solo_turnier.html_locator')
|
||||
self.fileName = 'erg.htm'
|
||||
|
||||
def __findRecursivelyCandidates(self, path: str):
|
||||
def __findRecursivelyCandidates(self, path: str, fileName: str):
|
||||
ret = []
|
||||
ls = os.listdir(path)
|
||||
|
||||
if self.fileName in ls and os.path.isfile(os.path.join(path, self.fileName)):
|
||||
ret.append(os.path.join(path, self.fileName))
|
||||
if fileName in ls and os.path.isfile(os.path.join(path, fileName)):
|
||||
ret.append(os.path.join(path, fileName))
|
||||
|
||||
for p in ls:
|
||||
subPath = os.path.join(path, p)
|
||||
if os.path.isdir(subPath):
|
||||
ret = ret + self.__findRecursivelyCandidates(subPath)
|
||||
ret = ret + self.__findRecursivelyCandidates(subPath, fileName)
|
||||
|
||||
return ret
|
||||
|
||||
def findCandidates(self, path: str):
|
||||
return self.__findRecursivelyCandidates(path)
|
||||
return self.__findRecursivelyCandidates(path, 'erg.htm')
|
||||
|
||||
def findPreviewRoundCandidates(self, path: str):
|
||||
candidates = self.__findRecursivelyCandidates(path, 'tabges.htm')
|
||||
return candidates
|
||||
|
Loading…
Reference in New Issue
Block a user