__init__.py :  » Network » Grail-Internet-Browser » grail-0.6 » bookmarks » formats » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Network » Grail Internet Browser 
Grail Internet Browser » grail 0.6 » bookmarks » formats » __init__.py
"""Storage handlers for bookmarks in a variety of formats.

Each module in this package contains a parser or writer for some
concrete storage format.  The module names obey the convention:
<format>_<operator>, where <format> is the `short name' of the format
as returned by bookmark.get_short_name(<long_format>), and <operator>
is either `parser' or `writer'.  Each module must define a single
callable object of the same name as <operator>, but with the first
letter capitalized.

The `Parser' callables must accept a single argument, the filename of
the storage object.  The filename should be used to create error
messages for exceptions as appropriate.  The objects returned by the
callable must be parser objects which offer the methods get_root(),
feed(), and close().  feed() is used to provide data to the parser; it
may be called more than once.  After all data has been provided via
feed(), close() will be called to inform the object that there is no
more data available; any additional parsing or structure-building must
be completed.  The get_root() method should return the root of the
resulting bookmarks tree, which should always be a
bookmarks.node.Folder instance.

The `Writer' callables receive no arguments, but must return an object
which supports a method write_tree().  This method must accept two
arguments: a bookmarks.nodes.Folder instance which is the root of the
bookmarks tree, and a file object to which output should be directed.
This method should output a complete storage object which can later be
parsed by using the parser object defined in the sister module for the
same format.

An additional module, html_scraper, provides a Parser callable that
builds a boookmarks structure from a general HTML file.

"""

__version__ = '$Revision: 1.3 $'
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.