Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
439e8c5e
Commit
439e8c5e
authored
Oct 09, 2010
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added signatures support for methods
parent
f34c7d57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
22 deletions
+16
-22
service.py
settingsd/service.py
+10
-16
service_decorators.py
settingsd/service_decorators.py
+6
-6
No files found.
settingsd/service.py
View file @
439e8c5e
...
...
@@ -12,13 +12,7 @@ import shared
import
dbus_tools
import
logger
from
service_decorators
import
customMethod
from
service_decorators
import
functionMethod
from
service_decorators
import
actionMethod
from
service_decorators
import
customSignal
from
service_decorators
import
functionSignal
from
service_decorators
import
actionSignal
from
service_decorators
import
*
##### Private classes #####
...
...
@@ -58,11 +52,11 @@ class Service(ServiceInterface, ServiceRequisitesInterface) :
#####
class
CustomObject
(
dbus
.
service
.
Object
)
:
def
__init__
(
self
,
object_path
,
service
=
None
)
:
def
__init__
(
self
,
object_path
,
service
_object
=
None
)
:
dbus
.
service
.
Object
.
__init__
(
self
,
config
.
value
(
config
.
RUNTIME_SECTION
,
"bus_name"
),
object_path
)
self
.
_object_path
=
object_path
self
.
_service
=
service
self
.
_service
_object
=
service_object
#####
...
...
@@ -92,11 +86,11 @@ class CustomObject(dbus.service.Object) :
###
def
setService
(
self
,
service
)
:
self
.
_service
=
service
def
setService
(
self
,
service
_object
)
:
self
.
_service
_object
=
service_object
def
service
(
self
)
:
return
self
.
_service
return
self
.
_service
_object
def
setShared
(
self
,
shared
)
:
self
.
_shared
=
shared
...
...
@@ -114,12 +108,12 @@ class CustomObject(dbus.service.Object) :
class
FunctionObject
(
CustomObject
)
:
def
__init__
(
self
,
object_path
,
service
=
None
)
:
def
__init__
(
self
,
object_path
,
service
_object
=
None
)
:
CustomObject
.
__init__
(
self
,
dbus_tools
.
joinPath
(
config
.
value
(
config
.
APPLICATION_SECTION
,
"service_path"
),
"functions"
,
object_path
),
service
)
"functions"
,
object_path
),
service
_object
)
class
ActionObject
(
CustomObject
)
:
def
__init__
(
self
,
object_path
,
service
=
None
)
:
def
__init__
(
self
,
object_path
,
service
_object
=
None
)
:
CustomObject
.
__init__
(
self
,
dbus_tools
.
joinPath
(
config
.
value
(
config
.
APPLICATION_SECTION
,
"service_path"
),
"actions"
,
object_path
),
service
)
"actions"
,
object_path
),
service
_object
)
settingsd/service_decorators.py
View file @
439e8c5e
...
...
@@ -48,21 +48,21 @@ def tracer(function, statics_list=[0]) :
##### Public decorators #####
def
customMethod
(
interface_name
)
:
def
customMethod
(
interface_name
,
**
kwargs_dict
)
:
def
decorator
(
function
)
:
return
tracer
(
dbus
.
service
.
method
(
interface_name
)(
function
))
return
tracer
(
dbus
.
service
.
method
(
interface_name
,
**
kwargs_dict
)(
function
))
return
decorator
def
functionMethod
(
interface_name
)
:
def
functionMethod
(
interface_name
,
**
kwargs_dict
)
:
def
decorator
(
function
)
:
return
customMethod
(
dbus_tools
.
joinMethod
(
config
.
value
(
config
.
APPLICATION_SECTION
,
"service_name"
),
"functions"
,
interface_name
))(
function
)
"functions"
,
interface_name
)
,
**
kwargs_dict
)(
function
)
return
decorator
def
actionMethod
(
interface_name
)
:
def
actionMethod
(
interface_name
,
**
kwargs_dict
)
:
def
decorator
(
function
)
:
return
customMethod
(
dbus_tools
.
joinMethod
(
config
.
value
(
config
.
APPLICATION_SECTION
,
"service_name"
),
"actions"
,
interface_name
))(
function
)
"actions"
,
interface_name
)
,
**
kwargs_dict
)(
function
)
return
decorator
###
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment