From 61f9644426bc1c3bde68f026a98fa5ed0548cf00 Mon Sep 17 00:00:00 2001 From: wuzewu Date: Thu, 11 Apr 2019 10:15:24 +0800 Subject: [PATCH] All classes inherit from object --- paddlehub/commands/base_command.py | 2 +- paddlehub/commands/cml_utils.py | 2 +- paddlehub/common/downloader.py | 2 +- paddlehub/common/hub_server.py | 2 +- paddlehub/dataset/base_cv_dataset.py | 2 +- paddlehub/io/parser.py | 6 +++--- paddlehub/module/base_processor.py | 2 +- paddlehub/module/checker.py | 2 +- paddlehub/module/manager.py | 2 +- paddlehub/module/signature.py | 2 +- paddlehub/reader/cv_reader.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/paddlehub/commands/base_command.py b/paddlehub/commands/base_command.py index 8563d8c1..1d085259 100644 --- a/paddlehub/commands/base_command.py +++ b/paddlehub/commands/base_command.py @@ -23,7 +23,7 @@ from paddlehub.common.arg_helper import add_argument, print_arguments ENTRY = "hub" -class BaseCommand: +class BaseCommand(object): command_dict = {} @classmethod diff --git a/paddlehub/commands/cml_utils.py b/paddlehub/commands/cml_utils.py index 5b2fb908..74dcc382 100644 --- a/paddlehub/commands/cml_utils.py +++ b/paddlehub/commands/cml_utils.py @@ -61,7 +61,7 @@ def get_ph_value(): return 11 -class TablePrinter: +class TablePrinter(object): def __init__(self, titles, placeholders, diff --git a/paddlehub/common/downloader.py b/paddlehub/common/downloader.py index 3194944f..b82cb619 100644 --- a/paddlehub/common/downloader.py +++ b/paddlehub/common/downloader.py @@ -45,7 +45,7 @@ def progress(str, end=False): sys.stdout.flush() -class Downloader: +class Downloader(object): def download_file(self, url, save_path, diff --git a/paddlehub/common/hub_server.py b/paddlehub/common/hub_server.py index 6f48c978..b52cf55e 100644 --- a/paddlehub/common/hub_server.py +++ b/paddlehub/common/hub_server.py @@ -29,7 +29,7 @@ RESOURCE_LIST_FILE = "resource_list_file.yml" CACHE_TIME = 60 * 10 -class HubServer: +class HubServer(object): def __init__(self, server_url=None): if not server_url: server_url = "https://paddlehub.bj.bcebos.com/" diff --git a/paddlehub/dataset/base_cv_dataset.py b/paddlehub/dataset/base_cv_dataset.py index 07b050c7..053dda3b 100644 --- a/paddlehub/dataset/base_cv_dataset.py +++ b/paddlehub/dataset/base_cv_dataset.py @@ -22,7 +22,7 @@ import paddlehub as hub from paddlehub.common.downloader import default_downloader -class ImageClassificationDataset: +class ImageClassificationDataset(object): def __init__(self): self.base_path = None self.train_list_file = None diff --git a/paddlehub/io/parser.py b/paddlehub/io/parser.py index 8cebcec7..d332d7f1 100644 --- a/paddlehub/io/parser.py +++ b/paddlehub/io/parser.py @@ -19,7 +19,7 @@ from __future__ import print_function import yaml -class CSVFileParser: +class CSVFileParser(object): def __init__(self): pass @@ -46,7 +46,7 @@ class CSVFileParser: return self.content -class YAMLFileParser: +class YAMLFileParser(object): def __init__(self): pass @@ -59,7 +59,7 @@ class YAMLFileParser: return yaml.load(content, Loader=yaml.BaseLoader) -class TextFileParser: +class TextFileParser(object): def __init__(self): pass diff --git a/paddlehub/module/base_processor.py b/paddlehub/module/base_processor.py index 90e21c3b..72da4a8c 100644 --- a/paddlehub/module/base_processor.py +++ b/paddlehub/module/base_processor.py @@ -17,7 +17,7 @@ from __future__ import division from __future__ import print_function -class BaseProcessor: +class BaseProcessor(object): def __init__(self, module): pass diff --git a/paddlehub/module/checker.py b/paddlehub/module/checker.py index 3e4ca6a1..bab8ff6f 100644 --- a/paddlehub/module/checker.py +++ b/paddlehub/module/checker.py @@ -29,7 +29,7 @@ CHECK_INFO_PB_FILENAME = "check_info.pb" FILE_SEP = "/" -class ModuleChecker: +class ModuleChecker(object): def __init__(self, module_path): self.module_path = module_path diff --git a/paddlehub/module/manager.py b/paddlehub/module/manager.py index c013c2ad..06db32a1 100644 --- a/paddlehub/module/manager.py +++ b/paddlehub/module/manager.py @@ -25,7 +25,7 @@ from paddlehub.common.dir import MODULE_HOME import paddlehub as hub -class LocalModuleManager: +class LocalModuleManager(object): def __init__(self, module_home=None): self.local_modules_dir = module_home if module_home else MODULE_HOME self.modules_dict = {} diff --git a/paddlehub/module/signature.py b/paddlehub/module/signature.py index cc452299..93150c0a 100644 --- a/paddlehub/module/signature.py +++ b/paddlehub/module/signature.py @@ -21,7 +21,7 @@ from paddle.fluid.framework import Variable from paddlehub.common.utils import to_list -class Signature: +class Signature(object): def __init__(self, name, inputs, diff --git a/paddlehub/reader/cv_reader.py b/paddlehub/reader/cv_reader.py index 0b8e37db..aeeec007 100644 --- a/paddlehub/reader/cv_reader.py +++ b/paddlehub/reader/cv_reader.py @@ -32,7 +32,7 @@ color_mode_dict = { } -class ImageClassificationReader: +class ImageClassificationReader(object): def __init__(self, image_width, image_height, -- GitLab