Skip to content
Snippets Groups Projects
Commit ec9e0f32 authored by Alberto LIVIO BECCARIA's avatar Alberto LIVIO BECCARIA
Browse files

Nuova versione Python 3, parzialmente funzionante.

parent c00c0e2a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.1'
__version__ = '1.2'
import signal
import sys
......@@ -28,7 +28,7 @@ from gi.repository import GLib
--------------------------------------------------------------------------------
"""
APP_NAME = "Labsync Tray GTK"
APP_YEAR = "2019"
APP_YEAR = "2024"
APP_VERSION = __version__ + '-' + APP_YEAR
APP_DESCR = "Notifica lo stato di aggiornamento del software nella cartella /opt"
APP_AUTHORS = ["""Sezione di Informatica
......@@ -137,8 +137,7 @@ class TrayApp():
if APPINDICATOR_SUPPORT == 1 and FORCE_TRAY == False:
self.tray = AppIndicator3.Indicator.new(
appid, self.icon,
AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
appid, self.icon, AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
self.tray.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
self.tray.set_menu(self.menu)
else:
......@@ -176,14 +175,14 @@ class TrayApp():
def build_menu(self):
menu = Gtk.Menu()
item_status = Gtk.MenuItem(STR_STATUS)
item_status = Gtk.MenuItem(label=STR_STATUS)
item_status.connect("activate", self.handler_menu_status)
menu.append(item_status)
about = Gtk.MenuItem(STR_ABOUT)
about = Gtk.MenuItem(label=STR_ABOUT)
about.connect("activate", self.handler_menu_about)
menu.append(about)
menu.append(Gtk.SeparatorMenuItem())
item_quit = Gtk.MenuItem(STR_EXIT)
item_quit = Gtk.MenuItem(label=STR_EXIT)
item_quit.connect("activate", self.handler_menu_quit)
menu.append(item_quit)
return menu
......@@ -237,9 +236,9 @@ class TrayApp():
def update_icon(self):
if APPINDICATOR_SUPPORT == 1 and FORCE_TRAY == False:
self.tray.set_icon(self.icon)
self.tray.set_icon_full(self.icon, "-")
else:
self.tray.set_from_file(self.icon)
self.tray.set_from_file(self.icon, "-")
def update_task(self):
exists = os.path.isfile(FILE_TO_CHECK)
......@@ -383,5 +382,5 @@ if __name__ == "__main__":
Notify.init(APP_ID)
app = TrayApp(APP_ID, icon=APP_ICONS[APP_OFF], check_interval=args.interval)
print 'Check interval: ' + str(app.check_interval) + CHECK_INTERVAL_UNIT
print("Check interval: " + str(app.check_interval) + CHECK_INTERVAL_UNIT)
app.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment