Print out update information.
6781
async def check_update(dev: Device, internet: bool, update: bool):
    """"""
    if internet:
        print("Checking updates from network")
    else:
        print("Not checking updates from internet")
    update_info = await dev.get_update_info(from_network=internet)
    if not update_info.isUpdatable:
        click.echo("No updates available.")
        return
    if not update:
        click.echo("Update available: %s" % update_info)
        click.echo("Use --update to activate update!")
    else:
        click.echo("Activating update, please be seated.")
        res = await dev.activate_system_update()
        click.echo("Update result: %s" % res)
387031
def _update(self, data):
      '''
      '''
      self.bullet = data['bullet']
      self.level = data['level']
      self.text = WikiText(data['text_raw'],
                           data['text_rendered'])
673871
def _print_help(self):
        """"""
        msg = """Commands (type help <command> for details)

CLI:                     help history exit quit
Session, General:        set load save reset
Session, Access Control: allowaccess denyaccess clearaccess
Session, Replication:    allowrep denyrep preferrep blockrep
                         removerep numberrep clearrep
Read Operations:         get meta list log resolve
Write Operations:        update create package archive
                         updateaccess updatereplication
Utilities:               listformats listnodes search ping
Write Operation Queue:   queue run edit clearqueue

Command History:         Arrow Up, Arrow Down
Command Editing:         Arrow Left, Arrow Right, Delete
        """
        if platform.system() != "Windows":
            msg += """Command Completion:      Single Tab: Complete unique command
                         Double Tab: Display possible commands
            """
        d1_cli.impl.util.print_info(msg)
976926
def _print_version(ctx, _, value):
    """"""
    if not value or ctx.resilient_parsing:
        return
    click.echo(analyzer_version)
    ctx.exit()
612521
def info():
    """"""
    print("convenience function for listing prms")
    print(type(prms))
    print(prms.__name__)
    print(f"prm file: {_get_prm_file()}")

    for key in prms.__dict__:
        if isinstance(prms.__dict__[key], box.Box):
            print()
            print(80 * "=")
            print(f"prms.{key}:")
            print(80 * "-")
            for subkey in prms.__dict__[key]:
                print(
                    f"prms.{key}.{subkey} = ",
                    f"{prms.__dict__[key][subkey]}"
                )
            print(80 * "=")
277706
def print_app_info (out=stderr):
    """"""
    print(_("System info:"), file=out)
    print(configuration.App, file=out)
    print(_("Released on:"), configuration.ReleaseDate, file=out)
    print(_("Python %(version)s on %(platform)s") %
                    {"version": sys.version, "platform": sys.platform}, file=out)
    for key in PYTHON_ENV_VARS:
        print_env_info(key, out=out)
    print(configuration.get_modules_info(), file=out)
    stime = strformat.strtime(time.time())
    print(_("Local time:"), stime, file=out)
    print(_("sys.argv:"), sys.argv, file=out)
618090
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib
            self.uptime = datetime.now() - datetime.fromtimestamp(psutil.boot_time())

            # Convert uptime to string (because datetime is not JSONifi)
            stats = str(self.uptime).split('.')[0]
        elif self.input_method == 'snmp':
            # Update stats using SNMP
            uptime = self.get_stats_snmp(snmp_oid=snmp_oid)['_uptime']
            try:
                # In hundredths of seconds
                stats = str(timedelta(seconds=int(uptime) / 100))
            except Exception:
                pass

        # Update the stats
        self.stats = stats

        return self.stats
617641
def print_entitlements(opts, data, page_info=None, show_list_info=True):
    """"""
    if utils.maybe_print_as_json(opts, data, page_info):
        return

    headers = ["Name", "Token", "Created / Updated", "Identifier"]

    rows = []
    for entitlement in sorted(data, key=itemgetter("name")):
        rows.append(
            [
                click.style(
                    "%(name)s (%(type)s)"
                    % {
                        "name": click.style(entitlement["name"], fg="cyan"),
                        "type": "user" if entitlement["user"] else "token",
                    }
                ),
                click.style(entitlement["token"], fg="yellow"),
                click.style(entitlement["updated_at"], fg="blue"),
                click.style(entitlement["slug_perm"], fg="green"),
            ]
        )

    if data:
        click.echo()
        utils.pretty_print_table(headers, rows)

    if not show_list_info:
        return

    click.echo()

    num_results = len(data)
    list_suffix = "entitlement%s" % ("s" if num_results != 1 else "")
    utils.pretty_print_list_info(num_results=num_results, suffix=list_suffix)
1207448
def __list_package_updates(package_name, version):
    

    updates = get_package_update_list(package_name, version)

    if updates['newer_releases'] or updates['pre_releases']:
        print('%s (%s)' % (package_name, version))
        __list_updates('Major releases', updates['major_updates'])
        __list_updates('Minor releases', updates['minor_updates'])
        __list_updates('Patch releases', updates['patch_updates'])
        __list_updates('Pre releases', updates['pre_release_updates'])
        __list_updates('Unknown releases', updates['non_semantic_versions'])
        print("___")
902409
def get_updates(self, *args, **kwargs):
        """"""
        return get_updates(*args, **self._merge_overrides(**kwargs)).run()
1354716
async def get_update_info(self, from_network=True) -> SoftwareUpdateInfo:
        """"""
        if from_network:
            from_network = "true"
        else:
            from_network = "false"
        # from_network = ""
        info = await self.services["system"]["getSWUpdateInfo"](network=from_network)
        return SoftwareUpdateInfo.make(**info)
760746
def print_infos(results):
    
    print('transactions: %i' % results.total_transactions)
    print('timers: %i' % results.total_timers)
    print('errors: %i' % results.total_errors)
    print('test start: %s' % results.start_datetime)
    print('test finish: %s\n' % results.finish_datetime)
540129
def print_details(self):
		""""""
		print("Title:", self.title)
		print("Category:", self.category)
		print("Page: ", self.page)
		print("Size: ", self.size)
		print("Files: ", self.files)
		print("Age: ", self.age)
		print("Seeds:", self.seeders)
		print("Leechers: ", self.leechers)
		print("Magnet: ", self.magnet)
		print("Download: ", self.download)
		print("Verified:", self.isVerified)
568993
def print_results(self):
        """"""
        # Updates
        if self.package_data.get('updates'):
            print('\n{}{}Updates:'.format(c.Style.BRIGHT, c.Fore.BLUE))
            for p in self.package_data['updates']:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # Packaging
        print('\n{}{}Package:'.format(c.Style.BRIGHT, c.Fore.BLUE))
        for p in self.package_data['package']:
            if isinstance(p.get('output'), list):
                n = 5
                list_data = p.get('output')
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, ', '.join(p.get('output')[:n])
                    )
                )
                del list_data[:n]
                for data in [
                    list_data[i : i + n] for i in range(0, len(list_data), n)  # noqa: E203
                ]:
                    print(
                        '{!s:<20}{}{} {!s:<50}'.format(
                            '', c.Style.BRIGHT, c.Fore.CYAN, ', '.join(data)
                        )
                    )

            else:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # Bundle
        if self.package_data.get('bundle'):
            print('\n{}{}Bundle:'.format(c.Style.BRIGHT, c.Fore.BLUE))
            for p in self.package_data['bundle']:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # ignore exit code
        if not self.args.ignore_validation:
            print('\n')  # separate errors from normal output
            # print all errors
            for error in self.package_data.get('errors'):
                print('{}{}'.format(c.Fore.RED, error))
                self.exit_code = 1
598001
def print_version(self):
        

        if not self._version:
            return self

        if not self._title:
            print('  %s %s' % (self._name, self._version))
            return self

        print('  %s (%s %s)' % (self._title, self._name, self._version))
        return self
1123702
def update(verbose=False):
    
    local = local_list()
    remote = dict(remote_list())

    updated = False

    for name, date in local:
        if name in remote and remote[name] > date:
            updated = True
            if verbose:
                print("Updating '%s'..." % name)
            download(name)

    if not updated and verbose:
        print("Nothing to update.")
601740
def update(self, callback=int):
        """"""
        # print(self._pending_modifications)
        add_var = self._pending_modifications.add_var
        if len(add_var) > 0:
            self._add_variables(add_var)
            self._pending_modifications.add_var = []
        callback()

        add_constr = self._pending_modifications.add_constr
        if len(add_constr) > 0:
            self._add_constraints(add_constr)
            self._pending_modifications.add_constr = []

        add_constr_sloppy = self._pending_modifications.add_constr_sloppy
        if len(add_constr_sloppy) > 0:
            self._add_constraints(add_constr_sloppy, sloppy=True)
            self._pending_modifications.add_constr_sloppy = []

        var_lb = self._pending_modifications.var_lb
        var_ub = self._pending_modifications.var_ub
        if len(var_lb) > 0 or len(var_ub) > 0:
            self._set_variable_bounds_on_problem(var_lb, var_ub)
            self._pending_modifications.var_lb = []
            self._pending_modifications.var_ub = []

        rm_var = self._pending_modifications.rm_var
        if len(rm_var) > 0:
            self._remove_variables(rm_var)
            self._pending_modifications.rm_var = []
        callback()

        rm_constr = self._pending_modifications.rm_constr
        if len(rm_constr) > 0:
            self._remove_constraints(rm_constr)
            self._pending_modifications.rm_constr = []