/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Classes | Functions | Variables
DybPython::dbaux Namespace Reference

Classes

class  Aux

Functions

def args_
def db_
def main

Variables

tuple log = logging.getLogger('DybPython')
tuple pathx = lambda_:os.path.expanduser(os.path.expandvars(_))

Function Documentation

def DybPython::dbaux::args_ ( )

Definition at line 202 of file dbaux.py.

00203            :
00204     ap = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
00205     ap.add_argument("-l","--loglevel",   help="logging level INFO, DEBUG, WARN,... Default %(default)s ")
00206     ap.add_argument(     "--logformat",  help="Used by logger. Default %(default)s ") 
00207     ap.add_argument(     "--logpath",    help="Path to write log file to. Default %(default)s ") 
00208     ap.add_argument("-b","--baseurl",    help="base url of SVN repository. Default %(default)s ")
00209     ap.add_argument("-w","--workingcopy",help="working copy of SVN repository to svn up etc.. Default %(default)s ")
00210     ap.add_argument("-a","--author",     help="select revisions to be from this author. Default %(default)s ")
00211     ap.add_argument(     "--limit",      help="limit the maximum number of revisions to avoid slow queries. Default %(default)s ")
00212     ap.add_argument(     "--dbconf",     help="DB to compare against or load into. Default %(default)s ") 
00213     ap.add_argument(     "--sleep",      help="Seconds to sleep between revisions, eliminating the remote possibility of subsecond fastforwarding time clashes. Default %(default)s ") 
00214     #
00215     ap.add_argument( "action",           help="Action to perform eg ls, rcmpcat, rloadcat  ") 
00216     ap.add_argument( "revs",             help="String representation of revision or contiguous revision ranges, eg 4913:4932 or 4913") 
00217     # 
00218     ap.add_argument("-r","--reset",       action="store_true",  help="reset SVN working copy to precisely the revision by deletion of directory prior to update ")
00219     ap.add_argument("-c","--cachesvnlog", action="store_true",  help="cache the SVN log as an xml file for speed, when you know the log for a revision or revision range is unchanging ")
00220 
00221     # vestigial option was never acted upon, fast forward commands are done manually, as noted above
00222     #ap.add_argument("-f","--ffcommit",    action="store_true",  help="perform commits of the fastforward modified INSERTDATE catalogs. Default %(default)s ")
00223 
00224     ap.set_defaults( 
00225       loglevel="info",
00226       baseurl="http://dayabay.ihep.ac.cn/svn/dybaux" ,
00227       workingcopy="~/dybaux/catalog/tmp_offline_db",
00228       dbconf="tmp_offline_db",
00229       author=None,
00230       sleep=3, 
00231       limit=50,
00232       reset=False,
00233       cachesvnlog=False,
00234       logformat='%(asctime)s %(name)s %(levelname)-8s %(message)s',
00235       logpath=None,   
00236     )
00237 
00238     args = ap.parse_args()
00239     urlleaf = os.path.basename(args.baseurl)
00240     assert urlleaf == 'dybaux', "leaf of baseurl is now restricted to be dybaux for simplicity" 
00241 
00242     loglevel = getattr( logging , args.loglevel.upper() )
00243     log.setLevel(loglevel) 
00244 
00245     sh = logging.StreamHandler() 
00246     sh.setLevel(loglevel) 
00247     fmtr = logging.Formatter(args.logformat)
00248     sh.setFormatter(fmtr)
00249     log.addHandler(sh)        
00250 
00251     if args.logpath:
00252         fh = logging.FileHandler(args.logpath,mode="w")
00253         fh.setFormatter(fmtr)
00254         fh.setLevel(loglevel) 
00255         log.addHandler(fh)
00256 
00257     return args 

def DybPython::dbaux::db_ (   args)
programmatic use of db.py, to avoid logging confusion (double logging/missed logging/fmt differences):
   
#.  `--nolog` avoids a clash of loggers
#. logger name of `dbaux.py` is chosen to be 'DybPython' to hierachically contain 'DybPython.db'

Definition at line 258 of file dbaux.py.

00259              :
00260     """
00261     programmatic use of db.py, to avoid logging confusion (double logging/missed logging/fmt differences):
00262        
00263     #.  `--nolog` avoids a clash of loggers
00264     #. logger name of `dbaux.py` is chosen to be 'DybPython' to hierachically contain 'DybPython.db'
00265 
00266     """
00267     from DybPython.db import main 
00268     dbconf = args.dbconf
00269     cmdline = 'db.py --noconfirm --nolog  %(dbconf)s noop' % locals()  
00270     sys.argv = cmdline.split()
00271     return main()                  

def DybPython::dbaux::main ( )

Definition at line 442 of file dbaux.py.

00443           :
00444     args = args_()
00445     aux = Aux(args)
00446     aux()


Variable Documentation

tuple DybPython::dbaux::log = logging.getLogger('DybPython')

Definition at line 197 of file dbaux.py.

tuple DybPython::dbaux::pathx = lambda_:os.path.expanduser(os.path.expandvars(_))

Definition at line 199 of file dbaux.py.

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:40 for DybPython by doxygen 1.7.4