# Path: Pyblio/Open.py
# def url_to_local (url):
# def get_by_name (entity, method):
# def get_by_regexp (entity, method):
# def bibopen (entity, how = None):
#     def simple_try (url, how):
# def bibiter (entity, how = None):
#     def simple_try (url, how):
# def bibwrite (iter, out = None, how = None, database=None):
# def bibnew (name, type = None):
# 
# Path: Pyblio/Autoload.py
# class Loader:
#     def __init__ (self, name, regexp, module,
#                   info = None, data = None):
#     def load (self, key = None):
#     def is_loaded (self):
# def preregister (group, name, module, regexp = None, info = None):
# def register (group, name, data = None):
# def get_by_regexp (group, key):
# def get_by_name (group, name, load = 1):
# def available (group):
# def groups ():


import string
import re
from gettext import gettext as _
from xml import sax
from Pyblio import Open, Autoload
class XMLBib (sax.handler.ContentHandler):

    
    def __init__ (self, url):

        # each hash value contains a 2-uplet (opener, closer)
        
        self.format = None
        self.top    = []
        self.data   = []
        self.config = []

        self.methods = {}
        
        fh = open (Open.url_to_local (url))

        parser = sax.make_parser ()
        parser.setFeature (sax.handler.feature_validation, False)
        parser.setContentHandler (self)
        
        parser.parse (fh)
        fh.close ()
        
        return

    def configure (self):
        fmeth = {}
        
        module = None
        for mod in self.config:

# Path: Pyblio/Open.py
# def url_to_local (url):
# def get_by_name (entity, method):
# def get_by_regexp (entity, method):
# def bibopen (entity, how = None):
#     def simple_try (url, how):
# def bibiter (entity, how = None):
#     def simple_try (url, how):
# def bibwrite (iter, out = None, how = None, database=None):
# def bibnew (name, type = None):
# 
# Path: Pyblio/Autoload.py
# class Loader:
#     def __init__ (self, name, regexp, module,
#                   info = None, data = None):
#     def load (self, key = None):
#     def is_loaded (self):
# def preregister (group, name, module, regexp = None, info = None):
# def register (group, name, data = None):
# def get_by_regexp (group, key):
# def get_by_name (group, name, load = 1):
# def available (group):
# def groups ():


# Path: Pyblio/Style/Parser.py
import string
import re
from gettext import gettext as _
from xml import sax
from Pyblio import Open, Autoload

class XMLBib (sax.handler.ContentHandler):

    
    def __init__ (self, url):

        # each hash value contains a 2-uplet (opener, closer)
        
        self.format = None
        self.top    = []
        self.data   = []
        self.config = []

        self.methods = {}
        
        fh = open (Open.url_to_local (url))

        parser = sax.make_parser ()
        parser.setFeature (sax.handler.feature_validation, False)
        parser.setContentHandler (self)
        
        parser.parse (fh)
        fh.close ()
        
        return

    def configure (self):
        fmeth = {}
        
        module = None
        for mod in self.config:

            module = Autoload.get_by_name ('style', mod.module).data