5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
26 from os.path import abspath, dirname, join, pardir
27 sys.path.insert(0, join(dirname(__file__), pardir))
28 from time_slider import smf, autosnapsmf, util
31 PLUGINBASEFMRI = "svc:/application/time-slider/plugin"
32 PLUGINPROPGROUP = "plugin"
34 class PluginSMF(smf.SMFInstance):
36 def __init__(self, instanceName):
37 smf.SMFInstance.__init__(self, instanceName)
38 self.triggerCommand = None
41 def get_trigger_command(self):
42 # FIXME Use mutex locking for MT safety
43 if self.triggerCommand == None:
44 value = self.get_prop(PLUGINPROPGROUP, "trigger_command")
45 self.triggerCommand = value.strip()
46 return self.triggerCommand
48 def get_trigger_list(self):
49 #FIXME Use mutex locking to make MT-safe
50 if self.triggers == None:
52 value = self.get_prop(PLUGINPROPGROUP, "trigger_on")
54 # Strip out '\' characters inserted by svcprop
55 triggerList = value.strip().replace('\\', '').split(',')
56 for trigger in triggerList:
57 self.triggers.append(trigger.strip())
60 def get_verbose(self):
61 value = self.get_prop(PLUGINPROPGROUP, "verbose")