ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
Re: [pyxpcom] pyxpcom Digest, Vol 25, Issue 1
by Davi Ramos other posts by this author
Dec 1 2008 6:46PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] Using document from PyShell | Re: [pyxpcom] pyxpcom Digest, Vol 25, Issue 1
Do I need to apply both patches listed on bug #345551? I just applied the
first patch and them the second. The second patch didn't succeeded:

patching file extensions/python/xpcom/server/loader.py
Hunk #1 FAILED at 45.
1 out of 1 hunk FAILED -- saving rejects to file
extensions/python/xpcom/server/loader.py.rej

Thanks!

On Mon, Dec 1, 2008 at 5:00 PM, <pyxpcom-request@[...].com> wrote:

>  Send pyxpcom mailing list submissions to
>         pyxpcom@[...].com
> 
>  To subscribe or unsubscribe via the World Wide Web, visit
>         http://listserv.ActiveState.com/mailman/listinfo/pyxpcom
>  or, via email, send a message with subject or body 'help' to
>         pyxpcom-request@[...].com
> 
>  You can reach the person managing the list at
>         pyxpcom-owner@[...].com
> 
>  When replying, please edit your Subject line so it is more specific
>  than "Re: Contents of pyxpcom digest..."
> 
> 
>  Today's Topics:
> 
>    1. Using (object) on the component's declaration (Arthur Gouveia)
>    2. Re: Using (object) on the component's declaration
>       (Philip Semanchuk)
>    3. Re: Using (object) on the component's declaration (Todd Whiteman)
> 
> 
>  ----------------------------------------------------------------------
> 
>  Message: 1
>  Date: Mon, 1 Dec 2008 10:58:53 -0300
>  From: "Arthur Gouveia" <arthur.gouveia@[...].com>
>  Subject: [pyxpcom] Using (object) on the component's declaration
>  To: pyxpcom@[...].com
>  Message-ID:
>         <33fda3d90812010558m76bd7879t73833bf8aa02eae4@[...].com>
>  Content-Type: text/plain; charset="utf-8"
> 
>  Hi folks!
> 
>  I?m trying to make a PytXPCOM + XUL  + Storm(ORM) app.
> 
>  The problem I?m having is that when I declare a component (Python Class)
>  without using (object), the PyXPCOM registers it just fine, but when I use
>  (object), or when I say the class inherits from a class that inhetis
>  object,
>  on my Class declaration, the pyxpcom doesn't register it.
> 
>  *I need to use the (object) on my component because Storm throws an __mro__
>  Error if I don?t, when doing a select on my DB.*
> 
>  What's happening? Anyone here saw this before and came up with a solution?
>  What is the problem on using (object) on pyxpcom components?
> 
> 
>  This code doesn?t register prCustomer (or customer), but if I declare
>  "prCustomer:", it registers just fine.
> 
>  *# -*- coding: UTF-8 -*-
>  # vim: set ts=4 sw=4 :
> 
>  from xpcom import components
> 
>  class Customer(object):
>         pass
> 
>  class prCustomer(Customer):
>         _com_interfaces_ = components.interfaces.prICustomerService
>         _reg_clsid_ = "{aac45fb0-9ead-11dd-ad8b-0800200c9a66}"
>         _reg_contractid_ = "@taturana.net/testes/customer;1"
> 
>         def add(self, cust):
>               pass
>  *
> 
> 
>  --
>  Arthur Gouveia.
>  Bacharelando em Ci?ncias da Computa??o - Unip?
>  http://arthurgouveia.com
> 
>  "De nihilo nihilum."
>  -------------- next part --------------
>  An HTML attachment was scrubbed...
>  URL:
>  http://listserv.ActiveState.com/pipermail/pyxpcom/attachments/20081201/776e1a39/attachment
-0001.html
> 
>  ------------------------------
> 
>  Message: 2
>  Date: Mon, 1 Dec 2008 09:46:30 -0500
>  From: Philip Semanchuk <philip@[...].com>
>  Subject: Re: [pyxpcom] Using (object) on the component's declaration
>  To: pyxpcom@[...].com, Arthur Gouveia
>         <arthur.gouveia@[...].com>
>  Message-ID: <30F67B92-AC90-4AD5-8CA7-E95D28CE3949@[...].com>
>  Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
> 
> 
>  On Dec 1, 2008, at 8:58 AM, Arthur Gouveia wrote:
> 
>  > Hi folks!
>  >
>  > I?m trying to make a PytXPCOM + XUL  + Storm(ORM) app.
>  >
>  > The problem I?m having is that when I declare a component (Python
>  > Class)
>  > without using (object), the PyXPCOM registers it just fine, but when
>  > I use
>  > (object), or when I say the class inherits from a class that inhetis
>  > object,
>  > on my Class declaration, the pyxpcom doesn't register it.
>  >
>  >
>  > *I need to use the (object) on my component because Storm throws an
>  > __mro__
>  > Error if I don?t, when doing a select on my DB.*
>  >
>  > What's happening? Anyone here saw this before and came up with a
>  > solution?
>  > What is the problem on using (object) on pyxpcom components?
> 
>  Hi Arthur,
>  You diagnosed this correctly. PyXPCOM components must be "old-style"
>  classes; i.e. they cannot inherit from object. As you said, the
>  symptom is that one's class is simply not registered. I remember that
>  this took me a long time to debug.
> 
>  I don't know why this limitation exists, but I guess it is due to some
>  of the assumptions made in the PyXPCOM code.
> 
>  I don't know of a workaround except to restructure one's code.
> 
>  Good luck
>  Philip
> 
> 
> 
>  >
>  >
>  >
>  > This code doesn?t register prCustomer (or customer), but if I declare
>  > "prCustomer:", it registers just fine.
>  >
>  > *# -*- coding: UTF-8 -*-
>  > # vim: set ts=4 sw=4 :
>  >
>  > from xpcom import components
>  >
>  > class Customer(object):
>  >        pass
>  >
>  > class prCustomer(Customer):
>  >        _com_interfaces_ = components.interfaces.prICustomerService
>  >        _reg_clsid_ = "{aac45fb0-9ead-11dd-ad8b-0800200c9a66}"
>  >        _reg_contractid_ = "@taturana.net/testes/customer;1"
>  >
>  >        def add(self, cust):
>  >              pass
>  > *
>  >
>  >
>  > --
>  > Arthur Gouveia.
>  > Bacharelando em Ci?ncias da Computa??o - Unip?
>  > http://arthurgouveia.com
>  >
>  > "De nihilo nihilum."
>  > _______________________________________________
>  > pyxpcom mailing list
>  > pyxpcom@[...].com
>  > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 
> 
>  ------------------------------
> 
>  Message: 3
>  Date: Mon, 01 Dec 2008 10:39:25 -0800
>  From: Todd Whiteman <toddw@[...].com>
>  Subject: Re: [pyxpcom] Using (object) on the component's declaration
>  To: Philip Semanchuk <philip@[...].com>
>  Cc: pyxpcom@[...].com
>  Message-ID: <49342F5D.4000100@[...].com>
>  Content-Type: text/plain; charset=UTF-8; format=flowed
> 
>  Philip Semanchuk wrote:
>  > On Dec 1, 2008, at 8:58 AM, Arthur Gouveia wrote:
>  >
>  >> Hi folks!
>  >>
>  >> I?m trying to make a PytXPCOM + XUL  + Storm(ORM) app.
>  >>
>  >> The problem I?m having is that when I declare a component (Python
>  >> Class)
>  >> without using (object), the PyXPCOM registers it just fine, but when
>  >> I use
>  >> (object), or when I say the class inherits from a class that inhetis
>  >> object,
>  >> on my Class declaration, the pyxpcom doesn't register it.
>  >
>  > You diagnosed this correctly. PyXPCOM components must be "old-style"
>  > classes; i.e. they cannot inherit from object. As you said, the
>  > symptom is that one's class is simply not registered. I remember that
>  > this took me a long time to debug.
> 
>  Hi Philip,
> 
>  Yes, this is logged as the following PyXPCOM bug:
>  https://bugzilla.mozilla.org/show_bug.cgi?id=345551
> 
>  There is a patch in this bug report that provides new style class
>  support for PyXPCOM.
> 
>  Komodo has been using this patch for a number of years now, and I also
>  include this patch in the PythonExt (prebuilt PyXPCOM) builds.
> 
>  Cheers,
>  Todd
> 
> 
> 
>  ------------------------------
> 
>  _______________________________________________
>  pyxpcom mailing list
>  pyxpcom@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
>  End of pyxpcom Digest, Vol 25, Issue 1
>  **************************************
> 



-- 
Davi R. Tavares
Thread:
Davi Ramos
Todd Whiteman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved