Skip to content
Snippets Groups Projects
Commit 7b532046 authored by Will Buttinger's avatar Will Buttinger Committed by Graeme Stewart
Browse files

'showReleaseNotes script for future release notes' (PathResolver-00-02-28)

        * PathResolver/selection.xml : added PathResolverSetOutputLevel
        * python/showReleaseNotes.py : simple script to get any release notes for the release
        * Tagging as PathResolver-00-02-28

2016-03-31 Will Buttinger <will@cern.ch>
        * When using from python (e.g. joboptions), PathResolver will auto-start the ApplicationMgr, to get the correct MessageSvc
        * Tagging as PathResolver-00-02-27

2016-03-08 Will Buttinger <will@cern.ch>
        * made default outputlevel of messaging service be info
        * Tagging as PathResolver-00-02-26
parent e4e0fc26
No related branches found
No related tags found
No related merge requests found
# $Id: CMakeLists.txt 725452 2016-02-22 09:43:15Z krasznaa $
# $Id: CMakeLists.txt 740930 2016-04-18 08:46:48Z will $
#
# CMake configuration file for the PathResolver package.
#
......@@ -35,6 +35,9 @@ atlas_add_dictionary( PathResolverDict
# Install files from the package:
atlas_install_python_modules( python/*.py )
# Install showReleaseNotes.py script
#FIXME: TODO
# Set up a helper environment variable for the test(s):
set( _dpath "${CMAKE_CURRENT_SOURCE_DIR}/test" )
set( _dpath "${CMAKE_CURRENT_SOURCE_DIR}/test/B:${_dpath}" )
......
<lcgdict>
<function name="PathResolverFindCalibFile" />
<function name="PathResolverFindCalibDirectory" />
<function name="PathResolverSetOutputLevel" />
</lcgdict>
......@@ -35,6 +35,7 @@ bool PathResolver::m_setLevel=false;
asg::AsgMessaging& PathResolver::asgMsg() {
if(!m_setLevel) setOutputLevel(MSG::INFO);
static asg::AsgMessaging asgMsg("PathResolver");
return asgMsg;
}
......
......@@ -45,6 +45,7 @@ branches python
apply_pattern declare_python_modules files="*.py"
apply_pattern declare_scripts files=" -s=$(PathResolver_root)/python showReleaseNotes.py"
#Next three lines kept for possible future developments
#macro_append pp_cppflags " '-DPACKAGE_NAME=$(q2)$(package)$(q2)' '-DPACKAGE_OFFSET=$(q2)$($(package)_offset)$(q2)' "
......
......@@ -5,10 +5,22 @@
#from PathResolver import PathResolver
#PathResolver.FindCalibFile("blah")
#if working in athena release, we will need to start the ApplicationMgr so that the appropriate MessageSvc is created
try:
#check if Gaudi already started
from GaudiPython.Bindings import _gaudi as GaudiAppMgr
if GaudiAppMgr==None:
print "PathResolver: Starting Gaudi for access to correct instance of MessageSvc"
from GaudiPython import AppMgr
AppMgr() #note this is not the same thing as 'theApp' in joboptions, but 'theApp' will use this
#the line above starts the application mgr, and _gaudi will become set to that
except ImportError:
pass
import cppyy
cppyy.loadDict('libPathResolver')
cppyy.loadDict('libPathResolverDict') #why do we have to load both the library and the dict :-( To be fixed by ROOT...
FindCalibFile = cppyy.gbl.PathResolverFindCalibFile
FindCalibDirectory = cppyy.gbl.PathResolverFindCalibDirectory
SetOutputLevel = cppyy.gbl.PathResolverSetOutputLevel
#!/usr/bin/env python
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# @file showReleaseNotes.py
# @purpose Display important notes/announcments (if any) about the current release
# @author Will Buttinger
# @date April 2016
def main():
import os
#we don't use the 'from PathResolver import PathResolver' because that will force Gaudi ApplicationMgr to display
#Until we have a way to 'silently' start the applicationmgr, we will do it the 'bad' way
import cppyy
cppyy.loadDict('libPathResolver')
cppyy.loadDict('libPathResolverDict')
FindCalibFile = cppyy.gbl.PathResolverFindCalibFile
cppyy.gbl.PathResolverSetOutputLevel(6) #suppress all possible warnings/errors
notesFile = FindCalibFile("dev/ReleaseNotes/%s/%s" % (os.environ['AtlasProject'],os.environ['AtlasVersion']))
if notesFile=="": return 0 #no notes to display
with open(notesFile) as f:
print f.read()
if __name__ == "__main__":
import sys
sys.exit(main())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment