Beispiel #1
0
    return author_desc (entry, coding, 0, 1)

def first_last_full_authors (entry, coding):
    return author_desc (entry, coding, 0, -1)

def full_authors (entry, coding):
    return author_desc (entry, coding, 0, 0)


def initials_authors (entry, coding):
    return author_desc (entry, coding, 1, 0)

def first_last_initials_authors (entry, coding):
    return author_desc (entry, coding, 1, -1)

def last_first_initials_authors (entry, coding):
    return author_desc (entry, coding, 1, 1)

# Line below changed
Autoload.register ('style', 'apa4e', {
    'first_last_full_authors'     : first_last_full_authors,
    'last_first_full_authors'     : last_first_full_authors,
    'full_authors'     : full_authors,
    'first_last_initials_authors' : first_last_initials_authors,
    'last_first_initials_authors' : last_first_initials_authors,
    'initials_authors' : initials_authors,
    'string_keys'      : create_string_key,
    'numeric_keys'     : create_numeric_key,
    'european_date'    : standard_date,
    })
Beispiel #2
0
def initials_authors(entry, coding):
    return author_desc(entry, coding, 1, 0)


def first_last_initials_authors(entry, coding):
    return author_desc(entry, coding, 1, -1)


def last_first_initials_authors(entry, coding):
    return author_desc(entry, coding, 1, 1)


Autoload.register(
    "style",
    "abbrv",
    {
        "first_last_full_authors": first_last_full_authors,
        "last_first_full_authors": last_first_full_authors,
        "full_authors": full_authors,
        "first_last_initials_authors": first_last_initials_authors,
        "last_first_initials_authors": last_first_initials_authors,
        "initials_authors": initials_authors,
        "string_keys": create_string_key,
        "bibdb_keys": create_bibdb_key,
        "authoryear_keys": create_authoryear_key,
        "unsrtnum_keys": create_unsrtnum_key,
        "european_date": standard_date,
    },
)
Beispiel #3
0
    

def opener (url, check):

        base = None
        if (not check) or (url.url [2] [-4:] == '.isi'):
                base = Isifile (url)
        return base


def iterator (url, check):
        ''' This methods returns an iterator that will parse the
        database on the fly (useful for merging or to parse broken
        databases '''

        if check and url.url [2] [-4:] != '.isi': return
        
        return IsifileIterator (open (Open.url_to_local (url), 'r'))

Autoload.register ('format', 'Isifile', {'open': opener,
                                         'write': writer,
                                         'iter': iterator})



### Local Variables:
### Mode: python
### py-master-file : "ut_Isi.py"
### End:

Beispiel #4
0
        pass

    def end_group (self):
        self.out.write ("\n")
        pass

    def start (self, key, entry):
        if key is None: key = self.next_key ()

        text = ('[%s] ' % key)
        self.write (text)
        extra = 16 - len (text)
        if extra > 0:
            self.write (' ' * extra)
        return
    
    def write (self, text, style = None):
        self.out.write (text)
        return

    def separator (self):
        self.write (" ")
        return
    
    def end (self):
        self.write ("\n")
        return
    

Autoload.register ('output', 'raw', TextFormat)
Beispiel #5
0
    def end_group (self):
        self.out.write ("\n")
        pass

    def start (self, key, entry):
        if key is None: key = self.next_key ()
        
        self.data = ""
        self.key  = '[%s] ' % key
	self.key = self.key + "\n" + ' ' * self.length
        return
    
    def write (self, text, style = None):
        self.data = self.data + text
        return

    def separator (self):
        self.write (" ")
        return
    
    def end (self):
        self.data = string.strip (self.data)
        
        text = Utils.format (self.data, 79, self.length, self.length)
        self.out.write (self.key + text [self.length:] + '\n\n')
        return
    

Autoload.register ('output', 'textau', TextFormat)
Beispiel #6
0
            self.out.write ('<i>%s</i>' % text)
        elif style == 'emph':
            self.out.write ('<em>%s</em>' % text)
        else:
            self.out.write (text)

    def start_group (self, id, table = None):
        self.out.write ('<dl>\n')
        return
    
    def end_group (self):
        self.out.write ('</dl>\n')
        self.out.write ('<p align="right"><small>')
        self.out.write ('Generated by Pybliographer')
        self.out.write ('</small></p>\n')
        return

    def start (self, key, entry):
        if key is None: key = self.next_key ()
        
        self.out.write ('<dt>[%s]<dd>' % key)
        return

    def separator (self):
        self.out.write (" ")
        return

    
Autoload.register ('output', 'HTML', HTML)

Beispiel #7
0
                    else:
                        w = w + 1
                        
                if w > l:
                    id = k
                    l  = w
                    
        else:
            id = 'KEY99'
            
        self.out.write ('\\begin{thebibliography}{%s}\n' % id)
        return

    def separator (self):
        self.out.write ('\n\\newblock ')
        return
    
    def end_group (self):
        self.out.write ('\\end{thebibliography}\n')
        return

    def start (self, key, entry):
        if key is None: key = self.next_key ()
        
        self.out.write ('\\bibitem[%s]{%s}\n' % (key, entry.key.key))
        return

    
Autoload.register ('output', 'LaTeX', LaTeX)

Beispiel #8
0
    return base


def iterator (url, check):
    ''' This methods returns an iterator that will parse the
    database on the fly (useful for merging or to parse broken
    databases '''

    if check and url.url [2] [-4:] != '.bib': return None

    # Ouvrir le fichier associe
    parser = _bibtex.open_file (Open.url_to_local (url),
				Config.get ('bibtex/strict').data)

    # create a database to generate correct keys
    db = Base.DataBase (url)

    return BibtexIterator (db, parser)


Autoload.register ('format', 'BibTeX', {'open'  : opener,
					'write' : writer,
					'iter'  : iterator})


### Local Variables:
### Mode: python
### py-master-file : "ut_bibtex.py"
### End:

Beispiel #9
0
    return author_desc(entry, coding, 0, 0)


def initials_authors(entry, coding):
    return author_desc(entry, coding, 1, 0)


def first_last_initials_authors(entry, coding):
    return author_desc(entry, coding, 1, -1)


def last_first_initials_authors(entry, coding):
    return author_desc(entry, coding, 1, 1)


Autoload.register(
    "style",
    "Generic",
    {
        "first_last_full_authors": first_last_full_authors,
        "last_first_full_authors": last_first_full_authors,
        "full_authors": full_authors,
        "first_last_initials_authors": first_last_initials_authors,
        "last_first_initials_authors": last_first_initials_authors,
        "initials_authors": initials_authors,
        "string_keys": create_string_key,
        "numeric_keys": create_numeric_key,
        "european_date": standard_date,
    },
)
Beispiel #10
0
    
    if table.has_key (key):
	suff = ord ('a')
	
        while table.has_key (key):
            suff = suff + 1
            
            if suff > ord ('z'):
                suff = ord ('a')
                base = base + 'a'

            key  = Key.Key (table, base + chr (suff))
            
    return Key.Key (table, key)

Autoload.register ('key', 'Default', generate_key)


class StringStream:
    ''' This class simulates a stream and stores it into a simple
    string. '''

    def __init__ (self):
        self.text = ''
        return

    def write (self, text):
        self.text = self.text + text
        return