foss2serve / corral-dev

Development effort for Corral
GNU General Public License v3.0
0 stars 1 forks source link

Prepare for syntax change in urls.md #7

Open StoneyJackson opened 8 years ago

StoneyJackson commented 8 years ago

We are planning to change the format of urls.md. It will contain more data than just URLs. Something like this would probably do for now

import re
def parse_urls_md(lines):
  url_pattern = re.compile(r'- +(http.*\.git)')
  urls = []
  for line in lines:
    line = line.strip()
    match = url_pattern.search(line)
    if match is not None:
      urls.append(match.group(1))
  return urls

The regex can be tuned later if it turns out to be insufficient.