[Commotion-admin] [mlab-observatory] Adding sample checking module, Telescope data parser (#29)

Collin Anderson notifications at github.com
Tue Dec 9 15:32:48 EST 2014


> +  parsed = {}
> +  filename_part = os.path.split(file_path)[1]
> +
> +  match = re.match(
> +      r'^(\d{4}\-\d{2}\-\d{2}\-\d{6})\+(.*?)d_(.+?)_(.+?)_(.+?)\-raw\.csv$',
> +      filename_part)
> +  if len(match.groups()) != 5:
> +    raise ValueError('InputFilenameUnexpectedFormat')
> +
> +  parsed['start_date_string'] = match.group(1)
> +  parsed['duration_string'] = match.group(2)
> +  parsed['site_name'] = match.group(3)
> +  parsed['isp'] = match.group(4)
> +  parsed['metric_name'] = match.group(5)
> +
> +  parsed['metro'] = parsed['site_name'][:3]

I like this, smart.

---
Reply to this email directly or view it on GitHub:
https://github.com/opentechinstitute/mlab-observatory/pull/29/files#r21559878
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-admin/attachments/20141209/e5b603b7/attachment.html>


More information about the Commotion-admin mailing list