From 8f7e583a97e1beadf2414f000d3b4c332c31c79c Mon Sep 17 00:00:00 2001
From: Bruce Flynn <brucef@ssec.wisc.edu>
Date: Thu, 10 Sep 2015 01:25:18 +0000
Subject: [PATCH] Sort streams before merging

---
 edosl0util/merge.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/edosl0util/merge.py b/edosl0util/merge.py
index 740161d..61c4362 100644
--- a/edosl0util/merge.py
+++ b/edosl0util/merge.py
@@ -3,7 +3,10 @@ import logging
 from datetime import datetime
 from collections import deque
 
-from edosl0util.stream import PacketStream, MissingPackets
+from edosl0util.stream import (
+    MissingPackets,
+    make_streams,
+)
 
 # date used as a flag value for comparissons
 _FLAG_DATE = datetime(1900, 1, 1)
@@ -88,5 +91,5 @@ def merge(streams, output=sys.stdout):
 
 
 def merge_files(filepaths, destpath):
-    streams = [PacketStream(open(f)) for f in filepaths]
+    streams = make_streams(filepaths)
     merge(streams, output=open(destpath, 'wb'))
-- 
GitLab