From 0a3dddef2f793c8ca1efdfc0d2b00a40956caf72 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 7 May 2024 16:03:07 +1000 Subject: [PATCH] More Python 2 to Python 3 upgrades --- src/ifcopenshell-python/ifcopenshell/entity_instance.py | 2 +- src/ifcopenshell-python/ifcopenshell/express/codegen.py | 2 +- src/ifcopenshell-python/ifcopenshell/file.py | 2 +- src/ifcopenshell-python/ifcopenshell/geom/app.py | 2 +- src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index 57a2ab528f..a0d44b1b23 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -100,7 +100,7 @@ for nm in ifcopenshell_wrapper.schema_names(): register_schema_attributes(schema) -class entity_instance(object): +class entity_instance: """Base class for all IFC objects. An instantiated entity_instance will have methods of Python and the IFC class itself. diff --git a/src/ifcopenshell-python/ifcopenshell/express/codegen.py b/src/ifcopenshell-python/ifcopenshell/express/codegen.py index efdd9c918d..fe997091b1 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/codegen.py +++ b/src/ifcopenshell-python/ifcopenshell/express/codegen.py @@ -29,7 +29,7 @@ def indent(n, s): return "\n".join(" "*n + l for l in splitted) -class Base(object): +class Base: """ A base class for all code generation classes. Currently only working around some python 2/3 incompatibilities in terms of unicode file handling. diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py index 0a9f854735..c1ba69c22c 100644 --- a/src/ifcopenshell-python/ifcopenshell/file.py +++ b/src/ifcopenshell-python/ifcopenshell/file.py @@ -176,7 +176,7 @@ class Transaction: file_dict = {} -class file(object): +class file: """Base class for containing IFC files. Class has instance methods for filtering by element Id, Type, etc. diff --git a/src/ifcopenshell-python/ifcopenshell/geom/app.py b/src/ifcopenshell-python/ifcopenshell/geom/app.py index 28747a6667..298b5b37ab 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/app.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/app.py @@ -122,7 +122,7 @@ class geometry_creation_thread(QtCore.QThread): self.signals.completed.emit((it, self.f, list(_()))) -class configuration(object): +class configuration: def __init__(self): try: import ConfigParser diff --git a/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py b/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py index 808eb90b25..f84f45a234 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py @@ -45,7 +45,7 @@ except BaseException: CodeEdit = QtWidgets.QPlainTextEdit -class StdoutRedirector(object): +class StdoutRedirector: """A class for redirecting stdout to this Text widget.""" def __init__(self, widget):