[XML-SIG] Patches to adr_parse.py and bookmark.py
Lars Marius Garshol
larsga@ifi.uio.no
24 Nov 1998 18:52:41 +0100
Hi!
I've been playing around a little with XBEL, thinking about making a
demo for a conference I'm going to in a couple of weeks. So far, what
I've done is to modify adr_parse.py to actually work with the latest
version of bookmark.py and to deal with command-line arguments and
also to modify bookmark.py to insert the XBEL public identifier.
Patch 1 (to adr_parse.py):
65c65
< visited=parse_date(readfield(infile,"VISITED"))
---
> parse_date(readfield(infile,"VISITED")) # Just throw this away
69c69
< bms.add_folder(name,created,visited)
---
> bms.add_folder(name,created)
78c78
< bms.add_bookmark(name,created,visited,url)
---
> bms.add_bookmark(name,created,visited,None,url)
87,88c87,106
< bms=parse_adr(r"c:\programfiler\opera\opera3.adr")
< bms.dump_xbel()
---
> import sys
>
> if len(sys.argv)<2 or len(sys.argv)>3:
> print
> print "A simple utility to convert Opera bookmarks to XBEL."
> print
> print "Usage: "
> print " adr_parse.py <adr-file> [<xbel-file>]"
> sys.exit(1)
>
> bms=parse_adr(sys.argv[1])
>
> if len(sys.argv)==3:
> out=open(sys.argv[2],"w")
> bms.dump_xbel(out)
> out.close()
> else:
> bms.dump_xbel()
>
> # Done
Path 2 (to bookmark.py):
42c42
< '<!DOCTYPE xbel SYSTEM "xbel.dtd">\n'
---
> '<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "xbel.dtd">\n'
--Lars M.