diff --git a/python/obitools3/commands/check.pyx b/python/obitools3/commands/check.pyx new file mode 100644 index 0000000..d72b128 --- /dev/null +++ b/python/obitools3/commands/check.pyx @@ -0,0 +1,68 @@ +#cython: language_level=3 + +from obitools3.dms.dms import DMS # TODO cimport doesn't work +from obitools3.dms.view.view import View # TODO cimport doesn't work + + +__title__="Print a preview of a DMS, view, column...." + +default_config = { 'inputview' : None, + } + + +# TODO make it work with URIs + +def addOptions(parser): + + # TODO put this common group somewhere else but I don't know where + group=parser.add_argument_group('DMS and view options') + + group.add_argument('--default-dms','-d', + action="store", dest="obi:defaultdms", + metavar='', + default=None, + type=str, + help="Name of the default DMS for reading and writing data.") + + group.add_argument('--view','-v', + action="store", dest="obi:view", + metavar='', + default=None, + type=str, + help="Name of the view.") + + +# group=parser.add_argument_group('obi check specific options') + +# group.add_argument('--print', +# action="store", dest="less:print", +# metavar='', +# default=None, +# type=int, +# help="Print N sequences (default: 10)") + + +def run(config): + + # Open DMS + d = DMS.open(config['obi']['defaultdms']) + + # Open input view uif there is one + if config['obi']['inputview'] is not None : + iview = View.open(d, config['obi']['inputview']) + print(repr(iview)) + + else : + for v in d : + print(repr(v)) + + d.close() + + + + + + + + + \ No newline at end of file