From da933f58663648716136d52b0bdf207711deb361 Mon Sep 17 00:00:00 2001 From: Yuval Langer Date: Sat, 22 Sep 2012 16:29:58 +0300 Subject: [PATCH] More secure call to notify-send using subprocess.call() --- irssi-notify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/irssi-notify.py b/irssi-notify.py index cc0abf1..bef2d62 100755 --- a/irssi-notify.py +++ b/irssi-notify.py @@ -2,6 +2,7 @@ import os import time +import subprocess # the log file of the channel you want notifications for: logfile = "/home/oscar/irclogs/freenode/#channel.log" @@ -18,8 +19,8 @@ def reset(): curtime = os.stat(logfile).st_mtime def displaynotification(lastline): - execstring = "notify-send '" + lastline + "'" - os.system(execstring) + execlist = ['notify-send', lastline] + subprocess.call(execlist) def readlastline(): f = open(logfile, 'rU')