From mitr at redhat.com Tue Jul 14 10:29:03 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Tue, 14 Jul 2009 06:29:03 -0400 (EDT) Subject: [Firstaidkit-devel] [PATCHes] Add question support In-Reply-To: <1696352578.430191247567276655.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <285151161.430231247567343670.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, the attached patches add support for asking the user questions, and an example plugin to demonstrate the functionality. In addition to the main patch, attached is also a trivial git config change, and GDK thread locking bug fix necessary for the main patch. I'm afraid the glade changes are unreadable: the patch only adds new dialogs, the existing widgets were not changed at all. Thank you, Mirek -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Ignore-.pyc.patch Type: application/octet-stream Size: 457 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Fix-GDK-locking-in-GLib-idle-callbacks.patch Type: application/octet-stream Size: 1641 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Add-question-support.patch Type: application/mbox Size: 130294 bytes Desc: not available URL: From mitr at redhat.com Tue Jul 14 12:19:38 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Tue, 14 Jul 2009 08:19:38 -0400 (EDT) Subject: [Firstaidkit-devel] Re: [PATCHes] Add question support In-Reply-To: <757623175.432811247573852341.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <182666662.432911247573978055.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, ----- "Miloslav Trmac" wrote: > the attached patches add support for asking the user questions, and an > example plugin to demonstrate the functionality. Attached is an updated "main" patch, with the following changes: * Use a queue for delivering replies, to eventually support event-driven plugins * Use a separate message["action"] type for each question class * Store the Question object in message["message"] instead of message["question"], store prompt inside the Question object. Thanks to Martin Sivak for a review of the original patch. Mirek -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-question-support.patch Type: application/mbox Size: 131892 bytes Desc: not available URL: From msivak at redhat.com Tue Jul 14 14:31:38 2009 From: msivak at redhat.com (Martin Sivak) Date: Tue, 14 Jul 2009 10:31:38 -0400 (EDT) Subject: [Firstaidkit-devel] Re: [PATCHes] Add question support In-Reply-To: <748991195.377341247579211885.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Message-ID: <1605743527.382471247581898396.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Hi, I have some more "flaws" to discuss: + ANSWER = 999#In question reply, {"question", "answer"} This says nothing about the type of the answer, the response should use common info, tree or table type to create the answer and use the destination argument in the put call to select the answer queue. Or use the proper method of the newly created mailbox to construct it. (see the comments about openMailbox below) Also you should use the standard message structure for passing the information around, so answer goes to "message" and at least the origin field is set. + @staticmethod + def __blocking_question(fn, args, kwargs): + queue = Queue.Queue() + question = fn(queue, *args, **kwargs) + r = queue.get() + assert r["action"] == ANSWER and r["question"] is question + return r["answer"] You should use openMailbox and closeMailbox for queue management. The assert shouldn't be checking for ANSWER (see above). And I'd rename the "question" field to "inreplyto". + def __init__(self, queue, importance = logging.INFO, secondary = False Better name for the secondary argument would be "interactive" with default value of True I added the inreplyto field and modified the openMailbox/closeMailbox in such a way, that you can call the standard methods (info, table, tree, ..) of the returned mailbox. So you shouldn't need to construct the message structure by yourself. I also applied some of your patches. Martin ----- "Miloslav Trmac" wrote: > Hello, > ----- "Miloslav Trmac" wrote: > > the attached patches add support for asking the user questions, and > an > > example plugin to demonstrate the functionality. > Attached is an updated "main" patch, with the following changes: > * Use a queue for delivering replies, to eventually support > event-driven plugins > * Use a separate message["action"] type for each question class > * Store the Question object in message["message"] instead of > message["question"], > store prompt inside the Question object. > Thanks to Martin Sivak for a review of the original patch. > Mirek > _______________________________________________ > Firstaidkit-devel mailing list > Firstaidkit-devel at redhat.com > https://www.redhat.com/mailman/listinfo/firstaidkit-devel From mitr at redhat.com Fri Jul 17 13:51:21 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Fri, 17 Jul 2009 09:51:21 -0400 (EDT) Subject: [Firstaidkit-devel] [PATCHes] Misc. bug fixes, part 1 In-Reply-To: <705611701.643731247838680017.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <1226451463.643751247838681451.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, attached are patches that fix the following bugs: * notifyAll was calling parent's method incorrectly * Reports._queue_lock made it impossible to read from the queue. * Locking and unlocking Reports._queue_lock could become unbalanced Thank you, Mirek -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Fix-Reports.notifyAll.patch Type: application/octet-stream Size: 820 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Locking-bug-fixes.patch Type: application/mbox Size: 4589 bytes Desc: not available URL: From mitr at redhat.com Fri Jul 17 14:00:17 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Fri, 17 Jul 2009 10:00:17 -0400 (EDT) Subject: [Firstaidkit-devel] Re: [PATCHes] Add question support In-Reply-To: <822012320.644581247839212414.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <1468499586.644601247839217223.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, thanks for the review. ----- "Martin Sivak" wrote: > I have some more "flaws" to discuss: > > + ANSWER = 999#In question reply, {"question", "answer"} > > This says nothing about the type of the answer, the response should > use common info, tree or table type to create the answer The type is "a single Python value" - see e.g. the example dialogue plugin, which uses True and False as values. Wrapping it in any of the TREE/TABLE structures does not provide any additional type information; using INFO would confuse the value with an user-readable error message. > Also you should use the standard message structure for passing the > information around, so answer goes to "message" and at least the > origin field is set. Fixed. > > + @staticmethod > + def __blocking_question(fn, args, kwargs): > + queue = Queue.Queue() > + question = fn(queue, *args, **kwargs) > + r = queue.get() > + assert r["action"] == ANSWER and r["question"] is question > + return r["answer"] > > You should use openMailbox and closeMailbox for queue management. The "reply" field documentation required using a Queue.Queue; I have fixed both the code and documentation. > + def __init__(self, queue, importance = logging.INFO, secondary = > False > > Better name for the secondary argument would be "interactive" with > default value of True Fixed. Attached is an updated version of the patch, in addition to the above it also: * adds Cancel buttons to all GTK dialogs * allows CHOICE_QUESTION return value to be None Note that it depends on the "Misc. bug fixes, part 1" patches. Mirek -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Add-question-support.patch Type: application/mbox Size: 136161 bytes Desc: not available URL: From mitr at redhat.com Fri Jul 17 14:03:13 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Fri, 17 Jul 2009 10:03:13 -0400 (EDT) Subject: [Firstaidkit-devel] [PATCHes] Misc. bug fixes, part 2 - packaging In-Reply-To: <370139641.645021247839371026.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <2084402369.645101247839393555.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, attached are patches to fix the following bugs: * "git-archive" is not available in the default path any more * %files in firstaidkit.spec contained duplicates Thank you, Mirek -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Don-t-require-git-archive-in-PATH.patch Type: application/octet-stream Size: 792 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-Fix-duplicate-file-listings-in-files.patch Type: application/octet-stream Size: 1195 bytes Desc: not available URL: From mitr at redhat.com Fri Jul 17 14:08:24 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Fri, 17 Jul 2009 10:08:24 -0400 (EDT) Subject: [Firstaidkit-devel] [PATCH] Add volume_key plugin In-Reply-To: <385367271.645571247839671353.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <1036210009.645661247839704787.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, the attached patches add support for key recovery using volume_key. They depend on question support submitted earlier, and on python-volume_key, which is currently blocked in Fedora review (#508954). The first patch (adding the plugin) can be applied immediately - the plugin will be silently ignored if "import volume_key" fails. The second patch (updating packaging) will have to wait until python-volume_key is available in repositories. Thank you, Mirek -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Add-KeyRecoveryPlugin.patch Type: application/mbox Size: 10622 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-Add-firstaidkit-plugin-key-recovery-package.patch Type: application/mbox Size: 2394 bytes Desc: not available URL: From jgranado at redhat.com Sun Jul 19 10:08:59 2009 From: jgranado at redhat.com (Joel Granados) Date: Sun, 19 Jul 2009 12:08:59 +0200 Subject: [Firstaidkit-devel] [PATCH] Add volume_key plugin In-Reply-To: <1036210009.645661247839704787.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> References: <385367271.645571247839671353.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <1036210009.645661247839704787.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <20090719100859.GA13063@dhcp-lab-171.englab.brq.redhat.com> Miroslav. This is great!! I have a comment about the way you post the patches. Its much better IMO to use the commands provided by git to create and send patches. This will put each patch in a separate email and will give the reviewer context when he is reading your mail. I also think that its much easier (I have to type just two lines). Take a look at http://jgranado.fedorapeople.org/git_scripts/. Those are the scritps that I am currently using to send patches everywhere. Thx again. Regards. On Fri, Jul 17, 2009 at 10:08:24AM -0400, Miloslav Trmac wrote: > Hello, > the attached patches add support for key recovery using volume_key. They depend on question support submitted earlier, and on python-volume_key, which is currently blocked in Fedora review (#508954). The first patch (adding the plugin) can be applied immediately - the plugin will be silently ignored if "import volume_key" fails. The second patch (updating packaging) will have to wait until python-volume_key is available in repositories. > > Thank you, > Mirek > _______________________________________________ > Firstaidkit-devel mailing list > Firstaidkit-devel at redhat.com > https://www.redhat.com/mailman/listinfo/firstaidkit-devel -- Joel Andres Granados Brno, Czech Republic, Red Hat. From mitr at redhat.com Thu Jul 23 23:47:34 2009 From: mitr at redhat.com (Miloslav Trmac) Date: Thu, 23 Jul 2009 19:47:34 -0400 (EDT) Subject: [Firstaidkit-devel] Re: [PATCH] Add volume_key plugin In-Reply-To: <1036210009.645661247839704787.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Message-ID: <736597866.131371248392854179.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Hello, ----- "Miloslav Trmac" wrote: > The second patch (updating packaging) will have to > wait until python-volume_key is available in repositories. volume_key is now built in rawhide. Mirek