# Path: bibstuff/bibfile.py
# MONTH_DICT = dict( zip(monthmacros_en, months_en) )
# class BibEntry(dict):
# class BibFile( DispatchProcessor ):
# 	def __init__(self,*args,**kwargs):
# 	def __repr__(self):
# 	def __setitem__(self, key, val):
# 	def __getitem__(self, field):  #field is usually a BibTeX field but can be a citekey
# 	def __delitem__(self,key) :
# 	def set_entry_type(self, val):
# 	def get_entry_type(self):
# 	def set_citekey(self, val):
# 	def get_citekey(self):
# 	def get_fields(self):
# 	def set_fields(self, lst):
# 	def search_fields(self, string_or_compiled, field='', ignore_case=True):
# 	def format_names(self, names_formatter):
# 	def get_names(self, entry_formatter=None, try_fields=None):
# 	def make_names(self, entry_formatter=None, try_fields=None):
# 	def format_with(self, entry_formatter):
# 	def __init__(self) :
# 	def get_entrylist(self, citekeys, discard=True):
# 	def get_entry_by_citekey(self, citekey):
# 	def string(self, (tag,start,stop,subtags), buffer ):
# 	def number(self, (tag,start,stop,subtags), buffer ):
# 	def entry_type( self, (tag,start,stop,subtags), buffer ):
# 	def citekey( self, (tag,start,stop,subtags), buffer ):
# 	def name(self, (tag,start,stop,subtags), buffer ):
# 	def field(self, (tag,start,stop,subtags), buffer ):
# 	def entry( self, (tag,start,stop,subtags), buffer ):
# 	def macro( self, (tag,start,stop,subtags), buffer ):
# 	def preamble( self, (tag,start,stop,subtags), buffer ):
# 	def comment_entry( self, (tag,start,stop,subtags), buffer ):
# 	def search_entries(self, string_or_compiled, field='', ignore_case=True):
# 
# Path: bibstuff/bibgrammar.py
# def Parse(src, processor=None) :


import string, sys, re
from simpleparse.parser import Parser
from simpleparse.dispatchprocessor import * 
from bibstuff import bibfile,  bibgrammar
        from optparse import OptionParser
            from optik import OptionParser
    '''Command-line tool.  See jabbrev.py -h for help'''

    input = sys.stdin
    output = sys.stdout
    
    try:
    except (ImportError, AttributeError):
        try:
        except (ImportError, AttributeError):
            print "jabbrev needs python 2.3 or Greg Ward's optik module."
    
    usage = "usage: %prog [options] DATABASE_FILE [ABBREVIATION_FILE] "
    parser = OptionParser(usage=usage, version ="%prog " + __version__)
     
    (options, args) = parser.parse_args()

    if len(args) > 2 :
        print "Too many arguments"
        sys.exit(1)
    try :
        # bibtex file is last argument
        bib = open(args[0]).read()
    except :
        print "No bibtex file found."
        sys.exit(1)
    if len(args) == 2 :
        input = open(args[1])
    else :
        input = sys.stdin.read()
              

# Path: bibstuff/bibfile.py
# MONTH_DICT = dict( zip(monthmacros_en, months_en) )
# class BibEntry(dict):
# class BibFile( DispatchProcessor ):
# 	def __init__(self,*args,**kwargs):
# 	def __repr__(self):
# 	def __setitem__(self, key, val):
# 	def __getitem__(self, field):  #field is usually a BibTeX field but can be a citekey
# 	def __delitem__(self,key) :
# 	def set_entry_type(self, val):
# 	def get_entry_type(self):
# 	def set_citekey(self, val):
# 	def get_citekey(self):
# 	def get_fields(self):
# 	def set_fields(self, lst):
# 	def search_fields(self, string_or_compiled, field='', ignore_case=True):
# 	def format_names(self, names_formatter):
# 	def get_names(self, entry_formatter=None, try_fields=None):
# 	def make_names(self, entry_formatter=None, try_fields=None):
# 	def format_with(self, entry_formatter):
# 	def __init__(self) :
# 	def get_entrylist(self, citekeys, discard=True):
# 	def get_entry_by_citekey(self, citekey):
# 	def string(self, (tag,start,stop,subtags), buffer ):
# 	def number(self, (tag,start,stop,subtags), buffer ):
# 	def entry_type( self, (tag,start,stop,subtags), buffer ):
# 	def citekey( self, (tag,start,stop,subtags), buffer ):
# 	def name(self, (tag,start,stop,subtags), buffer ):
# 	def field(self, (tag,start,stop,subtags), buffer ):
# 	def entry( self, (tag,start,stop,subtags), buffer ):
# 	def macro( self, (tag,start,stop,subtags), buffer ):
# 	def preamble( self, (tag,start,stop,subtags), buffer ):
# 	def comment_entry( self, (tag,start,stop,subtags), buffer ):
# 	def search_entries(self, string_or_compiled, field='', ignore_case=True):
# 
# Path: bibstuff/bibgrammar.py
# def Parse(src, processor=None) :


# Path: scripts/jabbrev.py
import string, sys, re
from simpleparse.parser import Parser
from simpleparse.dispatchprocessor import * 
from bibstuff import bibfile,  bibgrammar
        from optparse import OptionParser
            from optik import OptionParser

    '''Command-line tool.  See jabbrev.py -h for help'''

    input = sys.stdin
    output = sys.stdout
    
    try:
    except (ImportError, AttributeError):
        try:
        except (ImportError, AttributeError):
            print "jabbrev needs python 2.3 or Greg Ward's optik module."
    
    usage = "usage: %prog [options] DATABASE_FILE [ABBREVIATION_FILE] "
    parser = OptionParser(usage=usage, version ="%prog " + __version__)
     
    (options, args) = parser.parse_args()

    if len(args) > 2 :
        print "Too many arguments"
        sys.exit(1)
    try :
        # bibtex file is last argument
        bib = open(args[0]).read()
    except :
        print "No bibtex file found."
        sys.exit(1)
    if len(args) == 2 :
        input = open(args[1])
    else :
        input = sys.stdin.read()
              

    bfile = bibfile.BibFile()