2
# Copyright (C) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26
class NotifyPlugin( pluginmanager.Plugin ):
31
self.user = os.getlogin()
35
if len(self.user) <= 0:
37
user = os.environ['USER']
41
if len(self.user) <= 0:
43
user = os.environ['LOGNAME']
47
def init( self, snapshots ):
53
def on_process_begins( self ):
56
def on_process_ends( self ):
59
def on_error( self, code, message ):
62
def on_new_snapshot( self, snapshot_id, snapshot_path ):
65
def on_message( self, profile_id, profile_name, level, message, timeout ):
69
cmd = cmd + " -t %s" % (1000 * timeout)
71
title = "Back In Time (%s) : %s" % (self.user, profile_name)
72
message = message.replace("\n", ' ')
73
message = message.replace("\r", '')
75
cmd = cmd + " \"%s\" \"%s\"" % (title, message)