Пример #1
0
def format_proposed_upgrades(response):
    tabledata = []
    for upgrade in response.json():
        tabledata.append([
            upgrade_id_with_flags(upgrade, omit_flags=('proposed', )),
            TERMINAL.bold(upgrade.get('title')),
        ])
    print TERMINAL.bold('Proposed upgrades:')
    print_table(tabledata, ['ID:', 'Title:'])
Пример #2
0
def format_proposed_upgrades(response):
    tabledata = []
    for upgrade in response.json():
        tabledata.append(
            [upgrade_id_with_flags(upgrade, omit_flags=('proposed',)),
             TERMINAL.bold(upgrade.get('title')),
             ])
    print TERMINAL.bold('Proposed upgrades:')
    print_table(tabledata, ['ID:', 'Title:'])
Пример #3
0
def format_profiles(response):
    tabledata = []
    for profile in response.json():
        tabledata.append(
            [colorize_profile_id(profile['id']),
             colorized_profile_flags(profile),
             TERMINAL.bold(profile['title']),
             colorized_profile_versions(profile)])

    print TERMINAL.bold('Installed profiles:')
    print_table(tabledata, ['ID:', '', 'Title:', 'Versions (DB/FS):'])
Пример #4
0
def format_profiles(response):
    tabledata = []
    for profile in response.json():
        tabledata.append([
            colorize_profile_id(profile['id']),
            colorized_profile_flags(profile),
            TERMINAL.bold(profile['title']),
            colorized_profile_versions(profile)
        ])

    print(TERMINAL.bold('Installed profiles:'))
    print_table(tabledata, ['ID:', '', 'Title:', 'Versions (DB/FS):'])
Пример #5
0
def format_proposed_upgrades(response):
    proposed = []
    for upgrade in response.json():
        is_deferrable = upgrade.get('deferrable', False)

        omit_flags = ('proposed', 'orphan') if is_deferrable else ('proposed',)

        table_row = [upgrade_id_with_flags(upgrade, omit_flags=omit_flags),
                     TERMINAL.bold(upgrade.get('title')),
                     ]
        proposed.append(table_row)

    print TERMINAL.bold('Proposed upgrades:')
    print_table(proposed, ['ID:', 'Title:'])
Пример #6
0
def format_proposed_upgrades(response):
    proposed = []
    for upgrade in response.json():
        is_deferrable = upgrade.get('deferrable', False)

        omit_flags = ('proposed',
                      'orphan') if is_deferrable else ('proposed', )

        table_row = [
            upgrade_id_with_flags(upgrade, omit_flags=omit_flags),
            TERMINAL.bold(upgrade.get('title')),
        ]
        proposed.append(table_row)

    print(TERMINAL.bold('Proposed upgrades:'))
    print_table(proposed, ['ID:', 'Title:'])