Skip to content

Commit

Permalink
Rename 'notify' to 'send_notify' to not clobber GTK method
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Dec 2, 2020
1 parent 73abacc commit 9ce263e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions qui/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def update_clipboard_contents(self, vm=None, size=0, message=None):
self.icon.set_from_icon_name("edit-copy")

if message:
self.notify(message)
self.send_notify(message)

def prepare_menu(self):
self.menu = Gtk.Menu()
Expand Down Expand Up @@ -227,18 +227,18 @@ def copy_dom0_clipboard(self, *_args, **_kwargs):
text = clipboard.wait_for_text()

if not text:
self.notify(_("dom0 clipboard is empty!"))
self.send_notify(_("dom0 clipboard is empty!"))
return

try:
fd = os.open(APPVIEWER_LOCK, os.O_RDWR | os.O_CREAT, 0o0666)
except Exception: # pylint: disable=broad-except
self.notify(_("Error while accessing Qubes clipboard!"))
self.send_notify(_("Error while accessing Qubes clipboard!"))
else:
try:
fcntl.flock(fd, fcntl.LOCK_EX)
except Exception: # pylint: disable=broad-except
self.notify(_("Error while locking Qubes clipboard!"))
self.send_notify(_("Error while locking Qubes clipboard!"))
os.close(fd)
else:
try:
Expand All @@ -249,12 +249,12 @@ def copy_dom0_clipboard(self, *_args, **_kwargs):
with open(XEVENT, "w") as timestamp:
timestamp.write(str(Gtk.get_current_event_time()))
except Exception as ex: # pylint: disable=broad-except
self.notify(_("Error while writing to "
self.send_notify(_("Error while writing to "
"Qubes clipboard!\n{0}").format(str(ex)))
fcntl.flock(fd, fcntl.LOCK_UN)
os.close(fd)

def notify(self, body):
def send_notify(self, body):
# pylint: disable=attribute-defined-outside-init
notification = Gio.Notification.new(_("Qubes Clipboard"))
notification.set_body(body)
Expand Down

0 comments on commit 9ce263e

Please sign in to comment.