Commit c0de2cc1 authored by Devaev Maxim's avatar Devaev Maxim

Completed example module

parent 11f3ec4d
...@@ -6,6 +6,7 @@ import time ...@@ -6,6 +6,7 @@ import time
from settingsd import config from settingsd import config
from settingsd import service from settingsd import service
from settingsd import shared from settingsd import shared
from settingsd import dbus_tools
##### Private classes ##### ##### Private classes #####
...@@ -21,14 +22,20 @@ class Example(service.FunctionObject) : ...@@ -21,14 +22,20 @@ class Example(service.FunctionObject) :
def echo(self, text) : def echo(self, text) :
return text return text
@service.functionMethod("example")
def time(self) : def time(self) :
return time.ctime() return time.ctime()
@service.customMethod("com.example.settingsd") ###
@service.customMethod("com.example.settingsd.sharedObject")
def die(self) : def die(self) :
shared.Functions.Test.Example.removeFromConnection() self.removeFromConnection() # shared.Functions.Test.Example.removeFromConnection()
shared.Functions.Test.removeSharedObject("Example") self.shared().removeSharedObject(self.name()) # shared.Functions.Test.removeSharedObject("Example")
return self.sharedPath()
@service.customMethod("com.example.settingsd.sharedObject")
def path(self) :
return service.FunctionObject.path(self)
### ###
...@@ -45,7 +52,7 @@ class Example(service.FunctionObject) : ...@@ -45,7 +52,7 @@ class Example(service.FunctionObject) :
class Service(service.Service) : class Service(service.Service) :
def initService(self) : def initService(self) :
shared.Functions.addShared("Test") shared.Functions.addShared("Test")
shared.Functions.Test.addSharedObject("Example", Example(self.serviceName(), "Test.Example", self)) shared.Functions.Test.addSharedObject("Example", Example(self.serviceName(), self))
@classmethod @classmethod
def serviceName(self) : def serviceName(self) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment