Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
labsync-tray
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto LIVIO BECCARIA
labsync-tray
Commits
ec9e0f32
Commit
ec9e0f32
authored
7 months ago
by
Alberto LIVIO BECCARIA
Browse files
Options
Downloads
Patches
Plain Diff
Nuova versione Python 3, parzialmente funzionante.
parent
c00c0e2a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/labsync-tray.py
+10
-11
10 additions, 11 deletions
src/labsync-tray.py
with
10 additions
and
11 deletions
src/labsync-tray.py
+
10
−
11
View file @
ec9e0f32
#!/usr/bin/python
2
#!/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
=
"
20
19
"
APP_YEAR
=
"
20
24
"
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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment