File: BibTeX.py

package info (click to toggle)
pybliographer 1.2.12-4squeeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,560 kB
  • ctags: 1,413
  • sloc: python: 9,817; xml: 2,560; sh: 813; makefile: 621
file content (68 lines) | stat: -rw-r--r-- 1,923 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from Pyblio import Config

# ==================================================

Config.define ('bibtex/keep-preamble',
	       """A boolean requesting that a @preamble in the
	       BibTeX file be kept""",
	       Config.Boolean ())

Config.define ('bibtex/strict',
               """ A boolean indicating the strictness of the parsing """,
               Config.Boolean ())

Config.define ('bibtex/macros', """ A dictionnary defining the BibTeX
macros (@String{} macros). Each entry of the dictionnary is a 2-uple :
the first field is the expansion of the macro, the second is a boolean
indicating if this macro definition has to be saved in the .bib files """,
               Config.Dict (Config.String (),
                            Config.Tuple ((Config.String (), Config.Boolean ()))))

Config.define ('bibtex/datefield', """ A hash table linking a `real'
date field to the two bibtex fields that compose it """)

Config.define ('bibtex/months', """ A hash table linking month names to their
values """)

# ==================================================

Config.set ('bibtex/keep-preamble', 1)

Config.set ('bibtex/strict', 0)


Config.set ('bibtex/macros',
            {'jan' : ("January", 0),
             'feb' : ("February", 0),
             'mar' : ("March", 0),
             'apr' : ("April", 0),
             'may' : ("May", 0),
             'jun' : ("June", 0),
             'jul' : ("July", 0),
             'aug' : ("August", 0),
             'sep' : ("September", 0),
             'oct' : ("October", 0),
             'nov' : ("November", 0),
             'dec' : ("December", 0),
             })


Config.set ('bibtex/datefield', {
    'date'  : ('year', 'month'),
    })

Config.set ('bibtex/months', {
    'jan' : 1,
    'feb' : 2,
    'mar' : 3,
    'apr' : 4,
    'may' : 5,
    'jun' : 6,
    'jul' : 7,
    'aug' : 8,
    'sep' : 9,
    'oct' : 10,
    'nov' : 11,
    'dec' : 12,
    })