From afd2180990957a71e25bd6c9e8981f376887e7ac Mon Sep 17 00:00:00 2001
From: Branson Stephens <branson.stephens@ligo.org>
Date: Mon, 1 Jun 2015 12:01:04 -0500
Subject: [PATCH] Fixed bug with translator for CWB events. Needs to rewind the
 file.

---
 gracedb/translator.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gracedb/translator.py b/gracedb/translator.py
index fdd5da74e..483e881af 100644
--- a/gracedb/translator.py
+++ b/gracedb/translator.py
@@ -517,6 +517,8 @@ class CwbData(Translator):
             key, val = line
             rawdata[key] = val.split()
 
+        datafile.seek(0)
+
         # scan down for FAR
         next_line_is_far = False
         for line in datafile:
@@ -568,6 +570,7 @@ class CwbData(Translator):
         # Check for the links at the end.
         ced_link = None
         fits_skymap_link = None
+        datafile.seek(0)
         for line in datafile:
             if line.startswith("http"):
                 if line.find(".fits") > 0:
-- 
GitLab