h = Config.get('base/fields').data for k, v in multi.items(): if not h.has_key(k): continue if v: h[k].widget = Editor.Text else: h[k].widget = Editor.Entry return True Config.define('gnomeui/multiline', """ Fields displayed in a multi-line widget """, Config.Dict(Config.Element(_text_get), Config.Boolean()), hook=_on_multiline_select) # -------------------------------------------------- Config.set('gnomeui/monospaced', gtk.gdk.Font('-*-*-*-r-normal-*-*-*-*-*-c-*-iso8859-1')) h = Config.get('base/fields').data Fields.AuthorGroup.widget = Editor.AuthorGroup Fields.Text.widget = Editor.Entry Fields.URL.widget = Editor.URL Fields.Reference.widget = Editor.Reference Fields.Date.widget = Editor.Date
from Pyblio import Config Config.define('refer/mapping', """ A hash table containing field names correspondances. The boolean flag specifies if the mapping should be reversible. """, vtype=Config.Dict( Config.String(), Config.Tuple((Config.String(), Config.Boolean())))) Config.set( 'refer/mapping', { 'U': ('url', 1), 'A': ('author', 1), 'Q': ('author', 0), 'T': ('title', 1), 'S': ('series', 1), 'J': ('journal', 1), 'B': ('booktitle', 1), 'R': ('type', 1), 'V': ('volume', 1), 'N': ('number', 1), 'E': ('editor', 1), 'D': ('date', 1), 'P': ('pages', 1), 'I': ('publisher', 1), 'C': ('address', 1), 'K': ('keywords', 1), 'X': ('abstract', 1), 'W': ('location', 1), 'F': ('label', 1),
def columns_checker(obj, value, userdata): """Only allow column names that display correctly. Return True if OK.""" ## print '>>>>>>>>>>>>>>>>>>>>', obj, value, userdata return len(value) > 0 Config.define( 'gnome/columns', """ A list of the fields displayed on the main screen of the interface """, Config.List(Config.String())) Config.define( 'gnome/native-as-default', """ Should we edit the entries in their native format by default ? """, Config.Boolean()) Config.define('gnome/searched', """ List of searchable fields """, Config.List(Config.String())) Config.define('gnome/history', """ Size of the history file """, Config.Integer(min=1)) Config.define('gnome/paste-key', """ Paste key instead of entry content """, Config.Boolean()) # -------------------------------------------------- Config.set('gnome/searched', ['Author', 'Title', 'Abstract', 'Date']) Config.set('gnome/native-as-default', 0)
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)
dfl = Config.get('base/defaulttype').data if dfl is None: return 1 value = value[string.lower(dfl.name)] if dfl == value: Config.set('base/defaulttype', value) return 1 Config.define('base/advertise', """ Specify wether or not the program should add a message saying that the output files are generated by pybliographer """, vtype=Config.Boolean()) Config.define('base/autosave', """ Autosave files """, vtype=Config.Boolean()) Config.define( 'base/autosave interval', """ Time in minutes. It specifies the time interval between autosave operations. """, vtype=Config.Integer(min=1)) Config.define('base/backup', """ Create a backup copy of files before saving """, vtype=Config.Boolean()) Config.define('base/directsave', """ Direct save. It is an optional saving method which doesn't break links. WARNING: the risk of data loss is
import string from Pyblio import Config, Fields def _get_text_ent(): return map( lambda x: string.lower(x.name), filter(lambda x: x.type is Fields.Text, Config.get('base/fields').data.values())) Config.define( 'bibtex+/braces', """ A boolean specifying if pybliographic should use braces (instead of quotes) to limit entries """, Config.Boolean()) Config.define('bibtex+/capitalize', """ A flag indicating if pybliographer should handle automatic capitalization in the bibtex output """, vtype=Config.Dict(Config.Element(_get_text_ent), Config.Boolean())) Config.define( 'bibtex+/override', """ A boolean indicating if the macro definitions provided here should override the ones given in a file """, Config.Boolean()) Config.define('bibtex+/dateformat', """ A template used for date formatting """, Config.String())