##// END OF EJS Templates
Fix CLI and remove imports warnings
Juan C. Espinoza -
r1284:f79a273a3a9b
parent child
Show More
@@ -4,8 +4,6 import subprocess
4 4 import os
5 5 import sys
6 6 import glob
7 save_stdout = sys.stdout
8 sys.stdout = open('/dev/null', 'w')
9 7 from multiprocessing import cpu_count
10 8 from schainpy.controller import Project
11 9 from schainpy.model import Operation, ProcessingUnit
@@ -19,7 +17,6 try:
19 17 from queue import Queue
20 18 except:
21 19 from Queue import Queue
22 sys.stdout = save_stdout
23 20
24 21
25 22 def getProcs():
@@ -45,11 +42,19 def getOperations():
45 42
46 43 def getArgs(op):
47 44 module = locate('schainpy.model.{}'.format(op))
45 try:
46 obj = module(1,2,3,Queue(),5,6)
47 except:
48 obj = module()
48 49
49 if hasattr(module, '__attrs__'):
50 args = module.__attrs__
50 if hasattr(obj, '__attrs__'):
51 args = obj.__attrs__
52 else:
53 if hasattr(obj, 'myrun'):
54 args = inspect.getfullargspec(obj.myrun).args
51 55 else:
52 args = inspect.getargspec(module.run).args
56 args = inspect.getfullargspec(obj.run).args
57
53 58 try:
54 59 args.remove('self')
55 60 except Exception as e:
@@ -29,7 +29,7 import pickle
29 29 try:
30 30 import digital_rf
31 31 except:
32 print('You should install "digital_rf" module if you want to read Digital RF data')
32 pass
33 33
34 34 @MPDecorator
35 35 class DigitalRFReader(ProcessingUnit):
@@ -14,7 +14,7 from time import sleep
14 14 try:
15 15 import pyfits
16 16 except ImportError as e:
17 print("Fits data cannot be used. Install pyfits module")
17 pass
18 18
19 19 from xml.etree.ElementTree import ElementTree
20 20
@@ -23,9 +23,7 from schainpy.utils import log
23 23 try:
24 24 import madrigal.cedar
25 25 except:
26 log.warning(
27 'You should install "madrigal library" module if you want to read/write Madrigal data'
28 )
26 pass
29 27
30 28 try:
31 29 basestring
@@ -19,7 +19,7 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation
19 19 try:
20 20 import digital_rf_hdf5
21 21 except:
22 print('You should install "digital_rf_hdf5" module if you want to read USRP data')
22 pass
23 23
24 24 class USRPReader(ProcessingUnit):
25 25 '''
@@ -23,9 +23,7 from schainpy.utils import log
23 23 try:
24 24 from netCDF4 import Dataset
25 25 except:
26 log.warning(
27 'You should install "netCDF4" module if you want to read/write NCDF files'
28 )
26 pass
29 27
30 28 UT1970 = datetime.datetime(1970, 1, 1) - datetime.timedelta(seconds=time.timezone)
31 29
@@ -9,7 +9,7 try:
9 9 import paramiko
10 10 import scp
11 11 except:
12 print("You should install paramiko and scp libraries \nif you want to use SSH protocol to upload files to the server")
12 pass
13 13
14 14 import time
15 15
General Comments 0
You need to be logged in to leave comments. Login now