File bsc1207084_MouseButton.patch of Package pitivi

From: Alessandro Soraruf <asoraruf@ntd.homelinux.org>
Date: Fri, 20 Oct 2023 19:44:01 +0200
Subject: [PATCH] bsc-1207084: Pitivi cannot be started due to "ImportError:
  cannot import name 'MouseButton'" fix

Removes "MouseButton" import from matplotlib and implement the enum locally.

--- pitivi-2022.06/pitivi/timeline/elements.py	2022-06-25 01:30:31.000000000 +0200
+++ pitivi-2022.06/pitivi/timeline/elements.py	2023-10-20 19:44:01.201287637 +0200
@@ -20,6 +20,7 @@
 from typing import Optional
 
 import numpy
+from enum import Enum, IntEnum
 from gi.repository import Gdk
 from gi.repository import GdkPixbuf
 from gi.repository import GES
@@ -28,7 +29,6 @@
 from gi.repository import GstController
 from gi.repository import Gtk
 from matplotlib.axes import Axes
-from matplotlib.backend_bases import MouseButton
 from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo
 from matplotlib.collections import PathCollection
 from matplotlib.figure import Figure
@@ -66,6 +66,12 @@
 SELECTED_KEYFRAME_NODE_COLOR = "#204A87"  # "Tango" dark sky blue
 HOVERED_KEYFRAME_NODE_COLOR = "#3465A4"  # "Tango" medium sky blue
 
+class MouseButton(IntEnum):
+    LEFT = 1
+    MIDDLE = 2
+    RIGHT = 3
+    BACK = 8
+    FORWARD = 9
 
 def get_pspec(element_factory_name, propname):
     element = Gst.ElementFactory.make(element_factory_name)
openSUSE Build Service is sponsored by