wums 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wums/Templates/index.php +131 -0
- wums/output_tools.py +7 -8
- {wums-0.1.3.dist-info → wums-0.1.4.dist-info}/METADATA +1 -1
- {wums-0.1.3.dist-info → wums-0.1.4.dist-info}/RECORD +6 -5
- {wums-0.1.3.dist-info → wums-0.1.4.dist-info}/WHEEL +0 -0
- {wums-0.1.3.dist-info → wums-0.1.4.dist-info}/top_level.txt +0 -0
wums/Templates/index.php
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title><?php echo getcwd(); ?></title>
|
|
4
|
+
<style type='text/css'>
|
|
5
|
+
body {
|
|
6
|
+
font-family: "Candara", sans-serif;
|
|
7
|
+
font-size: 9pt;
|
|
8
|
+
line-height: 10.5pt;
|
|
9
|
+
}
|
|
10
|
+
div.pic h3 {
|
|
11
|
+
font-size: 11pt;
|
|
12
|
+
margin: 0.5em 1em 0.2em 1em;
|
|
13
|
+
}
|
|
14
|
+
div.pic p {
|
|
15
|
+
font-size: 11pt;
|
|
16
|
+
margin: 0.2em 1em 0.1em 1em;
|
|
17
|
+
}
|
|
18
|
+
div.pic {
|
|
19
|
+
display: block;
|
|
20
|
+
float: left;
|
|
21
|
+
background-color: white;
|
|
22
|
+
border: 1px solid #ccc;
|
|
23
|
+
padding: 2px;
|
|
24
|
+
text-align: center;
|
|
25
|
+
margin: 2px 10px 10px 2px;
|
|
26
|
+
-moz-box-shadow: 7px 5px 5px rgb(80,80,80); /* Firefox 3.5 */
|
|
27
|
+
-webkit-box-shadow: 7px 5px 5px rgb(80,80,80); /* Chrome, Safari */
|
|
28
|
+
box-shadow: 7px 5px 5px rgb(80,80,80); /* New browsers */
|
|
29
|
+
width: 320px;
|
|
30
|
+
}
|
|
31
|
+
a { text-decoration: none; color: rgb(80,0,0); }
|
|
32
|
+
a:hover { text-decoration: underline; color: rgb(255,80,80); }
|
|
33
|
+
div.dirlinks h2 { margin-bottom: 4pt; margin-left: -24pt; color: rgb(80,0,0); }
|
|
34
|
+
div.dirlinks { margin: 0 24pt; }
|
|
35
|
+
div.dirlinks a {
|
|
36
|
+
font-size: 11pt; font-weight: bold;
|
|
37
|
+
padding: 0 0.5em;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
<h1><?php echo getcwd(); ?></h1>
|
|
43
|
+
<?php
|
|
44
|
+
$has_subs = true;
|
|
45
|
+
foreach (glob("*") as $filename) {
|
|
46
|
+
if (is_dir($filename) && !preg_match("/^\..*|.*private.*/", $filename)) {
|
|
47
|
+
$has_subs = true;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if ($has_subs) {
|
|
52
|
+
print "<div class=\"dirlinks\">\n";
|
|
53
|
+
print "<h2>Directories</h2>\n";
|
|
54
|
+
print "<a href=\"../\">[parent]</a> ";
|
|
55
|
+
foreach (glob("*") as $filename) {
|
|
56
|
+
if (is_dir($filename) && ($_SERVER['PHP_AUTH_USER'] == 'gpetrucc' || !preg_match("/^\..*|.*private.*/", $filename))) {
|
|
57
|
+
print " <a href=\"$filename\">[$filename]</a>";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
print "</div>";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
foreach (array("00_README.txt", "README.txt", "readme.txt") as $readme) {
|
|
64
|
+
if (file_exists($readme)) {
|
|
65
|
+
print "<pre class='readme'>\n"; readfile($readme); print "</pre>";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
?>
|
|
69
|
+
|
|
70
|
+
<h2><a name="plots">Plots</a></h2>
|
|
71
|
+
<p><form>Filter: <input type="text" name="match" size="30" value="<?php if (isset($_GET['match'])) print htmlspecialchars($_GET['match']); ?>" /><input type="Submit" value="Go" /><input type="checkbox" name="regexp" <?php if ($_GET['regexp']) print "checked=\"checked\""?> >RegExp</input></form></p>
|
|
72
|
+
<div>
|
|
73
|
+
<?php
|
|
74
|
+
$displayed = array();
|
|
75
|
+
if ($_GET['noplots']) {
|
|
76
|
+
print "Plots will not be displayed.\n";
|
|
77
|
+
} else {
|
|
78
|
+
$other_exts = array('.pdf', '.cxx', '.eps', '.root', '.txt', '.log', '.dir', '.info', '.latex', '.html');
|
|
79
|
+
$filenames = glob("*.png"); sort($filenames);
|
|
80
|
+
foreach ($filenames as $filename) {
|
|
81
|
+
if (isset($_GET['match'])) {
|
|
82
|
+
if (isset($_GET['regexp']) && $_GET['regexp']) {
|
|
83
|
+
if (!preg_match('/.*'.$_GET['match'].'.*/', $filename)) continue;
|
|
84
|
+
} else {
|
|
85
|
+
if (!fnmatch('*'.$_GET['match'].'*', $filename)) continue;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
array_push($displayed, $filename);
|
|
89
|
+
$brfname = str_replace("_","_­",$filename);
|
|
90
|
+
print "<div class='pic'>\n";
|
|
91
|
+
print "<h3><a href=\"$filename\">$brfname</a></h3>";
|
|
92
|
+
print "<a href=\"$filename\"><img src=\"$filename\" style=\"border: none; width: 300px; \"></a>";
|
|
93
|
+
$others = array();
|
|
94
|
+
foreach ($other_exts as $ex) {
|
|
95
|
+
$other_filename = str_replace('.png', $ex, $filename);
|
|
96
|
+
if (file_exists($other_filename)) {
|
|
97
|
+
array_push($others, "<a class=\"file\" href=\"$other_filename\">[" . $ex . "]</a>");
|
|
98
|
+
if ($ex != '.txt') array_push($displayed, $other_filename);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if ($others) print "<p>Also as ".implode(', ',$others)."</p>";
|
|
102
|
+
print "</div>";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
?>
|
|
106
|
+
</div>
|
|
107
|
+
<div style="display: block; clear:both;">
|
|
108
|
+
<h2><a name="files">Other files</a></h2>
|
|
109
|
+
<ul>
|
|
110
|
+
<?php
|
|
111
|
+
foreach (glob("*") as $filename) {
|
|
112
|
+
if ($_GET['noplots'] || !in_array($filename, $displayed)) {
|
|
113
|
+
if (isset($_GET['match'])) {
|
|
114
|
+
if (isset($_GET['regexp']) && $_GET['regexp']) {
|
|
115
|
+
if (!preg_match('/.*'.$_GET['match'].'.*/', $filename)) continue;
|
|
116
|
+
} else {
|
|
117
|
+
if (!fnmatch('*'.$_GET['match'].'*', $filename)) continue;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (is_dir($filename)) {
|
|
121
|
+
print "<li>[DIR] <a href=\"$filename\">$filename</a></li>";
|
|
122
|
+
} else {
|
|
123
|
+
print "<li><a href=\"$filename\">$filename</a></li>";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
?>
|
|
128
|
+
</ul>
|
|
129
|
+
</div>
|
|
130
|
+
</body>
|
|
131
|
+
</html>
|
wums/output_tools.py
CHANGED
|
@@ -5,6 +5,7 @@ import pathlib
|
|
|
5
5
|
import pickle
|
|
6
6
|
import re
|
|
7
7
|
import shutil
|
|
8
|
+
import importlib.resources as pkg_resources
|
|
8
9
|
import subprocess
|
|
9
10
|
import sys
|
|
10
11
|
import tempfile
|
|
@@ -185,19 +186,17 @@ def write_logfile(
|
|
|
185
186
|
logf.write(f"{k}: {v}\n")
|
|
186
187
|
|
|
187
188
|
|
|
188
|
-
def write_indexfile(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
):
|
|
193
|
-
shutil.copyfile(f"{template_dir}/{indexname}", f"{outpath}/index.php")
|
|
189
|
+
def write_indexfile(outpath, template_dir="Templates", indexname="index.php"):
|
|
190
|
+
with pkg_resources.files("wums").joinpath(f"{template_dir}/{indexname}").open("rb") as src:
|
|
191
|
+
with open(f"{outpath}/index.php", "wb") as dst:
|
|
192
|
+
shutil.copyfileobj(src, dst)
|
|
194
193
|
|
|
195
194
|
|
|
196
195
|
def write_index_and_log(
|
|
197
196
|
outpath,
|
|
198
197
|
logname,
|
|
199
|
-
template_dir=
|
|
200
|
-
analysis_meta_info=
|
|
198
|
+
template_dir="Templates",
|
|
199
|
+
analysis_meta_info={},
|
|
201
200
|
args={},
|
|
202
201
|
wd=f"{pathlib.Path(__file__).parent}/../",
|
|
203
202
|
):
|
|
@@ -2,9 +2,10 @@ wums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
wums/boostHistHelpers.py,sha256=F4SwQEVjNObFscfs0qrJEyOHYNKqUCmusW8HIF1o-0c,38993
|
|
3
3
|
wums/ioutils.py,sha256=1o4cNXeoOzk8Hy0RePjOdCqpvJi0gOp_aa7NYhjmIVM,12209
|
|
4
4
|
wums/logging.py,sha256=zNnLVJUwG3HMvr9NeXmiheX07VmsnSt8cQ6R4q4XBk4,4534
|
|
5
|
-
wums/output_tools.py,sha256=
|
|
5
|
+
wums/output_tools.py,sha256=SHcZqXAdqL9AkA57UF0b-R-U4u7rzDgL8Def4E-ulW0,6713
|
|
6
6
|
wums/plot_tools.py,sha256=67ZwcjQRsIbMYvktpG9suj-1hkya-QSuFqiuXm_Zq58,52766
|
|
7
|
-
wums
|
|
8
|
-
wums-0.1.
|
|
9
|
-
wums-0.1.
|
|
10
|
-
wums-0.1.
|
|
7
|
+
wums/Templates/index.php,sha256=9EYmfc0ltMqr5oOdA4_BVIHdSbef5aA0ORoRZBEADVw,4348
|
|
8
|
+
wums-0.1.4.dist-info/METADATA,sha256=sK9B_JHD9dqzwjJakYGWdoTEPlExmJ1P2lWOaAwDgWY,843
|
|
9
|
+
wums-0.1.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
+
wums-0.1.4.dist-info/top_level.txt,sha256=DCE1TVg7ySraosR3kYZkLIZ2w1Pwk2pVTdkqx6E-yRY,5
|
|
11
|
+
wums-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|