Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
kpetersn
aliveNotifier
Commits
03441d6d
Commit
03441d6d
authored
May 14, 2014
by
kpetersn
Browse files
Added url to OS X notification
parent
78343205
Changes
1
Hide whitespace changes
Inline
Side-by-side
an.py
View file @
03441d6d
...
...
@@ -13,6 +13,7 @@ import xml.etree.ElementTree as ET
# needed for notifyOSX()
import
os
osx_command
=
"/Users/kpetersn/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier"
osx_url
=
"http://bcda.xray.aps.anl.gov/cgi-bin/ioc_alive.cgi?eng=Peterson"
### Stuff to customize
engineer
=
"Peterson"
...
...
@@ -23,7 +24,7 @@ def notifyConsole(ioc, state, time_str):
print
"[%s] %s is %s"
%
(
time_str
,
ioc
,
state
)
def
notifyOSX
(
ioc
,
state
,
time_str
):
notify_command
=
"%s -title
\"
%s is %s
\"
-message
\"
%s
\"
"
%
(
osx_command
,
ioc
,
state
,
time_str
)
notify_command
=
"%s -title
\"
%s is %s
\"
-message
\"
%s
\"
-open
\"
%s
\"
"
%
(
osx_command
,
ioc
,
state
,
time_str
,
osx_url
)
os
.
system
(
notify_command
)
# set notification function
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment