Ejemplo n.º 1
0
 def __init__(self, token, configFile):
     PlugIn.__init__(self)
     self.architecture = "all"
     self.override_dict ={}
     self.jid = Config.get("jabber","jid")
     global backend
     backend = Config.get("Defaults","backend")
     global scenario
     scenario = "default"
     #plugin itself
     self.content = Container("plugin", token, "This is a Defaults Plugin")
     self.content.addContainer("cmd","getBackend","getBackend", self.getBackend)
     for pair in Config.getSection("Defaults"):
         if pair[0].endswith('_plain'):
             title= pair[0].replace('_plain','')
             container = Container("cmd",title,pair[1],self.general)
             container.rendering = Container.PLAIN
         else:
             container = Container("cmd",pair[0],pair[1],self.general)
             container.setUseArgs(backend)
         self.content.addChild(container)
         
         #self.content.addContainer("cmd", pair[0], pair[1], use=self.general, args="test")
         
     self.content.addContainer("cmd","set","set",self.override)
     self.content.addContainer("cmd","setScenario","set a Scenario", self.setScenario)
     self.content.addContainer("cmd","getScenario", "get current Scenario", self.getScenario)
Ejemplo n.º 2
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"

        #plugin itself
        self.content = Container("plugin", token, "This is a Finder Plugins")

        # set add container

        self.content.addContainer("cmd","OpenUrl", "open url", self.openUrl)

        self.content.addContainer("cmd", "Unmute", "unmute system", self.unmute)

        self.content.addContainer("cmd", "Mute", "mute system", self.mute)

        self.content.addContainer("cmd", "SetVol", "set Volume", self.setVol)

        self.content.addContainer("cmd", "Restart", "restart system", self.restart)

        self.content.addContainer("cmd", "Sleep", "sleep system", self.sleep)

        self.content.addContainer("cmd", "Shutdown", "shutdown system", self.shutdown)

        self.content.addContainer("cmd", "Say", "say something", self.say)

        self.content.addContainer("cmd", "Beep", "Beep", self.beep)
Ejemplo n.º 3
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = Container("plugin", token, "This is a Status Plugin", self.getParts)
        self.content.rendering = Container.PLAIN
       	self.content.visible = False
Ejemplo n.º 4
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = avrContainer("plugin", token, "This hopefully will be a Threaded SoftKey  Plugin")
        self.content.name = "softKeyThread"
        self.content.start()
Ejemplo n.º 5
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"

        #plugin itself
        self.content = Container("plugin", token, "this is a growl plugin")
        
        # set add container
        self.content.addContainer("cmd","Growl", "send growl notification", self.growl)
Ejemplo n.º 6
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = Container("plugin", token, "This is a Finder Plugins")

        # set add container

        self.content.addContainer("cmd","SetVol", "set system volume via amixer", self.setVol)
        self.content.addContainer("cmd","Kernel", "get Kernel Infos", self.kernelInfo)
Ejemplo n.º 7
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"

        #plugin itself
        self.content = Container("plugin", token, "This is a Mpg123 Plugin")

        # set add container
        self.content.addChild(Container("cmd", "Play", "Play Mpg123", self.play)) #addContainer("cmd", "Play", "Play Mpg123", self.play)

	self.content.addContainer("cmd", "Stop", "Stop Mpg123", self.stop)
Ejemplo n.º 8
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"


        #plugin itself
        self.content = WebCamContainer("plugin", token, "This is a Webcam Plugin")
        self.content.logging = True

        # set add container
        self.content.addContainer("cmd", "TakePicture", "TakePicture", self.takePic)
Ejemplo n.º 9
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        # set plugins "hardware" architecture for system dependencies
        self.content = "all"

        # create plugin itself
        self.content = ThreadContainer("plugin", token, "This hopefully will be a Scheduler  Plugin")
        self.content.visible = False
        self.content.setDo(self.sched)
		
        # start thread
        self.content.start()
Ejemplo n.º 10
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"


        #plugin itself
        self.content = Container("plugin", token, "Filesystem Plugin")

        # load all items from config
        for pair in Config.getSection("Filesystem"):
            print "+-+"+Config.absPath
            print pair[0], pair[1]
            self.loadFilesystem(pair)
Ejemplo n.º 11
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"

        #plugin itself
        self.content = Container("plugin", token, 'Temperature Plugin')
        
        temp = Container("cmd","LivingRoom", '20', self.get)
        temp.rendering = Container.PLAIN
        
        # set add container

        self.content.addChild(temp)
Ejemplo n.º 12
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"


        #plugin itself
        self.content = Container("plugin", token, "This is a Status Plugin")

        # set add container
        self.content.addContainer("cmd", "Buddies", "Show Buddies", self.getBuddies)


        self.content.addContainer("cmd", "Root", "Show Root Node", self.getRoot)
Ejemplo n.º 13
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"

        #plugin itself
        self.content = Container("plugin", token, "This is a Scripts Plugins")
        self.visible = False

        # set add container

        self.content.addContainer("cmd","AppleScript", "apple a script", self.appleScript)

	self.content.addContainer("cmd","ShellScript", "execute Shell Commands", self.shellScript)
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        # set plugins "hardware" architecture for system dependencies
        self.architecture = "all"

        # create plugin itself
        self.content = callmonitorContainer("plugin", token, "This hopefully will be a Call Monitor SoftKey  Plugin")

        # dont know wheather it works, shold set the name of the thread
        self.content.name = "CallMonitorThread"

        # start thread
        self.content.start()
Ejemplo n.º 15
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = MadplayContainer("plugin", token, "This is a Madplay Plugin")

        #Plugin visibility, can be accessed, but is not listed
        self.visible = False
        
        # set add container
        self.content.addContainer("cmd", "Play", "Play Madplay", self.play)

	self.content.addContainer("cmd", "Stop", "Stop Madplay", self.stop)
Ejemplo n.º 16
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"


        if self.architecture.__eq__(Config.get("server", "architecture")):

            # plugin itself
            self.content = avrContainer("plugin", token, "This hopefully will be a Threaded SoftKey  Plugin")
            self.content.rendering = Container.PLAIN
            self.content.start()

        else:
            self.content = Container("plugin", token, "not supported")
Ejemplo n.º 17
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "openwrt"
        

        #plugin itself
        self.content = Container("plugin", token, "This is a Nabaztag Plugin")

        # hide Plugin from showing up in xml, search, show...
        self.content.visible = False

        # set add container
        self.content.addContainer("cmd", "Play", "Play Stream on Nabaztag", self.play)

	self.content.addContainer("cmd", "Stop", "Stop Nabaztag", self.stop)
Ejemplo n.º 18
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = Container("plugin", token, "this is a Prowl plugin")
		
		#get platform we're running on
	platform = Config.get('server','architecture')
		
	if (platform == "macos"):
        # set add container
        	self.content.addContainer("cmd","Prowl", "send Push notification", self.prowl)
        else:
        	import pynotify
        	self.content.addContainer("cmd","Ubuntu", "show Ubuntu Notification", self.unotify)
Ejemplo n.º 19
0
 def loadPlugIn(self, path):
     """ Loads and returns the given plug-in. May return None if loading was unsuccessful (in which case this method prints a message saying so). Used by loadPlugIns(). """
     plugIn = None
     path = self.serverSidePath(path)
     try:
         plugIn = PlugIn(self, path)
         willNotLoadReason = plugIn.load()
         if willNotLoadReason:
             print '    Plug-in %s cannot be loaded because:\n    %s' % (
                 path, willNotLoadReason)
             return None
         plugIn.install()
     except:
         import traceback
         traceback.print_exc(file=sys.stderr)
         self.error('Plug-in %s raised exception.' % path)
     return plugIn
Ejemplo n.º 20
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"
        #self.override_dict ={}

        #plugin itself
        self.content = Container("plugin", token, "set something")
        self.content.rendering = Container.PLAIN

        #Plugin visibility, can be accessed, but is not listed
        self.visible = False
        
        #create a new Container
        changeElement = Container('cmd','element','ELEMENT', self.element)
        changeElement.rendering = Container.PLAIN
        changeElement.visible = True
        self.content.addChild(changeElement)
Ejemplo n.º 21
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"


        #plugin itself
        self.content = Container("plugin", token, "This is a global Status Plugin")
        self.content.logging = True

        # set add container
        

        if not Config.getSection('Global').__eq__(''):
            for pair in Config.getSection("Global"): 
                container = Container("cmd", pair[0], "global cmd" )
                container.setUse(self.getState,pair[1])
                self.content.addChild(container)
Ejemplo n.º 22
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself, is threaded uses the its process method
        self.content = ThreadContainer("plugin", token, "This hopefully will be a Threaded Feedreader Plugin") #ThreadContainer
        self.content.setDo(self.process)
        self.content.setUse(self.display)

        for touple in Config.getSection("FeedReader"):
            #t = touple.split(">")
            tmpcont = Container("plugin", touple[0], touple[1])
            #tmpcont.setUse(self.display)
            self.content.addChild(tmpcont)

        self.content.addContainer("cmd", "Random", "/FeedReader/mondayjazz", self.playRandom)

        self.content.start()
Ejemplo n.º 23
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        config = ConfigParser()
        configpath = Config.absPath + "/properties/profiles.properties"
        config.readfp(open(configpath))

        # plugin itself
        self.content = Container(
            "plugin", token, "This Plugin activates predefined amiServer States, known as Profiles.", self.rootdo
        )

        for profile in config.sections():
            batch = []
            for tuple in config.items(profile):
                batch.append(tuple[1])
            self.content.addContainer("cmd", profile, batch, self.batch)
Ejemplo n.º 24
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "macos"
        
        

        #plugin itself
        self.content = Container("plugin",token, "This is a iTunes Plugins")

        # play functionality
        self.content.addChild(Container("cmd", "Play", "Play iTunes"))
        self.content.getChild("Play").setUse(self.play)

        # pause functionality
        self.content.addChild(Container("cmd","Pause", "Pause iTunes"))
        self.content.getChild("Pause").setUse(self.pause)

        # next functionality
        self.content.addChild(Container("cmd","Next", "Next iTunes Track"))
        self.content.getChild("Next").setUse(self.next)

        # prev functionality
        self.content.addChild(Container("cmd","Prev", "Prev iTunes Track"))
        self.content.getChild("Prev").setUse(self.prev)

        # vol up functionality
        self.content.addChild(Container("cmd","VolUp", "VolUp iTunes"))
        self.content.getChild("VolUp").setUse(self.vol_up)

        # vol down functionality
        self.content.addChild(Container("cmd","VolDown", "VolDown iTunes"))
        self.content.getChild("VolDown").setUse(self.vol_down)

        # stop functionality
        self.content.addChild(Container("cmd","Stop", "Stop iTunes"))
        self.content.getChild("Stop").setUse(self.stop)

        # mute functionality
        self.content.addChild(Container("cmd","Mute", "Mute iTunes"))
        self.content.getChild("Mute").setUse(self.mute)

        # unmute functionality
        self.content.addChild(Container("cmd","Unmute", "Unmute iTunes"))
        self.content.getChild("Unmute").setUse(self.unmute)
Ejemplo n.º 25
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"


        #plugin itself
        self.content = Container("plugin", token, "This is a Defaults Plugin")

        # add container, set information to standard-path from config
        #self.content.addContainer("cmd", "Play", Config.audioPlay, self.play)

	#self.content.addContainer("cmd", "Stop", Config.audioStop, self.stop)

        #self.content.addContainer("cmd", "SetVol", Config.setVol, self.setVol)

        #self.content.addContainer("cmd", "Notification", Config.setVol, self.notify)

        for pair in Config.getSection("Defaults"):
            self.content.addContainer("cmd", pair[0], pair[1], self.general)
Ejemplo n.º 26
0
    def loadPlugIn(self, name, module, verbose=True):
        """Load and return the given plug-in.

        May return None if loading was unsuccessful (in which case this method
        prints a message saying so). Used by `loadPlugIns` (note the **s**).
        """
        try:
            plugIn = PlugIn(self.app, name, module)
            willNotLoadReason = plugIn.load(verbose=verbose)
            if willNotLoadReason:
                print(f'    Plug-in {name} cannot be loaded because:\n'
                      f'    {willNotLoadReason}')
                return None
            plugIn.install()
        except Exception:
            print()
            print(f'Plug-in {name} raised exception.')
            raise
        return plugIn
Ejemplo n.º 27
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        global active
        global lastMotion
        lastMotion = ""
        active=False
        
        #plugin itself
        self.content = Container("plugin", token, "Security Scenario")
        self.content.logging = True

        # set add container
        
        self.content.addContainer("cmd","State", "get Security State", self.getState)
        self.content.addContainer("cmd","TriggerMotion","Trigger Motion event", self.triggerMotion)
        self.content.addContainer("cmd","LastMotion","Last Motion event", self.lastMotion)
        self.content.addContainer("cmd","setState", "set State", self.setState)
        self.content.addContainer("cmd","toggleState", "toggleState", self.toggleState)
Ejemplo n.º 28
0
    def loadPlugIn(self, path):
        """Load and return the given plug-in.

        May return None if loading was unsuccessful (in which case this method
        prints a message saying so). Used by `loadPlugIns` (note the **s**).
        """
        path = self.serverSidePath(path)
        try:
            plugIn = PlugIn(self, path)
            willNotLoadReason = plugIn.load()
            if willNotLoadReason:
                print ('    Plug-in %s cannot be loaded because:\n'
                    '    %s' % (path, willNotLoadReason))
                return None
            plugIn.install()
        except Exception:
            print
            print 'Plug-in', path, 'raised exception.'
            raise
        return plugIn
Ejemplo n.º 29
0
    def loadPlugIn(self, path):
        """Load and return the given plug-in.

        May return None if loading was unsuccessful (in which case this method
        prints a message saying so). Used by `loadPlugIns` (note the **s**).
        """
        path = self.serverSidePath(path)
        try:
            plugIn = PlugIn(self, path)
            willNotLoadReason = plugIn.load()
            if willNotLoadReason:
                print ('    Plug-in %s cannot be loaded because:\n'
                    '    %s' % (path, willNotLoadReason))
                return None
            plugIn.install()
        except Exception:
            print
            print 'Plug-in', path, 'raised exception.'
            raise
        return plugIn
Ejemplo n.º 30
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = Container("plugin", token, "This is a Interface")

        xmlC = Container("cmd", "Xml", "Get the Tree or Subtree as XML", self.getXml)
        xmlC.rendering = Container.PLAIN

        jqC = Container("cmd", "JqHtml", "Get the Tree or Subtree as JQ Touch HTML", self.getJq)
        jqC.rendering = Container.PLAIN

        multirequest = Container("cmd", "multirequest", "Access multiple requests with one request, function returns some JSON code, or should", self.mreq)
        multirequest.rendering = Container.PLAIN


        self.content.addChild(xmlC)
        self.content.addChild(jqC)
        self.content.addChild(multirequest)
Ejemplo n.º 31
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        #plugin itself
        self.content = Container("plugin", token, "get something")
        self.content.rendering = Container.PLAIN

        #Plugin visibility, can be accessed, but is not listed
        self.visible = True
        
        getSTATE = Container('cmd','state','STATE', self.state)
        getSTATE.rendering = Container.PLAIN
        getSTATE.visible = True
        self.content.addChild(getSTATE)
    
        getENERGY = Container('cmd','energy','ENERGY', self.energy)
        getENERGY.rendering = Container.PLAIN
        getENERGY.visible = True
        self.content.addChild(getENERGY)
Ejemplo n.º 32
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"

        lib=Config.absPath+Config.avrLib
        print lib
        self.mega=cdll.LoadLibrary(lib)


        self.mega.initUsbLib()


        #plugin itself
        self.content = Container("plugin", token, "This is a avrBridge Plugin")
        self.content.visible = False


        # hide Plugin from showing up in xml, search, show...
        self.content.visible = False

        # set add container
        self.content.addContainer("cmd", "adc0", "get Adc 0 Value", self.adc0)
Ejemplo n.º 33
0
    def __init__(self, token, configFile):
        PlugIn.__init__(self)
        self.architecture = "all"
        self.jid = Config.get("jabber","jid")
        #plugin itself
        self.content = Container("plugin", token, "This is a Sensors Plugin")
	cmd=""
        for pair in Config.getSection("Sensors"):
            if '?' in pair[1]:
            	tmp = pair[1].split('?')
            	self.content.arg = tmp[1].replace('string=','')
		cmd = tmp[0]
            else:
            	self.content.arg=""
            
            if pair[0].endswith('_plain'):
                title= pair[0].replace('_plain','')
                container = Container("cmd",title,pair[1],self.general)
                container.rendering = Container.PLAIN
            else:
                container = Container("cmd",pair[0],cmd,self.general)
            self.content.addChild(container)
Ejemplo n.º 34
0
def selectDefaultPlugIn():
    """select the default PlugIn """
    PlugIn.sortBySelectionOrder()
    selectedPlugIn = PlugIn.findDefault()