Use new attrs syntax
authorKarl O. Pinc <kop@karlpinc.com>
Fri, 22 Mar 2024 17:11:32 +0000 (12:11 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Fri, 22 Mar 2024 17:11:32 +0000 (12:11 -0500)
src/pgwui_upload_core/views/upload.py

index 37a994afcb42bd6f48ed924f8ea775b0afb5f3c3..5d7e1c3ca122d6b7c7713362c57f466efd3e0e87 100644 (file)
@@ -24,7 +24,7 @@
 #  All data is presented to the db as a string, which could result
 # in problems with type coercion.
 
-import attr
+import attrs
 import logging
 import markupsafe
 import psycopg.errors
@@ -49,12 +49,12 @@ from pgwui_upload_core import exceptions as upload_ex
 log = logging.getLogger(__name__)
 
 
-@attr.s
+@attrs.define
 class UploadCoreInitialPost(UploadNullFileInitialPost):
     '''Get values from settings for when there's not user-supplied
     values in POST
     '''
-    component = attr.ib(default='pgwui_upload')
+    component = attrs.field(default='pgwui_upload')
 
     def set_component(self, component):
         self.component = component
@@ -103,7 +103,7 @@ class SaveLine(DataLineProcessor, ParameterExecutor):
         self.param_execute(self.insert_stmt, udl)
 
 
-@attr.s
+@attrs.define
 class BaseTableUploadHandler(TabularFileUploadHandler):
     '''
     Attributes:
@@ -113,8 +113,8 @@ class BaseTableUploadHandler(TabularFileUploadHandler):
       ue            Not available until self.factory(ue) is called
       cur           Not available until self.factory(ue) is called
     '''
-    ue = attr.ib(default=None)
-    cur = attr.ib(default=None)
+    ue = attrs.field(default=None)
+    cur = attrs.field(default=None)
 
     def get_data(self):
         '''