From a3e3c408f809127bff3f0e4aeb63d82fba376ab4 Mon Sep 17 00:00:00 2001
From: perezgonzalez-irene <iregon@noc.ac.uk>
Date: Thu, 27 Feb 2020 09:30:36 +0000
Subject: [PATCH] Run as script moved externally

---
 read.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/read.py b/read.py
index 7bfc50a..c6335d4 100644
--- a/read.py
+++ b/read.py
@@ -14,6 +14,9 @@ Contains the following functions:
 
     * ERV - does the actual extraction, read and validation of data input data
     * main - the main function of the script
+    
+Can be run as a script with:
+    python -m mdf_reader data_file **kwargs
         
 """
 
@@ -337,8 +340,3 @@ def main(source, data_model = None, data_model_path = None, sections = None,chun
     
     return output()
 
-if __name__=='__main__':
-    kwargs = dict(arg.split('=') for arg in sys.argv[2:])
-    if 'sections' in kwargs.keys():
-        kwargs.update({ 'sections': [ x.strip() for x in kwargs.get('sections').split(",")] })
-    main(sys.argv[1], **kwargs) # kwargs
-- 
GitLab