コード例 #1
0
    def execute(self, args, uargs):
        wm = self.get_workspacemanager()
        name = self._find_profile_name(args)
        profiles = []

        for name in get_optional_arg(args, "profiles", []):
            profiles.append(wm.get_profile(name))

        # If not profile given, list all profiles
        if len(profiles) == 0:
            profiles.extend(wm.list_profiles().values())

        ipmap = wm.list_installed_packages()

        renderer = ProfileListRenderer(wm.ws_root_folder)
        for profile in profiles:
            sync = wm.is_profile_sync(profile)
            iplist = []
            if sync:
                iplist = wm.get_profile_dependencies(profile)
            else:
                iplist = find_manifest_list(profile.packages,
                                            ipmap,
                                            ignore_unknown=True)
            renderer.append_profile(profile, sync, iplist)

        wm.print_renderer(renderer)
コード例 #2
0
ファイル: package.py プロジェクト: NicolasLambert/leaf
    def execute(self, args, uargs):
        pm = PackageManager()
        metafilter = MetaPackageFilter()

        if not get_optional_arg(args, "show_all_packages", False):
            metafilter.only_master_packages()

        for t in get_optional_arg(args, "tags", []):
            metafilter.with_tag(t)

        for kw in get_optional_arg(args, "keywords", []):
            metafilter.with_keyword(kw)

        # Print filtered packages
        rend = ManifestListRenderer(metafilter)
        mflist = pm.list_installed_packages().values()
        rend.extend(filter(metafilter.matches, mflist))
        pm.print_renderer(rend)