From 29243d39bd54752ac803ced9b7c390969d27cf37 Mon Sep 17 00:00:00 2001 From: Daniel Spitzbart Date: Tue, 28 Feb 2017 01:19:43 +0100 Subject: [PATCH] copy index.php until first one is found, show change date and parent dict link --- plot/php/index.php | 14 ++++++++++++++ plot/python/helpers.py | 12 +++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/plot/php/index.php b/plot/php/index.php index 949baa3..104c286 100644 --- a/plot/php/index.php +++ b/plot/php/index.php @@ -49,6 +49,12 @@

filter

Parent Directory" +?> +
+
+ Last changed: " . date ("F d Y H:i:s.", filemtime($filename)) . "

"; if ($others) print "

Also as ".implode(', ',$others)."

"; print "
"; } @@ -92,6 +99,7 @@ if ($ex != '.txt') array_push($displayed, $other_filename); } } + print "

Last changed: " . date ("F d Y H:i:s.", filemtime($filename)) . "

"; if ($others) print "

Also as ".implode(', ',$others)."

"; print ""; } @@ -118,6 +126,12 @@ ?> +
+Parent Directory" +?> +

a gp production

diff --git a/plot/python/helpers.py b/plot/python/helpers.py index 235fd92..0b6331e 100644 --- a/plot/python/helpers.py +++ b/plot/python/helpers.py @@ -3,6 +3,12 @@ def copyIndexPHP( directory ): ''' Copy index.php to directory ''' index_php = os.path.join( directory, 'index.php' ) - if not os.path.exists( directory ): os.makedirs( directory ) - if not os.path.exists( index_php ): - shutil.copyfile( os.path.expandvars( '$CMSSW_BASE/src/RootTools/plot/php/index.php' ), index_php ) + if not os.path.exists( directory ): os.makedirs( directory ) + if not directory[-1] == '/': directory = directory+'/' + subdirs = directory.split('/') + for i in range(1,len(subdirs)): + p = '/'.join(subdirs[:-i]) + index_php = os.path.join( p, 'index.php' ) + if os.path.exists( index_php ): break + else: + shutil.copyfile( os.path.expandvars( '$CMSSW_BASE/src/RootTools/plot/php/index.php' ), index_php )