Skip to content

Commit

Permalink
update examples/ccdb_ commands
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansev committed Jul 5, 2024
1 parent 3ee3aa2 commit 3017717
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 17 deletions.
6 changes: 3 additions & 3 deletions examples/ccdb_cpv_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# import alienpy functions
try:
from alienpy.wb_api import retf_print
from alienpy.tools_nowb import PrintDict
from alienpy.tools_nowb import PrintDict, unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import retf_print
from xjalienfs.tools_nowb import PrintDict
from xjalienfs.tools_nowb import PrintDict, unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -40,7 +40,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), str(q["Last-Modified"]), str(q["Valid-Until"]))
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)
4 changes: 3 additions & 1 deletion examples/ccdb_cpv_pedestal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -40,7 +42,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)
6 changes: 3 additions & 3 deletions examples/ccdb_cpv_pedestal_dcs_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# import alienpy functions
try:
from alienpy.wb_api import retf_print
from alienpy.tools_nowb import PrintDict
from alienpy.tools_nowb import PrintDict, unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import retf_print
from xjalienfs.tools_nowb import PrintDict
from xjalienfs.tools_nowb import PrintDict, unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -51,7 +51,7 @@

for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), str(q["Last-Modified"]), str(q["Valid-Until"]))
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))
table_filled = True

if table_filled: console.print(table)
4 changes: 3 additions & 1 deletion examples/ccdb_its_thr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -39,7 +41,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), str(run), str(q["Content-Length"]), str(unixtime2local(q["Last-Modified"])), str(unixtime2local(q["Valid-Until"])))

console = Console()
console.print(table)
4 changes: 3 additions & 1 deletion examples/ccdb_mch_calib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -39,7 +41,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)
4 changes: 3 additions & 1 deletion examples/ccdb_mft_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -39,7 +41,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), str(run), str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)
5 changes: 3 additions & 2 deletions examples/ccdb_mid_calib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -39,7 +41,6 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])

table.add_row(q["path"].replace(common_dir,""), str(run), unixtime2local(q["Content-Length"]), unixtime2local(q["Last-Modified"]), str(q["Valid-Until"]))
console = Console()
console.print(table)
4 changes: 3 additions & 1 deletion examples/ccdb_tpc_laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -39,7 +41,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)
4 changes: 3 additions & 1 deletion examples/ccdb_tpc_pedestal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import PrintDict, retf_print
from alienpy.tools_nowb import unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import PrintDict, retf_print
from xjalienfs.tools_nowb import unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -39,7 +41,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)
6 changes: 3 additions & 3 deletions examples/ccdb_tpc_pulser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# import alienpy functions
try:
from alienpy.wb_api import retf_print
from alienpy.tools_nowb import PrintDict
from alienpy.tools_nowb import PrintDict, unixtime2local
from alienpy.alien import * # nosec PYL-W0614
except Exception:
try:
from xjalienfs.wb_api import retf_print
from xjalienfs.tools_nowb import PrintDict
from xjalienfs.tools_nowb import PrintDict, unixtime2local
from xjalienfs.alien import * # nosec PYL-W0614
except Exception:
print("Can't load alienpy, exiting...")
Expand Down Expand Up @@ -41,7 +41,7 @@
rez = DO_ccdb_query([obj])
for q in rez.ansdict['objects']:
run = q.get("runNumber", '-1')
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), q["Last-Modified"], q["Valid-Until"])
table.add_row(q["path"].replace(common_dir,""), run, str(q["Content-Length"]), unixtime2local(q["Last-Modified"]), unixtime2local(q["Valid-Until"]))

console = Console()
console.print(table)

0 comments on commit 3017717

Please sign in to comment.