Ejemplo n.º 1
0
def getRepos(client, path):
  logging.info('Scanning repos')
  response = client.propfind('/{}/'.format(path),
                                           depth=1)
  anchorStart, anchorEnd = makeHTMLTags('D:href')
  anchor = anchorStart + SkipTo(anchorEnd).setResultsName('body') + anchorEnd
  return [tokens.body for tokens in anchor.searchString(response.content) if '.git' in tokens.body]
Ejemplo n.º 2
0
def getBuildVer(client, folder, root_build):
  """
  Get build version
  """
  response = client.propfind('/{}/'.format(folder), depth=1)
  anchorStart, anchorEnd = makeHTMLTags('D:href')
  anchor = anchorStart + SkipTo(anchorEnd).setResultsName('body') + anchorEnd
  fwList = {os.path.basename(tokens.body) for tokens in anchor.searchString(response.content)}
  try:
    # get rid of extensions
    fwList = [os.path.splitext(i)[0] for i in fwList if root_build in i]
    allBuilds = []
    for i in fwList:
      try:
        # ripping only build versions
        allBuilds.append(int(i.split(root_build)[1]))
      except Exception:
        continue
    buildNum = max(allBuilds)
  except Exception as e:
    buildNum = 0
  return buildNum