예제 #1
0
    def add_framework(cls, project, package_name):
        cls.show_project_info(project)

        package_data = cls.check_added_package(project, package_name)
        if not package_data is None:
            print MultiLanguage.get_string('PACKAGE_PKG_ADDED_WARN_FMT', (package_name, package_name))
            return

        engine = get_engine_of_project(project)
        if engine is None:
            print MultiLanguage.get_string('PACKAGE_PROJ_UNKOWN_ENGINE')
            return

        package_data = PackageHelper.get_installed_package_newest_version(package_name, engine)
        if package_data is None:
            print MultiLanguage.get_string('PACKAGE_NOT_FOUND_PKG_FMT', (package_name, engine, package_name))
            return

        print MultiLanguage.get_string('PACKAGE_PKG_ADD_FMT',
              (package_data["name"], package_data["version"], package_data["author"]))

        # unpacking files
        ensure_directory(project["packages_dir"])
        unpacker = ZipUnpacker(PackageHelper.get_installed_package_zip_path(package_data))
        unpacker.unpack(project["packages_dir"])

        # execute install.json
        install_helper = AddFrameworkHelper(project, package_data)
        install_helper.run()
예제 #2
0
    def add_framework(cls, project, package_name):
        cls.show_project_info(project)

        package_data = cls.check_added_package(project, package_name)
        if not package_data is None:
            print cocos.MultiLanguage.get_string('PACKAGE_PKG_ADDED_WARN_FMT') % (package_name, package_name)
            return

        engine = get_engine_of_project(project)
        if engine is None:
            print cocos.MultiLanguage.get_string('PACKAGE_PROJ_UNKOWN_ENGINE')
            return

        package_data = PackageHelper.get_installed_package_newest_version(package_name, engine)
        if package_data is None:
            print cocos.MultiLanguage.get_string('PACKAGE_NOT_FOUND_PKG_FMT') % (package_name, engine, package_name)
            return

        print cocos.MultiLanguage.get_string('PACKAGE_PKG_ADD_FMT') %\
              (package_data["name"], package_data["version"], package_data["author"])

        # unpacking files
        ensure_directory(project["packages_dir"])
        unpacker = ZipUnpacker(PackageHelper.get_installed_package_zip_path(package_data))
        unpacker.unpack(project["packages_dir"])

        # execute install.json
        install_helper = AddFrameworkHelper(project, package_data)
        install_helper.run()
예제 #3
0
    def add_framework(cls, project, package_name):
        package_data = PackageHelper.get_installed_package_data(package_name)
        if package_data is None:
            print "[PACKAGE] not found package '%s'" % package_name
            return

        print "[PROJECT] > project path: %s" % project["path"]
        print "[PROJECT] > project type: %s" % project["type"]
        print "[PROJECT] > Adding '%s %s (%s)' ..." % (
            package_data["name"], package_data["version"], package_data["author"])

        # unpacking files
        ensure_directory(project["packages_dir"])
        unpacker = ZipUnpacker(PackageHelper.get_installed_package_zip_path(package_data))
        unpacker.unpack(project["packages_dir"])

        # execute install.json
        install_helper = AddFrameworkHelper(project, package_data)
        install_helper.run()
예제 #4
0
    def add_framework(cls, project, package_name):
        package_data = PackageHelper.get_installed_package_data(package_name)
        if package_data is None:
            print "[PACKAGE] not found package '%s'" % package_name
            return

        print "[PROJECT] > project path: %s" % project["path"]
        print "[PROJECT] > project type: %s" % project["type"]
        print "[PROJECT] > Adding '%s %s (%s)' ..." % (package_data["name"],
                                                       package_data["version"],
                                                       package_data["author"])

        # unpacking files
        ensure_directory(project["packages_dir"])
        unpacker = ZipUnpacker(
            PackageHelper.get_installed_package_zip_path(package_data))
        unpacker.unpack(project["packages_dir"])

        # execute install.json
        install_helper = AddFrameworkHelper(project, package_data)
        install_helper.run()