def printProgress(msg, logname=''): """ If config(Logging.progress) evaluates to True, print which step we are performing @param string msg what to print out """ logg.getLogger(logname).debug(msg) if metaInfo.printProgress: print msg
def printProgress(msg,logname=''): """ If config(Logging.progress) evaluates to True, print which step we are performing @param string msg what to print out """ logg.getLogger(logname).debug(msg) if metaInfo.printProgress: print msg
def pbarInit(prefix, start, end, logname=''): """ Initialize ProgressBar @param string prefix the progress message to pass @param int start start value (usually 0) @param int end max value """ logg.getLogger(logname).debug(prefix) if metaInfo.printProgress: pbar.__init__(prefix, start, end) pbar.draw()
def pbarInit(prefix,start,end,logname=''): """ Initialize ProgressBar @param string prefix the progress message to pass @param int start start value (usually 0) @param int end max value """ logg.getLogger(logname).debug(prefix) if metaInfo.printProgress: pbar.__init__(prefix,start,end) pbar.draw()
""" HyperSQL Javadoc support Copyright 2010 Itzchak Rehberg & IzzySoft """ __revision__ = '$Id$' from .gettext_init import langpath, langs from sys import maxint, argv as pargs from .unittest import testcase_split from iz_tools.typecheck import is_list, nullDict # for ScanJavaDoc, JavaDoc import re, gettext, locale, os from hypercore.logger import logg logger = logg.getLogger('JavaDoc') # Setup gettext support gettext.bindtextdomain('hyperjdoc', langpath) gettext.textdomain('hyperjdoc') lang = gettext.translation('hyperjdoc', langpath, languages=langs, fallback=True) _ = lang.ugettext # Define some more settings JavaDocVars = dict( wiki_url='', ticket_url='', top_level_dir_len=0, javadoc_shortdesc_mode='unit', javadoc_mandatory=False, javadoc_mandatory_objects=['func', 'proc', 'pkg'],
# Setup gettext support import gettext from hypercore.gettext_init import langpath, langs gettext.bindtextdomain('hypersql', langpath) gettext.textdomain('hypersql') lang = gettext.translation('hypersql', langpath, languages=langs, fallback=True) _ = lang.ugettext # Setup logging from hypercore.logger import logg logname = 'SQLStats' logger = logg.getLogger(logname) #------------------------------------------------------------------------------ def generateOutput(outfile): """ Generate Statistics Page @param object outfile file object to write the stats into """ from hypercore.charts import ChartLegend, PieChart pie_rad = 55 pie_offset = 5 bar_wid = 80 bar_hei = 15
# Setup gettext support import gettext from hypercore.gettext_init import langpath, langs gettext.bindtextdomain('hypersql', langpath) gettext.textdomain('hypersql') lang = gettext.translation('hypersql', langpath, languages=langs, fallback=True) _ = lang.ugettext # Setup logging from hypercore.logger import logg logname = 'GenHTML' logger = logg.getLogger('GenHTML') #=====================================================[ directory handling ]=== #------------------------------------------------------------------------------ def CreateDirectories(): """Creates the output directories if needed""" printProgress(_("Creating output subdirectories"), logname) from iz_tools.system import makeRDir makeRDir(metaInfo.htmlDir) # make sure the HTML output dir exists if metaInfo.unittests: makeRDir(metaInfo.unittest_dir) # same for UnitTest XML output #------------------------------------------------------------------------------
if not pfile in confName and os.path.exists(pfile): confName.append(pfile) # If we have any config files, read them! if len(confName) > 0: config.read(confName) elif not metaInfo.cmdOpts.quiet and not metaInfo.cmdOpts.cron and (metaInfo.cmdOpts.progress is None or metaInfo.cmdOpts.progress): print _('No config file found, using defaults.') configRead() confDeps() # Initiate logging if metaInfo.printProgress: from progress import * confLogger() from hypercore.logger import logg logger = logg.getLogger() printProgress(_('HyperSQL v%s initialized') % metaInfo.versionString, logName) logger.debug('ScriptName: '+metaInfo.scriptName) if len(confName) > 0: logger.info(_('Using config file(s) ') + ', '.join(confName)) else: logger.info(_('No config file found, using defaults.')) if config.getBool('Process','whereused_scan_shortrefs'): logger.info(_('where_used shortref scan enabled')) else: logger.info(_('where_used shortref scan disabled')) top_level_directory = metaInfo.topLevelDirectory if not os.path.exists(top_level_directory): logger.critical(_('top_level_directory "%s" does not exist - terminating.') % top_level_directory)
g = depgraph() if g.deps_ok: g.set_graph('a -> b\nb -> c') #g.set_graph(['a -> b','b -> c']) g.make_graph('ab.png','png','Vera') """ # ====================================================[ Imports and Presets ]=== from iz_tools.typecheck import * from iz_tools.system import * from hypercore.gettext_init import langpath, langs from os import sep as os_sep, path as os_path, access as os_access, unlink as os_unlink from tempfile import NamedTemporaryFile from hypercore.logger import logg logger = logg.getLogger("DepGraph") # Setup gettext support import gettext gettext.bindtextdomain("depgraph", langpath) gettext.textdomain("depgraph") lang = gettext.translation("depgraph", langpath, languages=langs, fallback=True) _ = lang.ugettext # =========================================================[ DepGraph class ]=== class depgraph(object): """ Generate dependency graphs using graphviz This requires the graphviz application to be installed
from iz_tools.system import fopen from .commonhtml import MakeHTMLHeader, MakeHTMLFooter from shutil import copy2 # Setup gettext support import gettext from hypercore.gettext_init import langpath, langs gettext.bindtextdomain('hypersql', langpath) gettext.textdomain('hypersql') lang = gettext.translation('hypersql', langpath, languages=langs, fallback=True) _ = lang.ugettext # Setup logging from hypercore.logger import logg logname = 'SQLStats' logger = logg.getLogger(logname) #------------------------------------------------------------------------------ def generateOutput(outfile): """ Generate Statistics Page @param object outfile file object to write the stats into """ from hypercore.charts import ChartLegend,PieChart pie_rad = 55 pie_offset = 5 bar_wid = 80 bar_hei = 15
g = depgraph() if g.deps_ok: g.set_graph('a -> b\nb -> c') #g.set_graph(['a -> b','b -> c']) g.make_graph('ab.png','png','Vera') """ #====================================================[ Imports and Presets ]=== from iz_tools.typecheck import * from iz_tools.system import * from hypercore.gettext_init import langpath, langs from os import sep as os_sep, path as os_path, access as os_access, unlink as os_unlink from tempfile import NamedTemporaryFile from hypercore.logger import logg logger = logg.getLogger('DepGraph') # Setup gettext support import gettext gettext.bindtextdomain('depgraph', langpath) gettext.textdomain('depgraph') lang = gettext.translation('depgraph', langpath, languages=langs, fallback=True) _ = lang.ugettext #=========================================================[ DepGraph class ]=== class depgraph(object): """
from progress import * from iz_tools.system import fopen # Setup gettext support import gettext from hypercore.gettext_init import langpath, langs gettext.bindtextdomain('hypersql', langpath) gettext.textdomain('hypersql') lang = gettext.translation('hypersql', langpath, languages=langs, fallback=True) _ = lang.ugettext # Setup logging from hypercore.logger import logg logname = 'GenHTML' logger = logg.getLogger('GenHTML') #=====================================================[ directory handling ]=== #------------------------------------------------------------------------------ def CreateDirectories(): """Creates the output directories if needed""" printProgress(_("Creating output subdirectories"), logname) from iz_tools.system import makeRDir makeRDir(metaInfo.htmlDir) # make sure the HTML output dir exists if metaInfo.unittests: makeRDir(metaInfo.unittest_dir) # same for UnitTest XML output #------------------------------------------------------------------------------ def purge_html(): """
""" HyperSQL Core helper functions Copyright 2001 El Paso Energy, Inc. All Rights Reserved Copyright 2010 Itzchak Rehberg & IzzySoft """ from __future__ import division ### temporary to verify Python v3 compatibility __revision__ = '$Id$' from locale import format as loc_format, setlocale, LC_NUMERIC from iz_tools.text import * # includes import re # for eatStrings, countEmptyLines, cleanSQL from iz_tools.system import getCallingModule # this module shall not be included in log entries ;) from hypercore.logger import logg logger = logg.getLogger() # Setup gettext support import gettext from .gettext_init import langpath, langs gettext.bindtextdomain('hypersql', langpath) gettext.textdomain('hypersql') lang = gettext.translation('hypersql', langpath, languages=langs, fallback=True) _ = lang.ugettext try: setlocale(LC_NUMERIC, '') except: None def num_format(num, places=0): """ Format a number as a string
""" HyperSQL Javadoc support Copyright 2010 Itzchak Rehberg & IzzySoft """ __revision__ = '$Id$' from .gettext_init import langpath, langs from sys import maxint, argv as pargs from .unittest import testcase_split from iz_tools.typecheck import is_list, nullDict # for ScanJavaDoc, JavaDoc import re, gettext, locale, os from hypercore.logger import logg logger = logg.getLogger('JavaDoc') # Setup gettext support gettext.bindtextdomain('hyperjdoc', langpath) gettext.textdomain('hyperjdoc') lang = gettext.translation('hyperjdoc', langpath, languages=langs, fallback=True) _ = lang.ugettext # Define some more settings JavaDocVars = dict( wiki_url = '', ticket_url = '', top_level_dir_len = 0, javadoc_mandatory = False, verification = False, verification_log = False, author_in_report = False, mandatory_tags = [], otypes = {}, # supported object types