From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18335 invoked by alias); 12 Jun 2009 17:43:53 -0000 Received: (qmail 18324 invoked by uid 22791); 12 Jun 2009 17:43:52 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_34,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Jun 2009 17:43:45 +0000 Received: (qmail 22564 invoked from network); 12 Jun 2009 17:43:42 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Jun 2009 17:43:42 -0000 From: Vladimir Prus To: Tom Tromey Subject: Re: Registering pretty-printers Date: Fri, 12 Jun 2009 17:43:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) Cc: gdb@sources.redhat.com References: <200906080310.58102.vladimir@codesourcery.com> <200906111229.04020.vladimir@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200906122143.49143.vladimir@codesourcery.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00126.txt.bz2 On Friday 12 June 2009 Tom Tromey wrote: > I would like to solve the remaining problems. I just don't know how > to do it, in a way that preserves the qualities I care about. What I > care about is, more or less, embedded in what I implemented: make it > super easy for printers to be developed alongside applications and > libraries, and be made available automatically without user > intervention. Probably the cases I have described are too tricky to allow for automatic setup of pretty-printers. E.g. header-only-library case is pretty much impossible to handle. > Vladimir> Therefore, we should make up some conventions how a > Vladimir> pretty-printer can be packaged separately, preferably as a > Vladimir> single file, and how IDE, given name of the file and nothing > Vladimir> else, can enable pretty printing. > > That would be fine by me. > > Vladimir> Say, how about tar.gz, which is unpacked by IDE, whose top-level > Vladimir> directory is added to PYTHONPATH, and which should have top-level > Vladimir> file called init.py, with a function 'init_pretty_printers'? > > I don't see how it is better than the hook file approach we already > have. Your IDE could easily send "python execfile" to load any given > hook file. Defining a function in that file doesn't add anything that > I can see. There are two important points I propose: 1. Having a file at top-level, as opposed in some subdir which name differs. 2. Having a file with fixed name. I am probably wrong, but neither of this is true with the current recommended approach. > It seems to me that you could make a .tar holding all the files from > libstdc++/python, then have your IDE unpack these somewhere, update > sys.path, and execfile the file(s) in the topmost directory. Assuming > these files follow the "None convention", it will work fine. I did not notice any files on top-level. Have I missed something? - Volodya