This commit is contained in:
bluepython508 committed 2026-10-22 12:27:19 +01:00
1 parent 3530afb854
commit 6903fcff27
2146 files changed
+112256 -190703

No files matched your search

+13 -13
View File
@@ -9,15 +9,15 @@ import (
// BusObject is the interface of a remote object on which methods can be
// invoked.
type BusObject interface {
Call(method string, flags Flags, args ...interface{}) *Call
CallWithContext(ctx context.Context, method string, flags Flags, args ...interface{}) *Call
Go(method string, flags Flags, ch chan *Call, args ...interface{}) *Call
GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call
Call(method string, flags Flags, args ...any) *Call
CallWithContext(ctx context.Context, method string, flags Flags, args ...any) *Call
Go(method string, flags Flags, ch chan *Call, args ...any) *Call
GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...any) *Call
AddMatchSignal(iface, member string, options ...MatchOption) *Call
RemoveMatchSignal(iface, member string, options ...MatchOption) *Call
GetProperty(p string) (Variant, error)
StoreProperty(p string, value interface{}) error
SetProperty(p string, v interface{}) error
StoreProperty(p string, value any) error
SetProperty(p string, v any) error
Destination() string
Path() ObjectPath
}
@@ -30,12 +30,12 @@ type Object struct {
}
// Call calls a method with (*Object).Go and waits for its reply.
func (o *Object) Call(method string, flags Flags, args ...interface{}) *Call {
func (o *Object) Call(method string, flags Flags, args ...any) *Call {
return <-o.createCall(context.Background(), method, flags, make(chan *Call, 1), args...).Done
}
// CallWithContext acts like Call but takes a context
func (o *Object) CallWithContext(ctx context.Context, method string, flags Flags, args ...interface{}) *Call {
func (o *Object) CallWithContext(ctx context.Context, method string, flags Flags, args ...any) *Call {
return <-o.createCall(ctx, method, flags, make(chan *Call, 1), args...).Done
}
@@ -89,16 +89,16 @@ func (o *Object) RemoveMatchSignal(iface, member string, options ...MatchOption)
//
// If the method parameter contains a dot ('.'), the part before the last dot
// specifies the interface on which the method is called.
func (o *Object) Go(method string, flags Flags, ch chan *Call, args ...interface{}) *Call {
func (o *Object) Go(method string, flags Flags, ch chan *Call, args ...any) *Call {
return o.createCall(context.Background(), method, flags, ch, args...)
}
// GoWithContext acts like Go but takes a context
func (o *Object) GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call {
func (o *Object) GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...any) *Call {
return o.createCall(ctx, method, flags, ch, args...)
}
func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call {
func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch chan *Call, args ...any) *Call {
if ctx == nil {
panic("nil context")
}
@@ -136,7 +136,7 @@ func (o *Object) GetProperty(p string) (Variant, error) {
// StoreProperty calls org.freedesktop.DBus.Properties.Get on the given
// object. The property name must be given in interface.member notation.
// It stores the returned property into the provided value.
func (o *Object) StoreProperty(p string, value interface{}) error {
func (o *Object) StoreProperty(p string, value any) error {
idx := strings.LastIndex(p, ".")
if idx == -1 || idx+1 == len(p) {
return errors.New("dbus: invalid property " + p)
@@ -152,7 +152,7 @@ func (o *Object) StoreProperty(p string, value interface{}) error {
// SetProperty calls org.freedesktop.DBus.Properties.Set on the given
// object. The property name must be given in interface.member notation.
// Panics if v is not a valid Variant type.
func (o *Object) SetProperty(p string, v interface{}) error {
func (o *Object) SetProperty(p string, v any) error {
// v might already be a variant...
variant, ok := v.(Variant)
if !ok {