2011-11-11 00:58:35

by Vinicius Costa Gomes

[permalink] [raw]
Subject: [PATCH BlueZ] Fix simple-player test script to make it work with dbus-python-0.84

---
In every machine that I tried with dbus-python 0.84, something like this was
needed, but I didn't find out why nobody complained about this earlier.


test/simple-player | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/simple-player b/test/simple-player
index 166caff..70701da 100755
--- a/test/simple-player
+++ b/test/simple-player
@@ -104,7 +104,7 @@ if __name__ == '__main__':
"Shuffle" : "off",
"Scan" : "off",
"Status" : "playing",
- "Position" : dbus.UInt32(0) })
+ "Position" : dbus.UInt32(0) }, signature="sv")

metadata = dbus.Dictionary({ "Title" : "Title",
"Artist" : "Artist",
@@ -112,7 +112,7 @@ if __name__ == '__main__':
"Genre" : "Genre",
"NumberOfTracks" : dbus.UInt32(10),
"Number" : dbus.UInt32(1),
- "Duration" : dbus.UInt32(10000) })
+ "Duration" : dbus.UInt32(10000) }, signature="sv")

print('Register media player with:\n\tProperties: %s\n\tMetadata: %s' \
% (properties, metadata))
@@ -120,6 +120,6 @@ if __name__ == '__main__':
handler = InputHandler(player)
gobject.io_add_watch(sys.stdin, gobject.IO_IN, handler.handle)

- media.RegisterPlayer(path, properties, metadata)
+ media.RegisterPlayer(dbus.ObjectPath(path), properties, metadata)

mainloop.run()
--
1.7.7



2011-11-14 10:57:35

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix simple-player test script to make it work with dbus-python-0.84

Hi Vinicius,

On Thu, Nov 10, 2011, Vinicius Costa Gomes wrote:
> ---
> In every machine that I tried with dbus-python 0.84, something like this was
> needed, but I didn't find out why nobody complained about this earlier.
>
> test/simple-player | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)

Applied. Thanks.

Johan

2011-11-11 14:46:00

by Vinicius Costa Gomes

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix simple-player test script to make it work with dbus-python-0.84

Hi Lucas,

On 11:23 Fri 11 Nov, Lucas De Marchi wrote:
> Hi Vinicius
>
> On Thu, Nov 10, 2011 at 10:58 PM, Vinicius Costa Gomes
> <[email protected]> wrote:
> > ---
> > In every machine that I tried with dbus-python 0.84, something like this was
> > needed, but I didn't find out why nobody complained about this earlier.
>
> Weird... I have exactly the same version here.
>
> >
> >
> > ?test/simple-player | ? ?6 +++---
> > ?1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/test/simple-player b/test/simple-player
> > index 166caff..70701da 100755
> > --- a/test/simple-player
> > +++ b/test/simple-player
> > @@ -104,7 +104,7 @@ if __name__ == '__main__':
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Shuffle" : "off",
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Scan" : "off",
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Status" : "playing",
> > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Position" : dbus.UInt32(0) })
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Position" : dbus.UInt32(0) }, signature="sv")
>
> From http://dbus.freedesktop.org/doc/dbus-python/api/: if signature is
> None (the default) it will be guessed from the elements in the dict.
> However, I think it doesn't hurt to put it explicitly.
>

Makes sense, but at least here, the presence of both integers and
strings seems to confuse dbus-python.

> >
> > ? ? ? ?metadata = dbus.Dictionary({ "Title" : "Title",
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Artist" : "Artist",
> > @@ -112,7 +112,7 @@ if __name__ == '__main__':
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Genre" : "Genre",
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"NumberOfTracks" : dbus.UInt32(10),
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Number" : dbus.UInt32(1),
> > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Duration" : dbus.UInt32(10000) })
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Duration" : dbus.UInt32(10000) }, signature="sv")
> >
> > ? ? ? ?print('Register media player with:\n\tProperties: %s\n\tMetadata: %s' \
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?% (properties, metadata))
> > @@ -120,6 +120,6 @@ if __name__ == '__main__':
> > ? ? ? ?handler = InputHandler(player)
> > ? ? ? ?gobject.io_add_watch(sys.stdin, gobject.IO_IN, handler.handle)
> >
> > - ? ? ? media.RegisterPlayer(path, properties, metadata)
> > + ? ? ? media.RegisterPlayer(dbus.ObjectPath(path), properties, metadata)
> >
> > ? ? ? ?mainloop.run()
>
>
> Anyway... it works here with your patch as well.

Thanks.

>
> ACK


Cheers,
--
Vinicius

2011-11-11 13:23:45

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix simple-player test script to make it work with dbus-python-0.84

Hi Vinicius

On Thu, Nov 10, 2011 at 10:58 PM, Vinicius Costa Gomes
<[email protected]> wrote:
> ---
> In every machine that I tried with dbus-python 0.84, something like this was
> needed, but I didn't find out why nobody complained about this earlier.

Weird... I have exactly the same version here.

>
>
> ?test/simple-player | ? ?6 +++---
> ?1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/test/simple-player b/test/simple-player
> index 166caff..70701da 100755
> --- a/test/simple-player
> +++ b/test/simple-player
> @@ -104,7 +104,7 @@ if __name__ == '__main__':
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Shuffle" : "off",
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Scan" : "off",
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Status" : "playing",
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Position" : dbus.UInt32(0) })
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Position" : dbus.UInt32(0) }, signature="sv")

>From http://dbus.freedesktop.org/doc/dbus-python/api/: if signature is
None (the default) it will be guessed from the elements in the dict.
However, I think it doesn't hurt to put it explicitly.

>
> ? ? ? ?metadata = dbus.Dictionary({ "Title" : "Title",
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Artist" : "Artist",
> @@ -112,7 +112,7 @@ if __name__ == '__main__':
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Genre" : "Genre",
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"NumberOfTracks" : dbus.UInt32(10),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Number" : dbus.UInt32(1),
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Duration" : dbus.UInt32(10000) })
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Duration" : dbus.UInt32(10000) }, signature="sv")
>
> ? ? ? ?print('Register media player with:\n\tProperties: %s\n\tMetadata: %s' \
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?% (properties, metadata))
> @@ -120,6 +120,6 @@ if __name__ == '__main__':
> ? ? ? ?handler = InputHandler(player)
> ? ? ? ?gobject.io_add_watch(sys.stdin, gobject.IO_IN, handler.handle)
>
> - ? ? ? media.RegisterPlayer(path, properties, metadata)
> + ? ? ? media.RegisterPlayer(dbus.ObjectPath(path), properties, metadata)
>
> ? ? ? ?mainloop.run()


Anyway... it works here with your patch as well.

ACK