def run(self, argv): args = self.parse_args(argv) name = args.name force = args.force package_data = PackageHelper.query_package_data(name) if package_data is False: message = "Fatal: not found package '%s'" % name raise cocos.CCPluginError(message) PackageHelper.download_package_zip(package_data, force) PackageHelper.add_package(package_data) print ""
def run(self, argv): packages = PackageHelper.get_installed_packages() keys = packages.keys() if len(keys) == 0: print "[PACKAGE] not found installed packages" return print "[PACKAGE] installed packages:" keys.sort() for k in keys: package_data = PackageHelper.get_installed_package_data(packages[k]["name"]) print "[PACKAGE] > %s %s (%s)" % (package_data["name"], package_data["version"], package_data["author"]) print ""
def run(self, argv): packages = PackageHelper.get_installed_packages() keys = packages.keys() if len(keys) == 0: print cocos.MultiLanguage.get_string('PACKAGE_LIST_NOT_FOUND') return print cocos.MultiLanguage.get_string('PACKAGE_LIST_TIP') keys.sort() for k in keys: package_data = PackageHelper.get_installed_package_data(packages[k]["name"]) print cocos.MultiLanguage.get_string('PACKAGE_ITEM_FMT')\ % (package_data["name"], package_data["version"], package_data["author"]) print ""
def run(self, argv): args = self.parse_args(argv) name = args.name version = args.version force = args.force package_data = PackageHelper.query_package_data(name, version) if package_data is None: message = MultiLanguage.get_string( 'PACKAGE_INSTALL_ERROR_NO_PKG_FMT', (name, version)) raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_OTHERS) if isinstance(package_data, list): for data in package_data: self.download(force, data) return if package_data.has_key('err'): message = MultiLanguage.get_string( 'PACKAGE_INSTALL_ERROR_NO_PKG_FMT', (name, version)) raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_WRONG_CONFIG) self.download(force, package_data)
def run(self, argv): packages = PackageHelper.get_installed_packages() keys = packages.keys() if len(keys) == 0: print "[PACKAGE] not found installed packages" return print "[PACKAGE] installed packages:" keys.sort() for k in keys: package_data = PackageHelper.get_installed_package_data( packages[k]["name"]) print "[PACKAGE] > %s %s (%s)" % (package_data["name"], package_data["version"], package_data["author"]) print ""
def run(self, argv): args = self.parse_args(argv) keyword = args.keyword packages = PackageHelper.search_keyword(keyword) if packages is None: print "[PACKAGE] not found packages for keyword '%s'" % keyword return keys = packages.keys() print "[PACKAGE] list all packages for keyword '%s'" % keyword keys.sort() for k in keys: package_data = packages[k] print "[PACKAGE] > %s %s (%s)" % (package_data["name"], package_data["version"], package_data["author"]) print ""
def run(self, argv): args = self.parse_args(argv) keyword = args.keyword packages = PackageHelper.search_keyword(keyword) if packages is None: print MultiLanguage.get_string('PACKAGE_SEARCH_ERROR_NO_KEY_FMT', keyword) return keys = packages.keys() print MultiLanguage.get_string('PACKAGE_SEARCH_TIP_FMT', keyword) keys.sort() for k in keys: package_data = packages[k] print MultiLanguage.get_string('PACKAGE_ITEM_FMT', (package_data["name"], package_data["version"], package_data["author"])) print ""
def run(self, argv): args = self.parse_args(argv) keyword = args.keyword packages = PackageHelper.search_keyword(keyword) if packages is None: print cocos.MultiLanguage.get_string('PACKAGE_SEARCH_ERROR_NO_KEY_FMT') % keyword return keys = packages.keys() print cocos.MultiLanguage.get_string('PACKAGE_SEARCH_TIP_FMT') % keyword keys.sort() for k in keys: package_data = packages[k] print cocos.MultiLanguage.get_string('PACKAGE_ITEM_FMT')\ % (package_data["name"], package_data["version"], package_data["author"]) print ""
def run(self, argv): args = self.parse_args(argv) name = args.name package_data = PackageHelper.query_package_data(name) if package_data is None: print "[PACKAGE] not found package '%s'" % name return print "[PACKAGE] > get description for package '%s' ... ok" % name print "" print "name: %s" % package_data["name"] print "version: %s" % package_data["version"] print "updated: %s" % time.strftime("%Y-%m-%d %H:%I:%S", time.gmtime(int(package_data["filetime"]))) print "author: %s" % package_data["author"] print "download size: %d KB" % (int(package_data["filesize"]) / 1024) print "" print package_data["description"] print ""
def run(self, argv): args = self.parse_args(argv) name = args.name version = args.version package_data = PackageHelper.query_package_data(name, version) if package_data is None: print MultiLanguage.get_string('PACKAGE_INFO_ERROR_NO_PKG_FMT', (name, version)) return if isinstance(package_data, list): for data in package_data: self.show_info(name, data) return if package_data.has_key('err'): print MultiLanguage.get_string('PACKAGE_INFO_ERROR_NO_PKG_FMT', (name, version)) return self.show_info(name, package_data)
def run(self, argv): args = self.parse_args(argv) name = args.name package_data = PackageHelper.query_package_data(name) if package_data is None: print "[PACKAGE] not found package '%s'" % name return print "[PACKAGE] > get description for package '%s' ... ok" % name print "" print "name: %s" % package_data["name"] print "version: %s" % package_data["version"] print "updated: %s" % time.strftime( "%Y-%m-%d %H:%I:%S", time.gmtime(int(package_data["filetime"]))) print "author: %s" % package_data["author"] print "download size: %d KB" % (int(package_data["filesize"]) / 1024) print "" print package_data["description"] print ""
def run(self, argv): args = self.parse_args(argv) name = args.name version = args.version force = args.force package_data = PackageHelper.query_package_data(name, version) if package_data is None: message = MultiLanguage.get_string('PACKAGE_INSTALL_ERROR_NO_PKG_FMT', (name, version)) raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_OTHERS) if isinstance(package_data, list): for data in package_data: self.download(force, data) return if package_data.has_key('err'): message = MultiLanguage.get_string('PACKAGE_INSTALL_ERROR_NO_PKG_FMT', (name, version)) raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_WRONG_CONFIG) self.download(force, package_data)
def download(self, force, package_data): PackageHelper.download_package_zip(package_data, force) PackageHelper.add_package(package_data) print ""