瀏覽代碼

bug fixes

Steve Nyemba 1 月之前
父節點
當前提交
0a1ba3e50a
共有 2 個文件被更改,包括 9 次插入3 次删除
  1. 1 1
      meta/__init__.py
  2. 8 2
      smart/cmd/__init__.py

+ 1 - 1
meta/__init__.py

@@ -1,6 +1,6 @@
 import os
 __app_name__= "smart-logger"
-__version__ = "1.8"
+__version__ = "1.10"
 __author__ = "Steve L. Nyemba, info@the-phi.com"
 __home__ = os.sep.join([os.environ['HOME'],'.smart-logger'])
 __database__='smart_logs'

+ 8 - 2
smart/cmd/__init__.py

@@ -57,12 +57,18 @@ def read(**args) :
     try:
         _parser = args['parser'] if 'parser' in args else None
         stream = None
+        cmd = None
         if _parser and hasattr(_parser,'cmd'):
             cmd = getattr(_parser,'cmd')
+        elif 'cmd' in args :
+            cmd = args['cmd']
+        if cmd :
             handler = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE)			
             stream = str(handler.communicate()[0]).replace("b'",'')
-            return _parser (stream)
-        return stream
+            
+        return _parser (stream) if _parser else stream
+
+        # return stream
         #
         # At this point we need to load the parser or return the output as is
         # if 'parser' in args :