def do_query(self, line): from smart.commands import query try: try: opts = query.parse_options(shlex.split(line)) except ValueError, e: raise Error, str(e) query.main(self._ctrl, opts, reloadchannels=False)
def parse_options(argv): opts = query.parse_options(argv, help=HELP) opts.name = opts.args opts.summary = opts.args opts.description = opts.args for arg in argv: if ":/" in arg: opts.url.append(arg) elif "/" in arg: opts.path.append(arg) opts.show_summary = True opts.hide_version = True opts.args = [] return opts
def parse_options(argv): opts = query.parse_options(argv, usage=USAGE, \ description=DESCRIPTION, examples=EXAMPLES) opts.name = opts.args opts.summary = opts.args opts.description = opts.args for arg in argv: if ":/" in arg: opts.url.append(arg) elif "/" in arg: opts.path.append(arg) opts.show_summary = True opts.hide_version = True opts.args = [] return opts
def parse_options(argv): opts = query.parse_options(argv, usage=USAGE, \ description=DESCRIPTION, examples=EXAMPLES) if not argv: raise Error, _("Search expression not specified") opts.name = opts.args opts.summary = opts.args opts.description = opts.args for arg in argv: if ":/" in arg: opts.url.append(arg) elif "/" in arg: opts.path.append(arg) opts.show_summary = True opts.hide_version = True opts.args = [] return opts