0c5febfa45d051daaf2e6d61349776fed730064e
[time-slider.git] / usr / share / time-slider / lib / time_slider / linux / timeslidersmf.py
1 #!/usr/bin/python2
2 #
3 # CDDL HEADER START
4 #
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.
8 #
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.
13 #
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]
19 #
20 # CDDL HEADER END
21 #
22
23 import time_slider.timeslidersmf as base
24 from . import smf
25 import threading
26
27 class TimeSliderSMF(base.TimeSliderSMF):
28
29     def __init__(self, instanceName = base.SMFNAME):
30         base.TimeSliderSMF.__init__(self, instanceName)
31
32 #
33 # This is beyond ugly.
34 #
35 # The problem this is trying to solve is to change the inheritance chain. Origially
36 # it looks like this:
37 #
38 # <class 'time_slider.linux.timeslidersmf.TimeSliderSMF'>
39 # <class 'time_slider.timeslidersmf.TimeSliderSMF'>
40 # <class 'time_slider.smf.SMFInstance'>
41 # <type 'exceptions.Exception'>
42 # <type 'exceptions.BaseException'>
43 # <type 'object'>
44 #
45 # We'd like it to look like this:
46 #
47 # <class 'time_slider.linux.timeslidersmf.TimeSliderSMF'>
48 # <class 'time_slider.timeslidersmf.TimeSliderSMF'>
49 # <class 'time_slider.linux.smf.SMFInstance'>
50 # <class 'time_slider.smf.SMFInstance'>
51 # <type 'exceptions.Exception'>
52 # <type 'exceptions.BaseException'>
53 # <type 'object'>
54 #
55 # so we can inject some linux specific things into SMF without having to copy all
56 # the code.
57 #
58 # This has to be done here as the __init__ of TimeSliderSMF will otherwise fail.
59 #
60
61 base.TimeSliderSMF.__bases__ = (smf.SMFInstance,)
62
63 if __name__ == "__main__":
64   S = TimeSliderSMF('svc:/application/time-slider')
65   print(S)