From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#43252: 27.1; DBus properties lack type hints or overrides Date: Thu, 17 Sep 2020 14:58:08 +0200 Message-ID: <87a6xor25b.fsf@gmx.de> References: <87v9gqquct.fsf@ccss.com> <87imcqdo38.fsf@gmx.de> <87sgbtqylc.fsf@ccss.com> <87sgbtcvqs.fsf@gmx.de> <87pn6xqtsz.fsf@ccss.com> <87363sl4hs.fsf@gmx.de> <877dt3bnfl.fsf@ccss.com> <878sdj84kn.fsf@gmx.de> <871rjbaq05.fsf@ccss.com> <874ko6979w.fsf@gmx.de> <87v9gm9x9i.fsf@ccss.com> <871rj9k78r.fsf@gmx.de> <87imclwow5.fsf@gmx.de> <87pn6t9rbq.fsf@ccss.com> <87y2lggzvd.fsf@gmx.de> <87h7rzadlo.fsf@ccss.com> <87k0wtrir2.fsf@gmx.de> <87een19x9n.fsf@ccss.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24502"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43252@debbugs.gnu.org To: Hugh Daschbach Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 17 14:59:54 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kItVy-0006IK-Ko for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Sep 2020 14:59:54 +0200 Original-Received: from localhost ([::1]:43644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kItVx-000744-DD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Sep 2020 08:59:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kItV8-00070j-Kp for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 08:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kItV8-0008QP-9k for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 08:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kItV8-0004EK-1Z for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 08:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Sep 2020 12:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43252 X-GNU-PR-Package: emacs Original-Received: via spool by 43252-submit@debbugs.gnu.org id=B43252.160034750416216 (code B ref 43252); Thu, 17 Sep 2020 12:59:01 +0000 Original-Received: (at 43252) by debbugs.gnu.org; 17 Sep 2020 12:58:24 +0000 Original-Received: from localhost ([127.0.0.1]:37519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kItUV-0004DT-HO for submit@debbugs.gnu.org; Thu, 17 Sep 2020 08:58:24 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:59545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kItUR-0004DA-TU for 43252@debbugs.gnu.org; Thu, 17 Sep 2020 08:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600347491; bh=2O1nnkhQloZr40PJZq+gG3ncv1rN3BTxmdEeK7JkraU=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=g2Gxll9aFdLQNBo5VUoceeLbXbSh2ilkaG+mNJeYwXQBHaaWIF9wZXnl593tBkNgH G9rkA+kTrw1ak+xf4RkIKsHw5XLnAdKpxh+5jbjd13LO39QCiznwpuVTLANGaYSiv3 S1iKlQXtJspMgP31g5kkMwzvX9/OdbwS56kN2v8E= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.37.67]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MEFzx-1kAwrM234n-00AGn7; Thu, 17 Sep 2020 14:58:09 +0200 In-Reply-To: <87een19x9n.fsf@ccss.com> (Hugh Daschbach's message of "Wed, 16 Sep 2020 15:23:16 -0700") X-Provags-ID: V03:K1:6hdWg8UqVcbgA/5Lf1j/X74rsJSf/AzBo4EnfMSMrKqKvmsTIeX jDxzXDaIW89Vwkv5j4Q+blqriKQETauC0xpekh+5QEB43RAtzSbZwDmGbUpDgW+wZkVaIV3 q49DX7da5Xwno5HX1/r9uZCN9cv9uC/yi5PdCaob+wIaBirF12kmkdgD33moxWBHxbR/I/Q 6sQmOKyE74sg+s2+L2luw== X-UI-Out-Filterresults: notjunk:1;V03:K0:aL/o+HhJ5I4=:4eBa8oENNec27ihMrVa9DK ii2U4U0Ux2eow43ndCaFP6HTw7M/hwsqv4JgaT+QHEMfWTm2mNBEK1APWOL1OC9GT3FKxU/Bm 96O4TMZNHBvb5P5jtaSt7SndeiNUvVRggohYrQFEl32mTH2hpr+ssOEaq7CTOk+TyVsv6Bmx8 5DV8oVsUk9mm5nCBYZDWwVz775Bn8DcnhaXy7BMvOnrMXdVaLDBTcGZFp78YWQWv95j3Q9QGw dvc68wxEy87d6lHq0c9lZFGB9to+SDytKKgs9vSphPo4d9PAqQwcvd7Ordv0rdQd777a/MOf8 3pVwqftj5YTifRP4pw8ShoHmuz3KTM9SlQpgzo3a6PDzRzBuWUd8PdR4MVpv3abZC/VT13iCf sYY8aRlLn1/PKzbHmV6nw2mnnDLJM4nm1slCWamsscpikqa7ndX5e/JLT9ACh9cKu10UOj5Yz X11P1gISRwC6ut9/U10rBvQNBTJt4DrXABnV98kjUtZD2YZCFuoP2LFM8sbKcrSMlojPu+4qD BriOLR/9jqqpBaMIo5zTsF0pkOsqZjrE0o9OkNAbMum1T6Kbl3IMkEcZpclSbc7OoPPYr3pV9 Ip+T0JGVmMHv7+8JJKvZ0lHcIcTg26dmve7s0mpu02Eixp1kPfzUdhsgyUo00zFqxHZzrweME qBcyq/NqvekZKsjaX0hik/bqsjpEcL9kx5ID92fvjFgnz6yUNKOPhVDv+OGTUuO+mP99z3BdR Of0H7eiv3xgLoCQ6rOfBEOjclbeR91lGHjuR7g329lFk8i9fbZ4wD4jBXxJlaHpOomtoBRfs X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188194 Archived-At: Hugh Daschbach writes: Hi Hugh, >> Now that we have type information in dbus-event, I'll start next >> days to >> implement org.freedesktop.DBus.Monitoring.BecomeMonitor >> . If >> this succeeds, we could implement a counterpart to the dbus-monitor >> program in Elisp. And you would be able to access this information >> programmatically, including all message and signal call / return >> arguments and their types. Let's see. > > Excellent. I can now parse the output of dbus-monitor. But capturing > asynchronous output and feeding it through an ah-hoc parser seems > fragile. Capturing type data directly as a monitor is much more > robust. Implementation is more complex than expected. Due to its nature, org.freedesktop.DBus.Monitoring.BecomeMonitor requires another (parallel) connection to the bus. This is not foreseen yet in dbusbind.c; will see how it could fly. What I could provide just now is an implementation which runs in *another* Emacs instance. This could be used for monitoring only, because it is another connection to the bus per definition. Are you interested to get such a partial implementation? > There's quite a bit of boiler plate in the property tests. Do you > have > an issue with rolling that up in a macro? Does it make test failure > analysis more difficult? No objection. But comments :-) > Here's a candidate: > > (defmacro dbus-test05-test-property (name value expected) > `(let ((byte-array ,name)) I wouldn't call the variable "byte-array"; it could be anything during test. Call it "property" or alike. > (should > (equal > (dbus-register-property > :session dbus--test-service dbus--test-path > dbus--test-interface ,name :read I would use access type :readwrite. We want also to test dbus-set-property. > ,value) > `((:property :session ,,dbus--test-interface ,,name) > (,dbus--test-service ,,dbus--test-path)))) What are the double commas good for? Typos? > (should > (equal > (dbus-get-property > :session dbus--test-service dbus--test-path > dbus--test-interface ,name) > ,expected)) > > ;; a test for `dbus-get-property' shall be added. That's my typo - dbus-set-property is meant. And yes, it shall also be here. So you might need macro arguments value1 expected1 value2 expected2. > (let ((result > (dbus-get-all-properties > :session dbus--test-service dbus--test-path > dbus--test-interface))) > (should (equal (cdr (assoc ,name result)) ,expected))) > > (let ((result > (dbus-get-all-managed-objects :session > dbus--test-service "/")) > result1) > (should (setq result1 (cadr (assoc dbus--test-path result)))) > (should (setq result1 (cadr (assoc dbus--test-interface > result1)))) > (should (equal (cdr (assoc ,name result1)) ,expected))))) > > With the calling sequence something like: > > (dbus-test05-test-property > "bytearray" > '(:array :byte 1 :byte 2 :byte 3) > '(1 2 3)) > > Opinion? See above. > Thanks, > Hugh Best regards, Michael.