[Zope-dev] RE: [Zope] xmlrpc calls require string results?

Dan Pierson dan@remote.control.com
Fri, 5 Nov 1999 15:18:27 -0500


OK, now I'm really confused.  You're both right of course, the general case
works, but see the following:

[dan@silver alist]$ python
Python 1.5.2 (#4, Sep 17 1999, 15:44:43)  [GCC egcs-2.91.66 19990314/Linux
(egcs- on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import xmlrpclib
>>> x = xmlrpclib.Server('http://silver.control.com/zope/')
>>> x
<Server proxy for silver.control.com/zope/>
>>> x.control_com.subject_count()
14
>>> x.control_com.subjects_list()
['Applications', 'Business', 'Communications', 'Engineering', 'HMI',
'Information', 'Languages', 'Motion Control', 'News', 'PCs in Automation',
'PLCs', 'Process Control', 'Sensors', 'Software in Automation']
>>> x.control_com.item_count()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "./xmlrpclib.py", line 547, in __call__
    return self.__send(self.__name, args)
  File "./xmlrpclib.py", line 630, in __request
    request
  File "./xmlrpclib.py", line 582, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for silver.control.com/zope/: 404
Not Found>
>>>

Here are the method definitions, all in SquishSite in Squishdot.py:

    def has_subjects(self):     
        ''' returns true if site has subject topics defined'''     
        return len(self.subjects)     
     
    def subject_count(self):     
        ''' gives count of subject topics defined'''     
        return self.has_subjects()     

    def subjects_list(self):     
        ''' lists all subjects '''    
        subjects = self.subjects.keys()    
        subjects.sort()    
        return subjects    

    def item_count(self):     
        return len(self.data)     

Maybe this is just a Squishdot problem, but I can't see any significant
different between subject_count and item_count above, can you?

Dan Pierson, Control Technology Corporation