[libcamera-devel,v2,17/19] py: Rename 'efd' to 'event_fd'
diff mbox series

Message ID 20220524114610.41848-18-tomi.valkeinen@ideasonboard.com
State Accepted
Headers show
Series
  • More misc Python patches
Related show

Commit Message

Tomi Valkeinen May 24, 2022, 11:46 a.m. UTC
From: Tomi Valkeinen <tomi.valkeinen@iki.fi>

Perhaps it's better to have a more descriptive name here. I also
considered just renaming 'efd' to 'fd', but 'event_fd' won.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 src/py/cam/cam_kms.py                        | 2 +-
 src/py/cam/cam_null.py                       | 2 +-
 src/py/cam/cam_qt.py                         | 2 +-
 src/py/cam/cam_qtgl.py                       | 2 +-
 src/py/examples/itest.py                     | 2 +-
 src/py/examples/simple-continuous-capture.py | 2 +-
 src/py/libcamera/py_main.cpp                 | 2 +-
 test/py/unittests.py                         | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

Comments

Laurent Pinchart May 27, 2022, 10:53 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Tue, May 24, 2022 at 02:46:08PM +0300, Tomi Valkeinen wrote:
> From: Tomi Valkeinen <tomi.valkeinen@iki.fi>
> 
> Perhaps it's better to have a more descriptive name here. I also
> considered just renaming 'efd' to 'fd', but 'event_fd' won.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/py/cam/cam_kms.py                        | 2 +-
>  src/py/cam/cam_null.py                       | 2 +-
>  src/py/cam/cam_qt.py                         | 2 +-
>  src/py/cam/cam_qtgl.py                       | 2 +-
>  src/py/examples/itest.py                     | 2 +-
>  src/py/examples/simple-continuous-capture.py | 2 +-
>  src/py/libcamera/py_main.cpp                 | 2 +-
>  test/py/unittests.py                         | 2 +-
>  8 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py
> index 213e0b03..49b00211 100644
> --- a/src/py/cam/cam_kms.py
> +++ b/src/py/cam/cam_kms.py
> @@ -161,7 +161,7 @@ class KMSRenderer:
>  
>          sel = selectors.DefaultSelector()
>          sel.register(self.card.fd, selectors.EVENT_READ, self.readdrm)
> -        sel.register(self.cm.efd, selectors.EVENT_READ, self.readcam)
> +        sel.register(self.cm.event_fd, selectors.EVENT_READ, self.readcam)
>          sel.register(sys.stdin, selectors.EVENT_READ, self.readkey)
>  
>          print('Press enter to exit')
> diff --git a/src/py/cam/cam_null.py b/src/py/cam/cam_null.py
> index 45c5f467..40dbd266 100644
> --- a/src/py/cam/cam_null.py
> +++ b/src/py/cam/cam_null.py
> @@ -23,7 +23,7 @@ class NullRenderer:
>          self.running = True
>  
>          sel = selectors.DefaultSelector()
> -        sel.register(self.cm.efd, selectors.EVENT_READ, self.readcam)
> +        sel.register(self.cm.event_fd, selectors.EVENT_READ, self.readcam)
>          sel.register(sys.stdin, selectors.EVENT_READ, self.readkey)
>  
>          print('Press enter to exit')
> diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py
> index 739e9749..d8d6a98f 100644
> --- a/src/py/cam/cam_qt.py
> +++ b/src/py/cam/cam_qt.py
> @@ -193,7 +193,7 @@ class QtRenderer:
>          self.windows = windows
>  
>      def run(self):
> -        camnotif = QtCore.QSocketNotifier(self.cm.efd, QtCore.QSocketNotifier.Read)
> +        camnotif = QtCore.QSocketNotifier(self.cm.event_fd, QtCore.QSocketNotifier.Read)
>          camnotif.activated.connect(lambda _: self.readcam())
>  
>          keynotif = QtCore.QSocketNotifier(sys.stdin.fileno(), QtCore.QSocketNotifier.Read)
> diff --git a/src/py/cam/cam_qtgl.py b/src/py/cam/cam_qtgl.py
> index 5f7ccf1e..4b43f51d 100644
> --- a/src/py/cam/cam_qtgl.py
> +++ b/src/py/cam/cam_qtgl.py
> @@ -142,7 +142,7 @@ class QtRenderer:
>          self.window = window
>  
>      def run(self):
> -        camnotif = QtCore.QSocketNotifier(self.state.cm.efd, QtCore.QSocketNotifier.Read)
> +        camnotif = QtCore.QSocketNotifier(self.state.cm.event_fd, QtCore.QSocketNotifier.Read)
>          camnotif.activated.connect(lambda _: self.readcam())
>  
>          keynotif = QtCore.QSocketNotifier(sys.stdin.fileno(), QtCore.QSocketNotifier.Read)
> diff --git a/src/py/examples/itest.py b/src/py/examples/itest.py
> index 01e020e2..2d1c6453 100755
> --- a/src/py/examples/itest.py
> +++ b/src/py/examples/itest.py
> @@ -66,7 +66,7 @@ def capture(ctx):
>      # Use Selector to wait for events from the camera and from the keyboard
>  
>      sel = selectors.DefaultSelector()
> -    sel.register(cm.efd, selectors.EVENT_READ, lambda fd: handle_camera_event(ctx))
> +    sel.register(cm.event_fd, selectors.EVENT_READ, lambda fd: handle_camera_event(ctx))
>  
>      reqs = []
>  
> diff --git a/src/py/examples/simple-continuous-capture.py b/src/py/examples/simple-continuous-capture.py
> index 05fa2ada..12708914 100755
> --- a/src/py/examples/simple-continuous-capture.py
> +++ b/src/py/examples/simple-continuous-capture.py
> @@ -76,7 +76,7 @@ def capture(cm, cam, reqs):
>      # Use Selector to wait for events from the camera and from the keyboard
>  
>      sel = selectors.DefaultSelector()
> -    sel.register(cm.efd, selectors.EVENT_READ, lambda fd: handle_camera_event(cm, cam))
> +    sel.register(cm.event_fd, selectors.EVENT_READ, lambda fd: handle_camera_event(cm, cam))
>      sel.register(sys.stdin, selectors.EVENT_READ, handle_key_envet)
>  
>      reqs = []
> diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
> index 80f26c12..3fd5c0fc 100644
> --- a/src/py/libcamera/py_main.cpp
> +++ b/src/py/libcamera/py_main.cpp
> @@ -209,7 +209,7 @@ PYBIND11_MODULE(_libcamera, m)
>  
>  		.def_property_readonly("version", &CameraManager::version)
>  
> -		.def_property_readonly("efd", [](CameraManager &) {
> +		.def_property_readonly("event_fd", [](CameraManager &) {
>  			return gEventfd;
>  		})
>  
> diff --git a/test/py/unittests.py b/test/py/unittests.py
> index 8c445bc9..426efb06 100755
> --- a/test/py/unittests.py
> +++ b/test/py/unittests.py
> @@ -269,7 +269,7 @@ class SimpleCaptureMethods(CameraTesterBase):
>          gc.collect()
>  
>          sel = selectors.DefaultSelector()
> -        sel.register(cm.efd, selectors.EVENT_READ)
> +        sel.register(cm.event_fd, selectors.EVENT_READ)
>  
>          reqs = []
>

Patch
diff mbox series

diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py
index 213e0b03..49b00211 100644
--- a/src/py/cam/cam_kms.py
+++ b/src/py/cam/cam_kms.py
@@ -161,7 +161,7 @@  class KMSRenderer:
 
         sel = selectors.DefaultSelector()
         sel.register(self.card.fd, selectors.EVENT_READ, self.readdrm)
-        sel.register(self.cm.efd, selectors.EVENT_READ, self.readcam)
+        sel.register(self.cm.event_fd, selectors.EVENT_READ, self.readcam)
         sel.register(sys.stdin, selectors.EVENT_READ, self.readkey)
 
         print('Press enter to exit')
diff --git a/src/py/cam/cam_null.py b/src/py/cam/cam_null.py
index 45c5f467..40dbd266 100644
--- a/src/py/cam/cam_null.py
+++ b/src/py/cam/cam_null.py
@@ -23,7 +23,7 @@  class NullRenderer:
         self.running = True
 
         sel = selectors.DefaultSelector()
-        sel.register(self.cm.efd, selectors.EVENT_READ, self.readcam)
+        sel.register(self.cm.event_fd, selectors.EVENT_READ, self.readcam)
         sel.register(sys.stdin, selectors.EVENT_READ, self.readkey)
 
         print('Press enter to exit')
diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py
index 739e9749..d8d6a98f 100644
--- a/src/py/cam/cam_qt.py
+++ b/src/py/cam/cam_qt.py
@@ -193,7 +193,7 @@  class QtRenderer:
         self.windows = windows
 
     def run(self):
-        camnotif = QtCore.QSocketNotifier(self.cm.efd, QtCore.QSocketNotifier.Read)
+        camnotif = QtCore.QSocketNotifier(self.cm.event_fd, QtCore.QSocketNotifier.Read)
         camnotif.activated.connect(lambda _: self.readcam())
 
         keynotif = QtCore.QSocketNotifier(sys.stdin.fileno(), QtCore.QSocketNotifier.Read)
diff --git a/src/py/cam/cam_qtgl.py b/src/py/cam/cam_qtgl.py
index 5f7ccf1e..4b43f51d 100644
--- a/src/py/cam/cam_qtgl.py
+++ b/src/py/cam/cam_qtgl.py
@@ -142,7 +142,7 @@  class QtRenderer:
         self.window = window
 
     def run(self):
-        camnotif = QtCore.QSocketNotifier(self.state.cm.efd, QtCore.QSocketNotifier.Read)
+        camnotif = QtCore.QSocketNotifier(self.state.cm.event_fd, QtCore.QSocketNotifier.Read)
         camnotif.activated.connect(lambda _: self.readcam())
 
         keynotif = QtCore.QSocketNotifier(sys.stdin.fileno(), QtCore.QSocketNotifier.Read)
diff --git a/src/py/examples/itest.py b/src/py/examples/itest.py
index 01e020e2..2d1c6453 100755
--- a/src/py/examples/itest.py
+++ b/src/py/examples/itest.py
@@ -66,7 +66,7 @@  def capture(ctx):
     # Use Selector to wait for events from the camera and from the keyboard
 
     sel = selectors.DefaultSelector()
-    sel.register(cm.efd, selectors.EVENT_READ, lambda fd: handle_camera_event(ctx))
+    sel.register(cm.event_fd, selectors.EVENT_READ, lambda fd: handle_camera_event(ctx))
 
     reqs = []
 
diff --git a/src/py/examples/simple-continuous-capture.py b/src/py/examples/simple-continuous-capture.py
index 05fa2ada..12708914 100755
--- a/src/py/examples/simple-continuous-capture.py
+++ b/src/py/examples/simple-continuous-capture.py
@@ -76,7 +76,7 @@  def capture(cm, cam, reqs):
     # Use Selector to wait for events from the camera and from the keyboard
 
     sel = selectors.DefaultSelector()
-    sel.register(cm.efd, selectors.EVENT_READ, lambda fd: handle_camera_event(cm, cam))
+    sel.register(cm.event_fd, selectors.EVENT_READ, lambda fd: handle_camera_event(cm, cam))
     sel.register(sys.stdin, selectors.EVENT_READ, handle_key_envet)
 
     reqs = []
diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
index 80f26c12..3fd5c0fc 100644
--- a/src/py/libcamera/py_main.cpp
+++ b/src/py/libcamera/py_main.cpp
@@ -209,7 +209,7 @@  PYBIND11_MODULE(_libcamera, m)
 
 		.def_property_readonly("version", &CameraManager::version)
 
-		.def_property_readonly("efd", [](CameraManager &) {
+		.def_property_readonly("event_fd", [](CameraManager &) {
 			return gEventfd;
 		})
 
diff --git a/test/py/unittests.py b/test/py/unittests.py
index 8c445bc9..426efb06 100755
--- a/test/py/unittests.py
+++ b/test/py/unittests.py
@@ -269,7 +269,7 @@  class SimpleCaptureMethods(CameraTesterBase):
         gc.collect()
 
         sel = selectors.DefaultSelector()
-        sel.register(cm.efd, selectors.EVENT_READ)
+        sel.register(cm.event_fd, selectors.EVENT_READ)
 
         reqs = []