Changeset 2850
- Timestamp:
- 05/12/16 16:49:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py
r2524 r2850 75 75 # Then extract script date 76 76 for ligne in filein: 77 if project["name"] in ligne: 77 if "Accounting" in ligne and \ 78 project["name"] in ligne: 78 79 today = ligne.split()[-1] 79 80 today = string_to_date(today) … … 82 83 break 83 84 84 # Skip next two lines : first is blank and second is login titles 85 for _ in xrange(1): 86 next(filein) 87 88 # Login list, until blank line 89 for ligne in filein: 90 if not ligne.strip(): 91 break 92 login, conso = ligne.split() 85 # Skip until we find login title line 86 for ligne in filein: 87 if "Login" in ligne: 88 if "Account" in ligne: 89 fg_account = True 90 else: 91 fg_account = False 92 break 93 94 # Login list, until Subtotal or blank line 95 for ligne in filein: 96 if not ligne.strip() or \ 97 "Subtotal" in ligne: 98 break 99 if fg_account: 100 login, account, conso = ligne.split() 101 else: 102 login, conso = ligne.split() 93 103 logins[login] = float(conso) 94 104 … … 137 147 138 148 ######################################## 139 def write_bilan(filename, today, total, ureal, utheo, 140 run_mean, pen_mean, run_std, pen_std): 149 def write_bilan( 150 filename, today, total, ureal, utheo, 151 runp_mean, penp_mean, runp_std, penp_std, 152 runf_mean, penf_mean, runf_std, penf_std 153 ): 141 154 """ 142 155 Conso totale par jour … … 146 159 """ 147 160 148 fmt_str = "{:10s} {:12s} {:11s} {:11s} {:13s} {:13s} {:13s} {:13s}\n" 161 fmt_str = ( 162 "{:10s} {:12s} {:11s} {:11s} " 163 "{:14s} {:14s} {:14s} {:14s} " 164 "{:14s} {:14s} {:14s} {:14s} " 165 "\n" 166 ) 149 167 150 168 title_str = fmt_str.format( … … 153 171 "real_use(%)", 154 172 "theo_use(%)", 155 "running(core)", 156 "pending(core)", 157 "run_std(core)", 158 "pen_std(core)", 173 "runningP(core)", 174 "pendingP(core)", 175 "run_stdP(core)", 176 "pen_stdP(core)", 177 "runningF(core)", 178 "pendingF(core)", 179 "run_stdF(core)", 180 "pen_stdF(core)", 159 181 ) 160 182 161 183 fmt_str = ( 162 184 "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f} " 163 "{:13.2f} {:13.2f} {:13.2f} {:13.2f}\n" 185 "{:14.2f} {:14.2f} {:14.2f} {:14.2f} " 186 "{:14.2f} {:14.2f} {:14.2f} {:14.2f} " 187 "\n" 164 188 ) 165 189 … … 169 193 ureal, 170 194 utheo, 171 run_mean, 172 pen_mean, 173 run_std, 174 pen_std, 195 runp_mean, 196 penp_mean, 197 runp_std, 198 penp_std, 199 runf_mean, 200 penf_mean, 201 runf_std, 202 penf_std, 175 203 ) 176 204 … … 434 462 run_std, 435 463 pen_std, 464 runf_mean, 465 penf_mean, 466 runf_std, 467 penf_std, 436 468 ) 437 469
Note: See TracChangeset
for help on using the changeset viewer.