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 print join (dirname(__file__), pardir)
29 from time_slider import smf, autosnapsmf, util
32 PLUGINBASEFMRI = "svc:/application/time-slider/plugin"
33 PLUGINPROPGROUP = "plugin"
35 class PluginSMF(smf.SMFInstance):
37 def __init__(self, instanceName):
38 smf.SMFInstance.__init__(self, instanceName)
39 self.triggerCommand = None
42 def get_trigger_command(self):
43 # FIXME Use mutex locking for MT safety
44 if self.triggerCommand == None:
45 value = self.get_prop(PLUGINPROPGROUP, "trigger_command")
46 self.triggerCommand = value.strip()
47 return self.triggerCommand
49 def get_trigger_list(self):
50 #FIXME Use mutex locking to make MT-safe
51 if self.triggers == None:
53 value = self.get_prop(PLUGINPROPGROUP, "trigger_on")
55 # Strip out '\' characters inserted by svcprop
56 triggerList = value.strip().replace('\\', '').split(',')
57 for trigger in triggerList:
58 self.triggers.append(trigger.strip())
61 def get_verbose(self):
62 value = self.get_prop(PLUGINPROPGROUP, "verbose")