From a8c7e35319eb86bbca9268bae5593992eb8af946 Mon Sep 17 00:00:00 2001
From: Bruce Flynn <brucef@ssec.wisc.edu>
Date: Thu, 7 Jan 2016 21:44:07 +0000
Subject: [PATCH] Add crinfo CLI tool

---
 edosl0util/cli/crinfo.py | 20 ++++++++++++++++++++
 edosl0util/headers.py    |  3 +++
 2 files changed, 23 insertions(+)
 create mode 100644 edosl0util/cli/crinfo.py

diff --git a/edosl0util/cli/crinfo.py b/edosl0util/cli/crinfo.py
new file mode 100644
index 0000000..2a53ce5
--- /dev/null
+++ b/edosl0util/cli/crinfo.py
@@ -0,0 +1,20 @@
+import logging
+from pprint import pprint
+
+from edosl0util.cli import util
+from edosl0util import crio
+
+LOG = logging
+
+
+def main():
+    parser = util.default_parser()
+    parser.add_argument('filepath')
+    args = parser.parse_args()
+    util.configure_logging(args)
+
+    pprint(crio.read(args.filepath))
+
+
+if __name__ == '__main__':
+    main()
diff --git a/edosl0util/headers.py b/edosl0util/headers.py
index 2eb2ff8..e145e58 100644
--- a/edosl0util/headers.py
+++ b/edosl0util/headers.py
@@ -63,6 +63,9 @@ class Timecode(BaseStruct):
     """
     Secondary header timecode baseclass.
     """
+    def __repr__(self):
+        return str(self.asdatetime())
+
     def astimestamp(self):
         raise NotImplementedError()
 
-- 
GitLab