From 4c8267ee99a1c5f437d7907618f3b38bcc0c37d6 Mon Sep 17 00:00:00 2001 From: Dale Wahl <32108944+dale-wahl@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:44:25 +0100 Subject: [PATCH] Update AppStoreUtils get_entries method --- itunes_app_scraper/util.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/itunes_app_scraper/util.py b/itunes_app_scraper/util.py index c0fed9a..18147e8 100644 --- a/itunes_app_scraper/util.py +++ b/itunes_app_scraper/util.py @@ -5,21 +5,21 @@ class AppStoreUtils: """ - Helper class to access the names of the other classes + Helper class to access the names of the other classes """ - - def get_entries(self, clazz_name): + @staticmethod + def get_entries(clazz_name): """ - Get the members and their names from the function + Get the members and their names from the function - :param object clazz_name: the class object be called. - :returns object method_names: a JSON representation of the names. + :param object clazz_name: the class object be called. + :returns object method_names: a JSON representation of the names. """ - method_names = {} + methods = {} for collection in dir(clazz_name): if not collection.startswith('__'): - method_names[str(collection.replace('_', ' '))] = getattr(clazz_name, str(collection)) - return json.dumps({'names': method_names}) + methods[str(collection)] = getattr(clazz_name, str(collection)) + return methods class AppStoreCollections: """ @@ -290,4 +290,4 @@ class AppStoreException(Exception): 'tr', # Turkey 'ua', # Ukraine 'us', # United States of America -] \ No newline at end of file +]