Linux-NFC Archive mirror
 help / color / mirror / Atom feed
From: Mark Greer <mgreer@animalcreek.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: linux-nfc@lists.01.org
Subject: [linux-nfc] Re: [PATCH] [neard][RFC] test: Convert Python2 scripts to Python3
Date: Mon, 6 Dec 2021 10:17:12 -0700	[thread overview]
Message-ID: <20211206171712.GC234718@animalcreek.com> (raw)
In-Reply-To: <cd4169f5-2a97-61d8-240d-30ee16bcdd06@canonical.com>

On Wed, Dec 01, 2021 at 09:53:20AM +0100, Krzysztof Kozlowski wrote:
> On 29/11/2021 05:15, Mark Greer wrote:
> > On Mon, Aug 09, 2021 at 12:35:07PM +0200, Krzysztof Kozlowski wrote:
> >> On 08/08/2021 04:20, Mark Greer wrote:
> >>> Python2 is deprecated so convert the neard test scripts, which are
> >>> Python2, to Python3.
> >>>
> >>> Signed-off-by: Mark Greer <mgreer@animalcreek.com>
> >>> ---
> >>> This is a first pass at converting the python scripts to Python3.
> >>> Not a lot of testing yet.  It appears that the 'gobject' is not
> >>> available anymore so I have to look into how to rework the code that
> >>> uses it.
> >>>
> >>> I would appreciate any testing that you are willing to provide.
> >>>
> >>> Also available at:
> >>> 	https://github.com/linux-nfc/neard/tree/mag/python3-ize
> >>>
> >>>  se/test/test-channel     | 18 +++++------
> >>>  se/test/test-seel        | 38 +++++++++++-----------
> >>>  test/bt-handover         |  8 ++---
> >>>  test/handover-agent      | 34 +++++++++----------
> >>>  test/monitor-near        |  8 ++---
> >>>  test/ndef-agent          | 20 ++++++------
> >>>  test/neard-ui.py         | 70 ++++++++++++++++++++--------------------
> >>>  test/neardutils.py       | 14 ++++----
> >>>  test/phdc-simple-manager | 50 ++++++++++++++--------------
> >>>  test/test-adapter        | 16 ++++-----
> >>>  test/test-device         | 34 +++++++++----------
> >>>  test/test-tag            | 10 +++---
> >>>  12 files changed, 160 insertions(+), 160 deletions(-)
> >>>
> >>
> >> Few tests:
> >> ------------
> >> $ sudo python3 ./test/test-adapter poll nfc0 on
> >> Traceback (most recent call last):
> >>   File "./test/test-adapter", line 92, in <module>
> >>     adapter.StartPollLoop(mode)
> >>   File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in
> >> __call__
> >>     return self._proxy_method(*args, **keywords)
> >>   File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in
> >> __call__
> >>     return self._connection.call_blocking(self._named_service,
> >>   File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in
> >> call_blocking
> >>     reply_message = self.send_message_with_reply_and_block(
> >> dbus.exceptions.DBusException: org.neard.Error.Failed: No such device
> >>
> >> During handling of the above exception, another exception occurred:
> >>
> >> Traceback (most recent call last):
> >>   File "./test/test-adapter", line 94, in <module>
> >>     print("%s: %s" % (error._dbus_error_name, error.message))
> >> AttributeError: 'DBusException' object has no attribute 'message'
> >> ------------
> > 
> > This looks like you may not have installed the necessary dbus support
> > (e.g., src/org.neard.conf).  After building neard, you can install this
> > with:
> > 
> > $ sudo make install
> > 
> > If that isn't it, I'll need more info about your environment because I
> > don't get those errors.  To make sure we're on the same page, these steps
> > should get you going (this example on an amd64 running Ubuntu 20.04):
> 
> Indeed lack of dbus support could be the original exception but the
> final exception is "AttributeError: 'DBusException' object has no
> attribute 'message'" which looks unrelated to actual DBUS installation.
> The error is that new Python dbus does not have message field. It has
> __str__ representation or get_dbus_message() method.

Yes, thank you.

I'll look at it when I look at the new dbus support for real.

Mark
--
_______________________________________________
Linux-nfc mailing list -- linux-nfc@lists.01.org
To unsubscribe send an email to linux-nfc-leave@lists.01.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

      reply	other threads:[~2021-12-06 17:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08  2:20 [linux-nfc] [PATCH] [neard][RFC] test: Convert Python2 scripts to Python3 Mark Greer
2021-08-08  2:22 ` [linux-nfc] " Mark Greer
2021-08-09 10:35 ` Krzysztof Kozlowski
2021-08-20 15:33   ` Mark Greer
2021-11-29  4:15   ` Mark Greer
2021-12-01  8:53     ` Krzysztof Kozlowski
2021-12-06 17:17       ` Mark Greer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211206171712.GC234718@animalcreek.com \
    --to=mgreer@animalcreek.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-nfc@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).