rcdb 2.3.0__tar.gz → 2.3.1__tar.gz

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.
Files changed (222) hide show
  1. {rcdb-2.3.0/rcdb.egg-info → rcdb-2.3.1}/PKG-INFO +5 -4
  2. {rcdb-2.3.0 → rcdb-2.3.1}/README.md +4 -3
  3. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/app.py +16 -1
  4. rcdb-2.3.1/rcdb/cli/file.py +333 -0
  5. rcdb-2.3.1/rcdb/cli/run.py +84 -0
  6. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/version.py +1 -1
  7. {rcdb-2.3.0 → rcdb-2.3.1/rcdb.egg-info}/PKG-INFO +5 -4
  8. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb.egg-info/SOURCES.txt +3 -0
  9. rcdb-2.3.1/tests/test_cli_file.py +241 -0
  10. rcdb-2.3.1/tests/test_cli_run.py +154 -0
  11. rcdb-2.3.0/rcdb/cli/run.py +0 -78
  12. {rcdb-2.3.0 → rcdb-2.3.1}/MANIFEST.in +0 -0
  13. {rcdb-2.3.0 → rcdb-2.3.1}/pyproject.toml +0 -0
  14. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/__init__.py +0 -0
  15. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/__main__.py +0 -0
  16. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/alias.py +0 -0
  17. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/app_context.py +0 -0
  18. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/__init__.py +0 -0
  19. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/__main__.py +0 -0
  20. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/add.py +0 -0
  21. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/context.py +0 -0
  22. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/db.py +0 -0
  23. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/info.py +0 -0
  24. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/ls.py +0 -0
  25. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/repair/__init__.py +0 -0
  26. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/repair/evio_files.py +0 -0
  27. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/rp.py +0 -0
  28. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/select.py +0 -0
  29. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/test_data.py +0 -0
  30. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/cli/web.py +0 -0
  31. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/coda_parser.py +0 -0
  32. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/config_parser.py +0 -0
  33. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/constants.py +0 -0
  34. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/errors.py +0 -0
  35. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/file_archiver.py +0 -0
  36. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/halld_daq_config_parser.py +0 -0
  37. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/lexer.py +0 -0
  38. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/log_format.py +0 -0
  39. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/model.py +0 -0
  40. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/provider.py +0 -0
  41. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/stopwatch.py +0 -0
  42. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/update.py +0 -0
  43. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/__init__.py +0 -0
  44. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/__main__.py +0 -0
  45. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/__init__.py +0 -0
  46. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/conditions.py +0 -0
  47. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/files.py +0 -0
  48. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/logs.py +0 -0
  49. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/runs.py +0 -0
  50. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/select_values.py +0 -0
  51. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/modules/statistics.py +0 -0
  52. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/pagination.py +0 -0
  53. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/run_table.py +0 -0
  54. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.css +0 -0
  55. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.min.css +0 -0
  56. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.css +0 -0
  57. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.min.css +0 -0
  58. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.css +0 -0
  59. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.min.css +0 -0
  60. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.css +0 -0
  61. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.min.css +0 -0
  62. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables_themeroller.css +0 -0
  63. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc.png +0 -0
  64. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc_disabled.png +0 -0
  65. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_both.png +0 -0
  66. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc.png +0 -0
  67. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc_disabled.png +0 -0
  68. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.js +0 -0
  69. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.min.js +0 -0
  70. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.js +0 -0
  71. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.min.js +0 -0
  72. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.js +0 -0
  73. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.min.js +0 -0
  74. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.js +0 -0
  75. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.min.js +0 -0
  76. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.css +0 -0
  77. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.min.css +0 -0
  78. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.css +0 -0
  79. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.min.css +0 -0
  80. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.css +0 -0
  81. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.min.css +0 -0
  82. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.css +0 -0
  83. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.min.css +0 -0
  84. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.js +0 -0
  85. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.min.js +0 -0
  86. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.js +0 -0
  87. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.min.js +0 -0
  88. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.js +0 -0
  89. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.min.js +0 -0
  90. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.js +0 -0
  91. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.min.js +0 -0
  92. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.css +0 -0
  93. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.min.css +0 -0
  94. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.css +0 -0
  95. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.min.css +0 -0
  96. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.css +0 -0
  97. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.min.css +0 -0
  98. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.css +0 -0
  99. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.min.css +0 -0
  100. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.js +0 -0
  101. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.min.js +0 -0
  102. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.css +0 -0
  103. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.js +0 -0
  104. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.min.css +0 -0
  105. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/DataTables/datatables.min.js +0 -0
  106. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.css +0 -0
  107. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.css.map +0 -0
  108. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.min.css +0 -0
  109. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap-theme.min.css.map +0 -0
  110. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.css +0 -0
  111. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.css.map +0 -0
  112. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.min.css +0 -0
  113. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/bootstrap.min.css.map +0 -0
  114. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/buttons.dataTables.min.css +0 -0
  115. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/dataTables.tableTools.css +0 -0
  116. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/jquery-ui.min.css +0 -0
  117. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/jquery-ui.structure.min.css +0 -0
  118. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/jquery-ui.theme.min.css +0 -0
  119. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/jquery.dataTables.min.css +0 -0
  120. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/jquery.dataTables.yadcf.css +0 -0
  121. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/jquery.jsonview.css +0 -0
  122. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/main.css +0 -0
  123. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/select.dataTables.min.css +0 -0
  124. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/css/webintellisense.css +0 -0
  125. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/favicon.png +0 -0
  126. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.eot +0 -0
  127. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.svg +0 -0
  128. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.ttf +0 -0
  129. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff +0 -0
  130. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
  131. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/humans.txt +0 -0
  132. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/img/glyphicons-halflings-white.png +0 -0
  133. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/img/glyphicons-halflings.png +0 -0
  134. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/img/logo.png +0 -0
  135. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/bootstrap.js +0 -0
  136. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/bootstrap.min.js +0 -0
  137. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/clipboard.min.js +0 -0
  138. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/copy_clipboard.js +0 -0
  139. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/dataTables.buttons.min.js +0 -0
  140. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/dataTables.select.min.js +0 -0
  141. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery-2.1.0.min.js +0 -0
  142. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery-2.1.4.min.js +0 -0
  143. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery-ui.min.js +0 -0
  144. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery.dataTables.min.js +0 -0
  145. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery.dataTables.yadcf.js +0 -0
  146. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery.flot.min.js +0 -0
  147. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/jquery.jsonview.js +0 -0
  148. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/npm.js +0 -0
  149. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense-ace.js +0 -0
  150. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense-codemirror.js +0 -0
  151. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense-textbox.js +0 -0
  152. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/js/webintellisense.js +0 -0
  153. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/robots.txt +0 -0
  154. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/static/style.css +0 -0
  155. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/404.html +0 -0
  156. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/admin/index.html +0 -0
  157. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/admin/layout.html +0 -0
  158. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/admin/user.html +0 -0
  159. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/admin/users.html +0 -0
  160. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/conditions/index.html +0 -0
  161. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/custom_column_run_table.html +0 -0
  162. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/default_run_table.html +0 -0
  163. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/errors/forbidden_page.html +0 -0
  164. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/errors/layout.html +0 -0
  165. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/errors/page_not_found.html +0 -0
  166. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/errors/server_error.html +0 -0
  167. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/files/index.html +0 -0
  168. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/files/info.html +0 -0
  169. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/files/not_found.html +0 -0
  170. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/create_profile.html +0 -0
  171. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/footers/help.html +0 -0
  172. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/login.html +0 -0
  173. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/login_openid.html +0 -0
  174. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/reauth.html +0 -0
  175. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/reset_password.html +0 -0
  176. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/search.html +0 -0
  177. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/frontend/signup.html +0 -0
  178. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/index.html +0 -0
  179. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/layout.html +0 -0
  180. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/layouts/base.html +0 -0
  181. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/layouts/base2.html +0 -0
  182. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/login.html +0 -0
  183. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/logs/index.html +0 -0
  184. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/macros/_ask_user_to_update_ie.html +0 -0
  185. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/macros/_form.html +0 -0
  186. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/macros/_google_analytics.html +0 -0
  187. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/macros/_misc.html +0 -0
  188. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/macros/_reset_password.html +0 -0
  189. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/render_pagination.html +0 -0
  190. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/run_search_box.html +0 -0
  191. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/runs/conditions.html +0 -0
  192. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/runs/example.html +0 -0
  193. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/runs/index.html +0 -0
  194. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/runs/info.html +0 -0
  195. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/runs/not_found.html +0 -0
  196. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/select_values/index.html +0 -0
  197. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/settings/layout.html +0 -0
  198. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/settings/password.html +0 -0
  199. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/settings/profile.html +0 -0
  200. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/show_entries.html +0 -0
  201. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/statistics/index.html +0 -0
  202. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/user/index.html +0 -0
  203. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb/web/templates/user/profile.html +0 -0
  204. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb.egg-info/dependency_links.txt +0 -0
  205. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb.egg-info/entry_points.txt +0 -0
  206. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb.egg-info/requires.txt +0 -0
  207. {rcdb-2.3.0 → rcdb-2.3.1}/rcdb.egg-info/top_level.txt +0 -0
  208. {rcdb-2.3.0 → rcdb-2.3.1}/setup.cfg +0 -0
  209. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_cli_add_condition.py +0 -0
  210. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_cli_add_file.py +0 -0
  211. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_cli_add_type.py +0 -0
  212. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_coda_parser.py +0 -0
  213. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_conditions.py +0 -0
  214. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_config_parser.py +0 -0
  215. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_get_run_periods.py +0 -0
  216. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_get_runs.py +0 -0
  217. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_halld_run_config_parser.py +0 -0
  218. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_save_files.py +0 -0
  219. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_select_runs.py +0 -0
  220. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_select_values.py +0 -0
  221. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_sql_schema_version.py +0 -0
  222. {rcdb-2.3.0 → rcdb-2.3.1}/tests/test_value_comparison.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rcdb
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: RCDB - Run Conditions DataBase
5
5
  Author-email: Dmitry Romanov <romanov@jlab.org>
6
6
  License-Expression: MIT
@@ -42,10 +42,11 @@ Requires-Dist: pyflakes>=3; extra == "dev"
42
42
  [![C++ examples](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml)
43
43
  [![Documentation](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml)
44
44
 
45
- Run Configuration/Conditions Database (RCDB) stores run related information and conditions. It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
45
+ Run Configuration/Conditions Database (RCDB) stores run related information and conditions.
46
+ It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
46
47
 
47
48
  The interfaces available are:
48
- - Web site
49
+ - Web
49
50
  - Command line interface (CLI)
50
51
  - Python API
51
52
  - C++ API
@@ -62,4 +63,4 @@ https://halldweb.jlab.org/rcdb/
62
63
 
63
64
  #### SQLite db:
64
65
  Daily updated SQLite database is available here:
65
- https://halldweb.jlab.org/dist/rcdb2.sqlite
66
+ https://halldweb.jlab.org/dist/rcdb.sqlite
@@ -6,10 +6,11 @@
6
6
  [![C++ examples](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml)
7
7
  [![Documentation](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml)
8
8
 
9
- Run Configuration/Conditions Database (RCDB) stores run related information and conditions. It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
9
+ Run Configuration/Conditions Database (RCDB) stores run related information and conditions.
10
+ It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
10
11
 
11
12
  The interfaces available are:
12
- - Web site
13
+ - Web
13
14
  - Command line interface (CLI)
14
15
  - Python API
15
16
  - C++ API
@@ -26,4 +27,4 @@ https://halldweb.jlab.org/rcdb/
26
27
 
27
28
  #### SQLite db:
28
29
  Daily updated SQLite database is available here:
29
- https://halldweb.jlab.org/dist/rcdb2.sqlite
30
+ https://halldweb.jlab.org/dist/rcdb.sqlite
@@ -12,6 +12,8 @@ from .web import web_command
12
12
  from .info import info_command
13
13
  from .add import add_command
14
14
  from .select import select_command
15
+ from .file import file_command
16
+ from .run import run_command
15
17
 
16
18
 
17
19
  pass_rcdb_context = click.make_pass_decorator(RcdbApplicationContext)
@@ -21,7 +23,18 @@ def get_default_config_path():
21
23
  return os.path.join(os.path.expanduser('~'), '.rcdb_user')
22
24
 
23
25
 
24
- @click.group(invoke_without_command=True)
26
+ class RcdbGroup(click.Group):
27
+ """Top level group that treats `rcdb <number>` as `rcdb run <number>`."""
28
+
29
+ def resolve_command(self, ctx, args):
30
+ # If the first token is not a known command but looks like a run number,
31
+ # dispatch to the `run` command, i.e. `rcdb 1000` == `rcdb run 1000`.
32
+ if args and args[0] not in self.commands and args[0].isdigit():
33
+ args = ["run"] + args
34
+ return super().resolve_command(ctx, args)
35
+
36
+
37
+ @click.group(cls=RcdbGroup, invoke_without_command=True)
25
38
  @click.option('--user-config', envvar='RCDB_USER_CONFIG', default=get_default_config_path, metavar='PATH', help='Changes the user config location.')
26
39
  @click.option('--connection', '-c', envvar='RCDB_CONNECTION', help='Database connection string', default=None, required=False)
27
40
  @click.option('--config', nargs=2, multiple=True, metavar='KEY VALUE', help='Overrides a config key/value pair.')
@@ -67,4 +80,6 @@ rcdb_cli.add_command(web_command)
67
80
  rcdb_cli.add_command(info_command)
68
81
  rcdb_cli.add_command(add_command)
69
82
  rcdb_cli.add_command(select_command)
83
+ rcdb_cli.add_command(file_command)
84
+ rcdb_cli.add_command(run_command)
70
85
 
@@ -0,0 +1,333 @@
1
+ import sys
2
+ import click
3
+ from sqlalchemy import asc, desc
4
+
5
+ from rcdb.provider import RCDBProvider
6
+ from rcdb.model import ConfigurationFile, Run
7
+ from rcdb.cli.context import pass_rcdb_context
8
+
9
+
10
+ # ---------------------------------------------------------------------------
11
+ # Helpers
12
+ # ---------------------------------------------------------------------------
13
+ def _hash_str(value):
14
+ """Normalize a stored sha256 to a printable string.
15
+
16
+ The hash is stored base64-encoded and may come back from the DB as ``bytes``
17
+ (SQLite) or ``str`` (other dialects), so we always render it as ``str``.
18
+ """
19
+ if isinstance(value, (bytes, bytearray)):
20
+ return value.decode("ascii")
21
+ return str(value)
22
+
23
+
24
+ def _resolve_run_range(db, run_min, run_max, run, run_period):
25
+ """Resolve the run filter options into a (run_min, run_max) inclusive range.
26
+
27
+ The three selection mechanisms are mutually exclusive:
28
+ * ``--run-min`` / ``--run-max`` define a range (either side optional),
29
+ * ``--run`` selects a single run,
30
+ * ``--run-period`` selects a named run period.
31
+
32
+ When nothing is given the full range ``(0, sys.maxsize)`` is returned, which
33
+ means "all runs".
34
+ """
35
+ has_range = run_min is not None or run_max is not None
36
+ has_run = run is not None
37
+ has_period = run_period is not None
38
+
39
+ if sum([has_range, has_run, has_period]) > 1:
40
+ raise click.UsageError(
41
+ "--run-min/--run-max, --run and --run-period are mutually exclusive; "
42
+ "use only one of them.")
43
+
44
+ if has_period:
45
+ return _run_period_range(db, run_period)
46
+
47
+ if has_run:
48
+ return run, run
49
+
50
+ lo = run_min if run_min is not None else 0
51
+ hi = run_max if run_max is not None else sys.maxsize
52
+ return lo, hi
53
+
54
+
55
+ def _run_period_range(db, name):
56
+ """Resolve a run period *name* to a (run_min, run_max) range."""
57
+ match = next((p for p in db.get_run_periods() if p.name == name), None)
58
+ if match is None:
59
+ raise click.UsageError("Run period '{}' is not found in DB.".format(name))
60
+ return match.run_min, match.run_max
61
+
62
+
63
+ def _parse_run_spec(db, run_spec):
64
+ """Parse a positional run specifier into a (run_min, run_max) range.
65
+
66
+ The specifier is interpreted, in order:
67
+ 1. a single run number, e.g. ``1000`` -> (1000, 1000)
68
+ 2. a numeric run range, e.g. ``1000-2000``, -> (1000, 2000)
69
+ ``1000-`` -> (1000, maxsize), ``-2000`` -> (0, 2000)
70
+ 3. otherwise a run period name (which may itself contain '-').
71
+ """
72
+ spec = run_spec.strip()
73
+
74
+ # 1) single run number
75
+ if spec.isdigit():
76
+ run = int(spec)
77
+ return run, run
78
+
79
+ # 2) numeric run range "lo-hi" (either side optional)
80
+ if "-" in spec:
81
+ lo_s, _, hi_s = spec.partition("-")
82
+ lo_s, hi_s = lo_s.strip(), hi_s.strip()
83
+ lo_ok = lo_s == "" or lo_s.isdigit()
84
+ hi_ok = hi_s == "" or hi_s.isdigit()
85
+ if lo_ok and hi_ok and (lo_s or hi_s):
86
+ lo = int(lo_s) if lo_s else 0
87
+ hi = int(hi_s) if hi_s else sys.maxsize
88
+ return (lo, hi) if lo <= hi else (hi, lo)
89
+
90
+ # 3) run period name
91
+ return _run_period_range(db, spec)
92
+
93
+
94
+ # ---------------------------------------------------------------------------
95
+ # Group
96
+ # ---------------------------------------------------------------------------
97
+ @click.group("file", help="Inspect configuration/log files stored in the RCDB.")
98
+ @pass_rcdb_context
99
+ def file_command(context):
100
+ """The 'file' group command. See subcommands like:
101
+
102
+ rcdb file vers - list all versions of a file
103
+ rcdb file cat - print the content of a file version
104
+ rcdb file runs - list per-run file versions for a file
105
+ rcdb file ls - list all files for a run / run period
106
+ rcdb file search - find file names by substring
107
+ """
108
+ pass
109
+
110
+
111
+ # ---------------------------------------------------------------------------
112
+ # rcdb file vers <file name>
113
+ # ---------------------------------------------------------------------------
114
+ @file_command.command(name="vers", help="Show all versions of a file.")
115
+ @click.argument("file_name")
116
+ @pass_rcdb_context
117
+ def file_vers(context, file_name):
118
+ """Show all versions (distinct content hashes) stored for FILE_NAME.
119
+
120
+ Each row is printed as::
121
+
122
+ <sha256 hash> - <last run number this version is used>
123
+
124
+ Versions are sorted by their last used run number, descending.
125
+ """
126
+ db = context.require_connected_db()
127
+ assert isinstance(db, RCDBProvider)
128
+
129
+ files = db.session.query(ConfigurationFile) \
130
+ .filter(ConfigurationFile.path == file_name) \
131
+ .all()
132
+
133
+ if not files:
134
+ click.echo("No file '{}' found in DB.".format(file_name), err=True)
135
+ raise click.Abort()
136
+
137
+ rows = []
138
+ for conf_file in files:
139
+ run_numbers = [run.number for run in conf_file.runs]
140
+ last_run = max(run_numbers) if run_numbers else None
141
+ rows.append((_hash_str(conf_file.sha256), last_run))
142
+
143
+ # Sort by last run descending; versions without runs (None) go last.
144
+ rows.sort(key=lambda r: (r[1] is not None, r[1]), reverse=True)
145
+
146
+ for sha256, last_run in rows:
147
+ click.echo("{} - {}".format(sha256, last_run if last_run is not None else "none"))
148
+
149
+
150
+ # ---------------------------------------------------------------------------
151
+ # rcdb file cat <file name> [run] [--run=<run>] [--hash=<hash>]
152
+ # ---------------------------------------------------------------------------
153
+ @file_command.command(name="cat", help="Print the content of a file version.")
154
+ @click.argument("file_name")
155
+ @click.argument("run_arg", required=False, type=int)
156
+ @click.option("--run", "run_opt", type=int, default=None,
157
+ help="Print the version of the file used in this run.")
158
+ @click.option("--hash", "file_hash", default=None,
159
+ help="Print the version with this sha256 hash (a unique prefix is accepted).")
160
+ @pass_rcdb_context
161
+ def file_cat(context, file_name, run_arg, run_opt, file_hash):
162
+ """Dump the raw content of a single version of FILE_NAME.
163
+
164
+ The version is selected either by run (positional RUN or --run) or by
165
+ --hash. Exactly one selector must be provided.
166
+
167
+ Examples::
168
+
169
+ rcdb file cat /path/coda.conf 1000
170
+ rcdb file cat /path/coda.conf --run=1000
171
+ rcdb file cat /path/coda.conf --hash=Hk3...
172
+ """
173
+ db = context.require_connected_db()
174
+ assert isinstance(db, RCDBProvider)
175
+
176
+ run = run_arg if run_arg is not None else run_opt
177
+
178
+ if run is not None and file_hash is not None:
179
+ raise click.UsageError("Provide either a run or --hash, not both.")
180
+ if run is None and file_hash is None:
181
+ raise click.UsageError("Provide a run (positional or --run) or --hash to select a file version.")
182
+
183
+ if file_hash is not None:
184
+ versions = db.session.query(ConfigurationFile) \
185
+ .filter(ConfigurationFile.path == file_name) \
186
+ .all()
187
+ # Match by hash prefix in Python: the stored hash may be bytes or str
188
+ # depending on the DB dialect, so we normalize before comparing.
189
+ matches = [f for f in versions if _hash_str(f.sha256).startswith(file_hash)]
190
+ if not matches:
191
+ click.echo("No version of '{}' with hash '{}' found in DB.".format(file_name, file_hash), err=True)
192
+ raise click.Abort()
193
+ if len(matches) > 1:
194
+ click.echo("Hash prefix '{}' is ambiguous, matches {} versions of '{}'."
195
+ .format(file_hash, len(matches), file_name), err=True)
196
+ raise click.Abort()
197
+ conf_file = matches[0]
198
+ else:
199
+ run_obj = db.get_run(run)
200
+ if run_obj is None:
201
+ click.echo("Run {} is not found in DB.".format(run), err=True)
202
+ raise click.Abort()
203
+ conf_file = db.get_file(run_obj, file_name)
204
+ if conf_file is None:
205
+ click.echo("No file '{}' attached to run {}.".format(file_name, run), err=True)
206
+ raise click.Abort()
207
+
208
+ # Raw dump so the output can be piped to e.g. grep
209
+ click.echo(conf_file.content, nl=False)
210
+
211
+
212
+ # ---------------------------------------------------------------------------
213
+ # rcdb file runs <file name> [run filters] [--asc/--desc] [--limit]
214
+ # ---------------------------------------------------------------------------
215
+ @file_command.command(name="runs", help="List per-run versions of a file.")
216
+ @click.argument("file_name")
217
+ @click.option("--run-min", type=int, default=None, help="Lower run number bound (inclusive).")
218
+ @click.option("--run-max", type=int, default=None, help="Upper run number bound (inclusive).")
219
+ @click.option("--run", type=int, default=None, help="A single run number.")
220
+ @click.option("--run-period", default=None, help="A run period name.")
221
+ @click.option("--desc/--asc", "is_descending", default=True,
222
+ help="Sort resulting runs descending (default) or ascending.")
223
+ @click.option("--limit", type=int, default=None, help="Limit the number of rows.")
224
+ @pass_rcdb_context
225
+ def file_runs(context, file_name, run_min, run_max, run, run_period, is_descending, limit):
226
+ """List the runs that use FILE_NAME and the version (hash) used in each.
227
+
228
+ Each row is printed as::
229
+
230
+ <run number> - <file hash>
231
+
232
+ Sorted by run number descending by default.
233
+ """
234
+ db = context.require_connected_db()
235
+ assert isinstance(db, RCDBProvider)
236
+
237
+ lo, hi = _resolve_run_range(db, run_min, run_max, run, run_period)
238
+
239
+ order = desc if is_descending else asc
240
+ query = db.session.query(Run.number, ConfigurationFile.sha256) \
241
+ .join(ConfigurationFile.runs) \
242
+ .filter(ConfigurationFile.path == file_name) \
243
+ .filter(Run.number >= lo, Run.number <= hi) \
244
+ .order_by(order(Run.number))
245
+
246
+ if limit is not None:
247
+ query = query.limit(limit)
248
+
249
+ rows = query.all()
250
+ if not rows:
251
+ click.echo("No runs found for file '{}' in the given range.".format(file_name), err=True)
252
+ return
253
+
254
+ for run_number, sha256 in rows:
255
+ click.echo("{} - {}".format(run_number, _hash_str(sha256)))
256
+
257
+
258
+ # ---------------------------------------------------------------------------
259
+ # rcdb file ls [run filters]
260
+ # ---------------------------------------------------------------------------
261
+ @file_command.command(name="ls", help="List all files for a run / run period.")
262
+ @click.argument("run_spec", required=False)
263
+ @click.option("--run-min", type=int, default=None, help="Lower run number bound (inclusive).")
264
+ @click.option("--run-max", type=int, default=None, help="Upper run number bound (inclusive).")
265
+ @click.option("--run", type=int, default=None, help="A single run number.")
266
+ @click.option("--run-period", default=None, help="A run period name.")
267
+ @pass_rcdb_context
268
+ def file_ls(context, run_spec, run_min, run_max, run, run_period):
269
+ """List all files attached to runs in the given range, sorted by file name.
270
+
271
+ Each row is printed as::
272
+
273
+ <file hash> - <file name>
274
+
275
+ The runs may be given either as a positional RUN_SPEC - a run number
276
+ (``1000``), a run range (``1000-2000``) or a run period name - or with the
277
+ --run/--run-min/--run-max/--run-period options. With no run filter, all
278
+ files are listed.
279
+ """
280
+ db = context.require_connected_db()
281
+ assert isinstance(db, RCDBProvider)
282
+
283
+ if run_spec is not None:
284
+ if any(x is not None for x in (run_min, run_max, run, run_period)):
285
+ raise click.UsageError(
286
+ "Provide either a positional run/range/period or the "
287
+ "--run/--run-min/--run-max/--run-period options, not both.")
288
+ lo, hi = _parse_run_spec(db, run_spec)
289
+ else:
290
+ lo, hi = _resolve_run_range(db, run_min, run_max, run, run_period)
291
+
292
+ rows = db.session.query(ConfigurationFile.sha256, ConfigurationFile.path) \
293
+ .join(ConfigurationFile.runs) \
294
+ .filter(Run.number >= lo, Run.number <= hi) \
295
+ .distinct() \
296
+ .order_by(asc(ConfigurationFile.path)) \
297
+ .all()
298
+
299
+ if not rows:
300
+ click.echo("No files found in the given range.", err=True)
301
+ return
302
+
303
+ for sha256, path in rows:
304
+ click.echo("{} - {}".format(_hash_str(sha256), path))
305
+
306
+
307
+ # ---------------------------------------------------------------------------
308
+ # rcdb file search <pattern>
309
+ # ---------------------------------------------------------------------------
310
+ @file_command.command(name="search", help="Find file names containing a substring.")
311
+ @click.argument("pattern")
312
+ @pass_rcdb_context
313
+ def file_search(context, pattern):
314
+ """Print all distinct file names whose path contains PATTERN as a substring.
315
+
316
+ Matching is case-insensitive.
317
+ """
318
+ db = context.require_connected_db()
319
+ assert isinstance(db, RCDBProvider)
320
+
321
+ # Escape LIKE wildcards so '%' and '_' (common in file names) match literally.
322
+ # ``ilike`` keeps the filter in the DB and is case-insensitive on all backends
323
+ # (it compiles to ``lower(path) LIKE lower(?)`` on SQLite/MySQL).
324
+ escaped = pattern.replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_")
325
+
326
+ rows = db.session.query(ConfigurationFile.path) \
327
+ .filter(ConfigurationFile.path.ilike("%" + escaped + "%", escape="\\")) \
328
+ .distinct() \
329
+ .order_by(asc(ConfigurationFile.path)) \
330
+ .all()
331
+
332
+ for (path,) in rows:
333
+ click.echo(path)
@@ -0,0 +1,84 @@
1
+ import click
2
+
3
+ from rcdb.provider import RCDBProvider
4
+ from rcdb.model import ConfigurationFile
5
+ from .context import pass_rcdb_context
6
+
7
+
8
+ # Maximum number of characters shown for a condition value.
9
+ _MAX_VALUE_LEN = 50
10
+
11
+
12
+ def format_condition_value(value):
13
+ """Flatten a condition value to a single line and truncate it.
14
+
15
+ New lines are replaced by spaces and the result is cut to the first
16
+ ``_MAX_VALUE_LEN`` characters, appending ``...`` when truncation happened.
17
+ """
18
+ text = str(value).replace("\r\n", " ").replace("\n", " ").replace("\r", " ")
19
+ if len(text) > _MAX_VALUE_LEN:
20
+ return text[:_MAX_VALUE_LEN] + "..."
21
+ return text
22
+
23
+
24
+ @click.command(name="run")
25
+ @click.argument("run_number", type=int)
26
+ @click.option("-i", "--info", "show_info", is_flag=True, default=False,
27
+ help="Show only the run info line (start - end).")
28
+ @click.option("-c", "--conditions", "show_conditions", is_flag=True, default=False,
29
+ help="Show only conditions (without the CONDITIONS title).")
30
+ @click.option("-f", "--files", "show_files", is_flag=True, default=False,
31
+ help="Show only files (without the FILES title).")
32
+ @pass_rcdb_context
33
+ def run_command(context, run_number, show_info, show_conditions, show_files):
34
+ """Show information about a single run: its time span, conditions and files.
35
+
36
+ `rcdb <run number>` is a shortcut for `rcdb run <run number>`.
37
+
38
+ With no -i/-c/-f flag the full report is printed. Passing one or more flags
39
+ limits the output to just those sections (and drops the section titles).
40
+ """
41
+ db = context.require_connected_db()
42
+ assert isinstance(db, RCDBProvider)
43
+
44
+ run = db.get_run(run_number)
45
+ if not run:
46
+ click.echo("Run {} is not found in DB.".format(run_number), err=True)
47
+ raise click.Abort()
48
+
49
+ # No flag => full report with titles. Any flag => only those sections.
50
+ full = not (show_info or show_conditions or show_files)
51
+
52
+ # ---- Info -----------------------------------------------------------
53
+ if full or show_info:
54
+ start = run.start_time if run.start_time is not None else "?"
55
+ end = run.end_time if run.end_time is not None else "?"
56
+ click.echo("Run {}: {} - {}".format(run.number, start, end))
57
+
58
+ # ---- Conditions -----------------------------------------------------
59
+ if full or show_conditions:
60
+ if full:
61
+ click.echo("")
62
+ click.echo("CONDITIONS:")
63
+ conditions = sorted(run.conditions, key=lambda c: c.name)
64
+ if conditions:
65
+ for condition in conditions:
66
+ click.echo(" {} - {}".format(condition.name, format_condition_value(condition.value)))
67
+ elif full:
68
+ click.echo(" (none)")
69
+
70
+ # ---- Files ----------------------------------------------------------
71
+ if full or show_files:
72
+ important = sorted(f.path for f in run.files
73
+ if f.importance == ConfigurationFile.IMPORTANCE_HIGH)
74
+ other = sorted(f.path for f in run.files
75
+ if f.importance != ConfigurationFile.IMPORTANCE_HIGH)
76
+
77
+ if full:
78
+ click.echo("FILES")
79
+ click.echo(" important:")
80
+ for path in important:
81
+ click.echo(" {}".format(path))
82
+ click.echo(" other files:")
83
+ for path in other:
84
+ click.echo(" {}".format(path))
@@ -1,5 +1,5 @@
1
1
  # String version. Used both for setup.py and for internal code
2
- version = '2.3.0'
2
+ version = '2.3.1'
3
3
 
4
4
  # version as the tuple of ints
5
5
  version_tuple = tuple(int(val) for val in version.split('.'))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rcdb
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: RCDB - Run Conditions DataBase
5
5
  Author-email: Dmitry Romanov <romanov@jlab.org>
6
6
  License-Expression: MIT
@@ -42,10 +42,11 @@ Requires-Dist: pyflakes>=3; extra == "dev"
42
42
  [![C++ examples](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/cpp-examples.yml)
43
43
  [![Documentation](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml/badge.svg)](https://github.com/JeffersonLab/rcdb/actions/workflows/documentation.yml)
44
44
 
45
- Run Configuration/Conditions Database (RCDB) stores run related information and conditions. It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
45
+ Run Configuration/Conditions Database (RCDB) stores run related information and conditions.
46
+ It uses MySQL or SQLite databases to store information about runs and provides interfaces to search runs, manage data, automatic CODA integration, etc.
46
47
 
47
48
  The interfaces available are:
48
- - Web site
49
+ - Web
49
50
  - Command line interface (CLI)
50
51
  - Python API
51
52
  - C++ API
@@ -62,4 +63,4 @@ https://halldweb.jlab.org/rcdb/
62
63
 
63
64
  #### SQLite db:
64
65
  Daily updated SQLite database is available here:
65
- https://halldweb.jlab.org/dist/rcdb2.sqlite
66
+ https://halldweb.jlab.org/dist/rcdb.sqlite
@@ -31,6 +31,7 @@ rcdb/cli/add.py
31
31
  rcdb/cli/app.py
32
32
  rcdb/cli/context.py
33
33
  rcdb/cli/db.py
34
+ rcdb/cli/file.py
34
35
  rcdb/cli/info.py
35
36
  rcdb/cli/ls.py
36
37
  rcdb/cli/rp.py
@@ -204,6 +205,8 @@ rcdb/web/templates/user/profile.html
204
205
  tests/test_cli_add_condition.py
205
206
  tests/test_cli_add_file.py
206
207
  tests/test_cli_add_type.py
208
+ tests/test_cli_file.py
209
+ tests/test_cli_run.py
207
210
  tests/test_coda_parser.py
208
211
  tests/test_conditions.py
209
212
  tests/test_config_parser.py