Re: Frozen pyds install

Georg Bauer <gb-BRhJDZTO+/[email protected]> Wed, 17 Mar 2004 23:56:28 +0100
Newsgroups gmane.comp.python.pyds.user
Message-ID <r02010100-1028-538AE704786611D8A517000A9573A72A@[10.0.0.145]>
Hi!

> Saved file?  Like a backup?  I never set up any backups :(  Is there=20
> some other way of getting those out?  I suppose I could find a mk=20
> browser of some sort.

You can just write a short script in Python to pull out the data you
need. Something like:

#!/usr/bin/python

import metakit

db =3D metakit.storage('aggregator.data', 1)
feeds =3D db.view('feeds')

for feed in feeds:
   print feed.url
  =20
  =20
This will print you all feeds you are subscribed too. Adding them to a
new pyds aggregator database can be done with cut-and-paste.

Or you modify the script a bit:

import metakit

dbin =3D metakit.storage('aggregator.data', 1)
dbout =3D metakit.storage('aggregator.new', 1)

# this is one long line
feeds =3D
dbout.getas("feeds[url:S,title:S,link:S,desc:S,author:S,ready:I,message:
S,lastrun:I,parsehook:S,skiphours:S,maxdays:I,maxposts:I,interval:I,
shared:I]").ordered(1)

for feed in db.view('feeds'):
   feeds.append({
      'url':feed.url,
      'title':feed.title,
      .... add all attributes here ....
   })

dbout.commit()

With something like this you will create a new feeds table that has all
your old feeds.

> the file, but it didn't have any problem with the file.  And metakit=20
> says it's supposed to be safe to kill (which I was doing regularly),=20

Yep, killing usually isn't a problem. But it looks like segfaulting is a
problem - I had some breakage with PyDS databases, but usually only when
there were problems that produced segfaults.

bye, Georg