Exemple #1
0
def show_bundles(args: list = None) -> None:
    """
        Prints information about bundles that are not nessesarily frameworks

        https://developer.apple.com/documentation/foundation/nsbundle/1413705-allbundles?language=objc

        :param args:
        :return:
    """

    api = state_connection.get_api()
    bundles = api.ios_bundles_get_bundles()

    # Just dump it to the screen
    click.secho(
        tabulate(
            [[
                entry['executable'],
                entry['bundle'],
                entry['version'],
                entry['path'] if _should_print_full_path(args) else
                pretty_concat(entry['path'], 40, True),
            ] for entry in bundles],
            headers=['Executable', 'Bundle', 'Version', 'Path'],
        ))
Exemple #2
0
def show_frameworks(args: list = None) -> None:
    """
        Prints information about bundles that represent frameworks.

        https://developer.apple.com/documentation/foundation/nsbundle/1408056-allframeworks?language=objc

        :param args:
        :return:
    """

    api = state_connection.get_api()
    frameworks = api.ios_bundles_get_frameworks()

    # apply filters
    if not _should_include_apple_bundles(args):
        frameworks = [
            f for f in frameworks if not _is_apple_bundle(f['bundle'])
        ]

    # Just dump it to the screen
    click.secho(
        tabulate(
            [[
                entry['executable'],
                entry['bundle'],
                entry['version'],
                entry['path'] if _should_print_full_path(args) else
                pretty_concat(entry['path'], 40, True),
            ] for entry in frameworks],
            headers=['Executable', 'Bundle', 'Version', 'Path'],
        ))
    def test_pretty_concat_with_more_than_max_chars_to_the_left(self):
        result = pretty_concat('testing', 5, left=True)

        self.assertEqual(result, '...sting')
    def test_pretty_concat_with_more_than_max_chars(self):
        result = pretty_concat('testing', 5)

        self.assertEqual(result, 'testi...')
    def test_pretty_concat_with_less_than_seventy_five_chars(self):
        result = pretty_concat('test')

        self.assertEqual(result, 'test')