Python Community Server: Development

A weblog about programming in Python, C#, Java, Perl and C++ - and the occasional comment on PyCS development
new: discuss community servers on the CommunityServerWiki!

SunMonTueWedThuFriSat
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

[ Sep ] [ Nov ]

the locals
also available in XML
Copyright (c) 2002 Phillip Pearson
spread the dot

2002-10-27

You know you're in trouble when ...

... you upstream a couple of files to your web server and the server process uses 50% of a Pentium III for a couple of seconds.

Problem found:

[www-pycs@www www-pycs]$ python
Python 2.2.2b1 (#4, Oct 16 2002, 02:14:33)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> xmlrpclib.getparser()
(<xmlrpclib.SlowParser instance at 0x818b694>, <xmlrpclib.Unmarshaller instance at 0x815de34>)
>>>

I love that name: SlowParser.  No doubt as to what it does.  Time to go find myself a FastParser.

I thought expat (quite a fast parser) was included in the Python distribution these days.  Apparently not.

Comment on this post [ so far]

RSS feeds now on Weblogs.Com

Hmm, looks like Dave is up to something.  It looks like Weblogs.Com now tracks RSS feed updates as well as weblog updates.

Presumably this ties in with the recent focus on minimising aggregator bandwidth requirements.  If you know a weblog always pings Weblogs.Com when it updates, you only need to download its RSS feed when it appears in www.weblogs.com/rssUpdates/changes.xml.  Cool!

Currently that page is showing a few Radio weblogs and some of the UserLand partners.  Not to be outdone, let's see if we can get some other weblogs on there.  UserLand's software almost exclusively uses the XML-RPC protocol for communication, which means it plays very well with other platforms.  Especially Python, my favourite.

phil@icicle:~$ python
Python 2.2.1 (#1, Sep  7 2002, 14:34:30)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> xmlrpclib.Server( 'http://rpc.weblogs.com/RPC2' ).rssUpdate( 'Testing', 'http://www.myelin.co.nz/bloginterop/rss.xml' )
{'message': 'Thanks for the ping. We checked and found that the "Testing" weblog has changed, so it will appear in <a href="http://www.weblogs.com/changes.xml">changes.xml</a> next time it is updated.', 'flerror': <Boolean False at 819e7cc>}

Oh, very good.  Now let's put this into bzero.  I'm doing this as I type, so with any luck when I post this message, you should see pycs.net/devlog appear in the updates page.  The weather here is shocking right now, meaning that pycs.net will probably just drop off the 'net as soon as I say this, but let's try it anyway.

Update: As expected, DNS trouble meant Weblogs.Com couldn't get back to me. Here's the screenshot to prove that the Python code above worked, though.

Update 2: Python Community Server is now on a new server! That means in a few hours, when Weblog.Com's DNS cache times out, my pings should work again. Also, pycs.net URLs shouldn't just suddenly die like they have been for so long. Stability at last! ;-)

Update 3: It wasn't really as easy as the snippet of Python interaction above might lead you to believe.  More like this - lots of method name guessing that eventually hit on the right one:

phil@icicle:~$ python
Python 2.2.1 (#1, Sep  7 2002, 14:34:30)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> s = xmlrpclib.Server( 'http://rpc.weblogs.com/RPC2' )
>>> s.weblogUpdates.rssPing
[...]
xmlrpclib.Fault: <Fault 7: 'Can\'t evaluate the expression because the name "rssPing" hasn\'t been defined.'>
>>> s.rssUpdates.ping
[...]
xmlrpclib.Fault: <Fault 7: 'Can\'t evaluate the expression because the name "rssUpdates" hasn\'t been defined.'>
>>> s.rssUpdates
[...]
xmlrpclib.Fault: <Fault 7: 'Can\'t evaluate the expression because the name "rssUpdates" hasn\'t been defined.'>
>>> s.rssUpdate
[...]
xmlrpclib.Fault: <Fault 7: 'Can\'t find a sub-table named "rssUpdate".'>
>>> s.rssUpdate()
[...]
xmlrpclib.Fault: <Fault 4: 'Can\'t call "rssUpdate" because there aren\'t enough parameters.'>
>>> s.rssUpdate( 'foo', 'http://www.foo.com/' )
{'message': 'Thanks for the ping. We checked and found that the "foo" weblog has not changed, so it has not been added to changes.xml.', 'flerror': <Boolean False at 819e874>}

Comment on this post [ so far]