Package Pyblio
[hide private]
[frames] | no frames]

Source Code for Package Pyblio

 1  """ 
 2  A framework for manipulating bibliographic databases. 
 3   
 4  Definitions 
 5  =========== 
 6   
 7  A database is a set of L{Records <Pyblio.Store.Record>}, which 
 8  contains B{typed} L{Attributes <Pyblio.Attribute>}. The definition of 
 9  the available attributes is done in a L{Schema <Pyblio.Schema>}, which 
10  provides names, types and textual description of the fields. 
11   
12  Getting started 
13  =============== 
14   
15  To create, open and start filling a databases, check the 
16  L{Pyblio.Store} module. 
17   
18  """ 
19   
20  import logging 
21   
22  numeric_version= (1,3,4) 
23  version = '.'.join(str(x) for x in numeric_version) 
24   
25  _inited = False 
26   
27 -def init_logging(filename=None):
28 global _inited 29 if _inited: 30 return 31 _inited = True 32 33 _base = logging.getLogger('pyblio') 34 if filename is None: 35 log_handler = logging.StreamHandler() 36 else: 37 from logging.handlers import RotatingFileHandler 38 log_handler = RotatingFileHandler(filename, maxBytes=10 * 2**20, 39 backupCount=5) 40 41 _fmtr = logging.Formatter('%(name)s(%(filename)s) [%(levelname)s]: %(message)s') 42 log_handler.setFormatter(_fmtr) 43 44 _base.addHandler(log_handler) 45 _base.info("logger started")
46