def run(self, context, args, kwargs, opargs): nss = self.target.namespaces() cmds = self.target.commands() # Only display builtin items if in the RootNamespace obj = context.ml.get_relative_object(context.ml.path[-1], args) if obj.__class__.__name__ == 'RootNamespace': output_msg('Builtin items:', attrs=['bold']) output_list(context.ml.builtin_commands.keys()) output_msg('Current namespace items:', attrs=['bold']) out = cmds.keys() out += [ns.get_name() for ns in sorted(nss)] output_list(out)
def run(self, context, args, kwargs, opargs): output_msg(_("You may try the following URLs to access" " the web user interface:")) my_ips = context.connection.call_sync('network.config.get_my_ips') my_protocols = context.connection.call_sync( 'system.ui.get_config') urls = [] for proto in my_protocols['webui_procotol']: proto_port = my_protocols['webui_{0}_port'.format(proto.lower())] if proto_port is not None: if proto_port in [80, 443]: for x in my_ips: urls.append('{0}://{1}'.format(proto.lower(), x)) else: for x in my_ips: urls.append('{0}://{1}:{2}'.format(proto.lower(), x, proto_port)) output_list(urls, label=_('URLs'))
def run(self, context, args, kwargs, opargs): output_msg( _("You may try the following URLs to access" " the web user interface:")) my_ips = context.connection.call_sync('network.config.get_my_ips') my_protocols = context.connection.call_sync('system.ui.get_config') urls = [] for proto in my_protocols['webui_procotol']: proto_port = my_protocols['webui_{0}_port'.format(proto.lower())] if proto_port is not None: if proto_port in [80, 443]: for x in my_ips: urls.append('{0}://{1}'.format(proto.lower(), x)) else: for x in my_ips: urls.append('{0}://{1}:{2}'.format( proto.lower(), x, proto_port)) output_list(urls, label=_('URLs'))
def run(self, context, args, kwargs, opargs): result = context.connection.call_sync('shares.get_connected_clients', self.parent.entity['id']) output_list(result, _("IP address"))
def run(self, context, args, kwargs, opargs): histroy_range = readline.get_current_history_length() history = [readline.get_history_item(i) for i in range(histroy_range)] output_less(lambda: output_list(history, label="Command History"))
def run(self, context, args, kwargs, opargs): output_msg(_("These are the active ips from all the configured" " network interfaces")) output_list(context.connection.call_sync('network.config.get_my_ips'), _("IP Addresses"))
def run(self, context, args, kwargs, opargs): output_msg( _("These are the active ips from all the configured" " network interfaces")) output_list(context.connection.call_sync('network.config.get_my_ips'), _("IP Addresses"))