rcdb 2.2.7__tar.gz → 2.2.9__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 (217) hide show
  1. {rcdb-2.2.7/rcdb.egg-info → rcdb-2.2.9}/PKG-INFO +4 -2
  2. {rcdb-2.2.7 → rcdb-2.2.9}/pyproject.toml +3 -1
  3. rcdb-2.2.9/rcdb/cli/app.py +72 -0
  4. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/db.py +61 -6
  5. rcdb-2.2.9/rcdb/cli/info.py +60 -0
  6. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/ls.py +3 -3
  7. rcdb-2.2.9/rcdb/cli/repair/__init__.py +12 -0
  8. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/repair/evio_files.py +2 -2
  9. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/rp.py +9 -5
  10. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/web.py +1 -1
  11. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/version.py +1 -1
  12. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/__init__.py +1 -1
  13. {rcdb-2.2.7 → rcdb-2.2.9/rcdb.egg-info}/PKG-INFO +4 -2
  14. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb.egg-info/SOURCES.txt +1 -2
  15. rcdb-2.2.7/rcdb/admin_cmd.py +0 -83
  16. rcdb-2.2.7/rcdb/cli/app.py +0 -106
  17. rcdb-2.2.7/rcdb/cli/mkdb.py +0 -27
  18. rcdb-2.2.7/rcdb/cli/repair/__init__.py +0 -13
  19. {rcdb-2.2.7 → rcdb-2.2.9}/MANIFEST.in +0 -0
  20. {rcdb-2.2.7 → rcdb-2.2.9}/README.md +0 -0
  21. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/__init__.py +0 -0
  22. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/__main__.py +0 -0
  23. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/alias.py +0 -0
  24. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/app_context.py +0 -0
  25. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/__init__.py +0 -0
  26. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/__main__.py +0 -0
  27. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/context.py +0 -0
  28. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/run.py +0 -0
  29. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/cli/select.py +0 -0
  30. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/coda_parser.py +0 -0
  31. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/condition_query_builder.py +0 -0
  32. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/config_parser.py +0 -0
  33. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/constants.py +0 -0
  34. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/errors.py +0 -0
  35. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/file_archiver.py +0 -0
  36. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/halld_daq_config_parser.py +0 -0
  37. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/lexer.py +0 -0
  38. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/log_format.py +0 -0
  39. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/model.py +0 -0
  40. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/provider.py +0 -0
  41. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/stopwatch.py +0 -0
  42. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/update.py +0 -0
  43. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/__init__.py +0 -0
  44. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/conditions.py +0 -0
  45. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/files.py +0 -0
  46. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/logs.py +0 -0
  47. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/runs.py +0 -0
  48. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/select_values.py +0 -0
  49. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/modules/statistics.py +0 -0
  50. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/pagination.py +0 -0
  51. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/run_table.py +0 -0
  52. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.css +0 -0
  53. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.bootstrap.min.css +0 -0
  54. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.css +0 -0
  55. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.foundation.min.css +0 -0
  56. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.css +0 -0
  57. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/dataTables.jqueryui.min.css +0 -0
  58. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.css +0 -0
  59. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables.min.css +0 -0
  60. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/css/jquery.dataTables_themeroller.css +0 -0
  61. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc.png +0 -0
  62. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_asc_disabled.png +0 -0
  63. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_both.png +0 -0
  64. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc.png +0 -0
  65. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/images/sort_desc_disabled.png +0 -0
  66. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.js +0 -0
  67. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.bootstrap.min.js +0 -0
  68. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.js +0 -0
  69. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.foundation.min.js +0 -0
  70. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.js +0 -0
  71. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/dataTables.jqueryui.min.js +0 -0
  72. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.js +0 -0
  73. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/DataTables-1.10.10/js/jquery.dataTables.min.js +0 -0
  74. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.css +0 -0
  75. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.bootstrap.min.css +0 -0
  76. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.css +0 -0
  77. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.dataTables.min.css +0 -0
  78. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.css +0 -0
  79. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.foundation.min.css +0 -0
  80. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.css +0 -0
  81. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/css/responsive.jqueryui.min.css +0 -0
  82. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.js +0 -0
  83. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/dataTables.responsive.min.js +0 -0
  84. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.js +0 -0
  85. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.bootstrap.min.js +0 -0
  86. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.js +0 -0
  87. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.foundation.min.js +0 -0
  88. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.js +0 -0
  89. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/Responsive-2.0.0/js/responsive.jqueryui.min.js +0 -0
  90. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.css +0 -0
  91. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.bootstrap.min.css +0 -0
  92. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.css +0 -0
  93. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.dataTables.min.css +0 -0
  94. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.css +0 -0
  95. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.foundation.min.css +0 -0
  96. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.css +0 -0
  97. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/css/rowReorder.jqueryui.min.css +0 -0
  98. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.js +0 -0
  99. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/RowReorder-1.1.0/js/dataTables.rowReorder.min.js +0 -0
  100. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/datatables.css +0 -0
  101. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/datatables.js +0 -0
  102. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/datatables.min.css +0 -0
  103. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/DataTables/datatables.min.js +0 -0
  104. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap-theme.css +0 -0
  105. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap-theme.css.map +0 -0
  106. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap-theme.min.css +0 -0
  107. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap-theme.min.css.map +0 -0
  108. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap.css +0 -0
  109. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap.css.map +0 -0
  110. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap.min.css +0 -0
  111. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/bootstrap.min.css.map +0 -0
  112. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/buttons.dataTables.min.css +0 -0
  113. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/dataTables.tableTools.css +0 -0
  114. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/jquery-ui.min.css +0 -0
  115. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/jquery-ui.structure.min.css +0 -0
  116. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/jquery-ui.theme.min.css +0 -0
  117. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/jquery.dataTables.min.css +0 -0
  118. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/jquery.dataTables.yadcf.css +0 -0
  119. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/jquery.jsonview.css +0 -0
  120. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/main.css +0 -0
  121. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/select.dataTables.min.css +0 -0
  122. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/css/webintellisense.css +0 -0
  123. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/favicon.png +0 -0
  124. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/fonts/glyphicons-halflings-regular.eot +0 -0
  125. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/fonts/glyphicons-halflings-regular.svg +0 -0
  126. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/fonts/glyphicons-halflings-regular.ttf +0 -0
  127. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff +0 -0
  128. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/fonts/glyphicons-halflings-regular.woff2 +0 -0
  129. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/humans.txt +0 -0
  130. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/img/glyphicons-halflings-white.png +0 -0
  131. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/img/glyphicons-halflings.png +0 -0
  132. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/img/logo.png +0 -0
  133. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/bootstrap.js +0 -0
  134. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/bootstrap.min.js +0 -0
  135. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/clipboard.min.js +0 -0
  136. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/copy_clipboard.js +0 -0
  137. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/dataTables.buttons.min.js +0 -0
  138. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/dataTables.select.min.js +0 -0
  139. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery-2.1.0.min.js +0 -0
  140. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery-2.1.4.min.js +0 -0
  141. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery-ui.min.js +0 -0
  142. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery.dataTables.min.js +0 -0
  143. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery.dataTables.yadcf.js +0 -0
  144. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery.flot.min.js +0 -0
  145. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/jquery.jsonview.js +0 -0
  146. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/npm.js +0 -0
  147. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/webintellisense-ace.js +0 -0
  148. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/webintellisense-codemirror.js +0 -0
  149. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/webintellisense-textbox.js +0 -0
  150. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/js/webintellisense.js +0 -0
  151. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/robots.txt +0 -0
  152. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/static/style.css +0 -0
  153. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/404.html +0 -0
  154. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/admin/index.html +0 -0
  155. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/admin/layout.html +0 -0
  156. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/admin/user.html +0 -0
  157. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/admin/users.html +0 -0
  158. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/conditions/index.html +0 -0
  159. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/custom_column_run_table.html +0 -0
  160. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/default_run_table.html +0 -0
  161. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/errors/forbidden_page.html +0 -0
  162. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/errors/layout.html +0 -0
  163. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/errors/page_not_found.html +0 -0
  164. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/errors/server_error.html +0 -0
  165. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/files/index.html +0 -0
  166. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/files/info.html +0 -0
  167. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/files/not_found.html +0 -0
  168. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/create_profile.html +0 -0
  169. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/footers/help.html +0 -0
  170. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/login.html +0 -0
  171. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/login_openid.html +0 -0
  172. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/reauth.html +0 -0
  173. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/reset_password.html +0 -0
  174. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/search.html +0 -0
  175. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/frontend/signup.html +0 -0
  176. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/index.html +0 -0
  177. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/layout.html +0 -0
  178. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/layouts/base.html +0 -0
  179. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/layouts/base2.html +0 -0
  180. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/login.html +0 -0
  181. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/logs/index.html +0 -0
  182. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/macros/_ask_user_to_update_ie.html +0 -0
  183. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/macros/_form.html +0 -0
  184. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/macros/_google_analytics.html +0 -0
  185. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/macros/_misc.html +0 -0
  186. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/macros/_reset_password.html +0 -0
  187. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/render_pagination.html +0 -0
  188. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/run_search_box.html +0 -0
  189. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/runs/conditions.html +0 -0
  190. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/runs/example.html +0 -0
  191. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/runs/index.html +0 -0
  192. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/runs/info.html +0 -0
  193. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/runs/not_found.html +0 -0
  194. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/select_values/index.html +0 -0
  195. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/settings/layout.html +0 -0
  196. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/settings/password.html +0 -0
  197. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/settings/profile.html +0 -0
  198. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/show_entries.html +0 -0
  199. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/statistics/index.html +0 -0
  200. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/user/index.html +0 -0
  201. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb/web/templates/user/profile.html +0 -0
  202. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb.egg-info/dependency_links.txt +0 -0
  203. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb.egg-info/entry_points.txt +0 -0
  204. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb.egg-info/requires.txt +0 -0
  205. {rcdb-2.2.7 → rcdb-2.2.9}/rcdb.egg-info/top_level.txt +0 -0
  206. {rcdb-2.2.7 → rcdb-2.2.9}/setup.cfg +0 -0
  207. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_coda_parser.py +0 -0
  208. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_conditions.py +0 -0
  209. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_config_parser.py +0 -0
  210. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_get_run_periods.py +0 -0
  211. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_get_runs.py +0 -0
  212. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_halld_run_config_parser.py +0 -0
  213. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_save_files.py +0 -0
  214. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_select_runs.py +0 -0
  215. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_select_values.py +0 -0
  216. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_sql_schema_version.py +0 -0
  217. {rcdb-2.2.7 → rcdb-2.2.9}/tests/test_value_comparison.py +0 -0
@@ -1,17 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rcdb
3
- Version: 2.2.7
3
+ Version: 2.2.9
4
4
  Summary: RCDB - Run Conditions DataBase
5
5
  Author-email: Dmitry Romanov <romanov@jlab.org>
6
6
  License-Expression: MIT
7
- Classifier: Development Status :: 4 - Beta
7
+ Classifier: Development Status :: 5 - Production/Stable
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: Implementation :: CPython
14
15
  Classifier: Intended Audience :: Science/Research
16
+ Classifier: Intended Audience :: Developers
15
17
  Classifier: Operating System :: OS Independent
16
18
  Classifier: Topic :: Scientific/Engineering :: Physics
17
19
  Classifier: Topic :: Database
@@ -19,14 +19,16 @@ authors = [
19
19
  { name="Dmitry Romanov", email="romanov@jlab.org" }
20
20
  ]
21
21
  classifiers = [
22
- "Development Status :: 4 - Beta",
22
+ "Development Status :: 5 - Production/Stable",
23
23
  "Programming Language :: Python :: 3",
24
24
  "Programming Language :: Python :: 3.9",
25
25
  "Programming Language :: Python :: 3.10",
26
26
  "Programming Language :: Python :: 3.11",
27
27
  "Programming Language :: Python :: 3.12",
28
28
  "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: Implementation :: CPython",
29
30
  "Intended Audience :: Science/Research",
31
+ "Intended Audience :: Developers",
30
32
  "Operating System :: OS Independent",
31
33
  "Topic :: Scientific/Engineering :: Physics",
32
34
  "Topic :: Database"
@@ -0,0 +1,72 @@
1
+ import os
2
+ import sys
3
+ import posixpath
4
+ import click
5
+ from click import Command
6
+
7
+ from rcdb.app_context import RcdbApplicationContext, parse_run_range
8
+ from rcdb import RCDBProvider
9
+ from rcdb.model import ConfigurationFile
10
+ from rcdb.version import version as rcdb_version
11
+
12
+ from .ls import ls_command
13
+ from .repair import repair_command
14
+ from .db import db_command
15
+ from .rp import rp_command
16
+ from .web import web_command
17
+ from .info import info_command
18
+
19
+
20
+ pass_rcdb_context = click.make_pass_decorator(RcdbApplicationContext)
21
+
22
+
23
+ def get_default_config_path():
24
+ return os.path.join(os.path.expanduser('~'), '.rcdb_user')
25
+
26
+
27
+ @click.group(invoke_without_command=True)
28
+ @click.option('--user-config', envvar='RCDB_USER_CONFIG', default=get_default_config_path, metavar='PATH', help='Changes the user config location.')
29
+ @click.option('--connection', '-c', envvar='RCDB_CONNECTION', help='Database connection string', default=None, required=False)
30
+ @click.option('--config', nargs=2, multiple=True, metavar='KEY VALUE', help='Overrides a config key/value pair.')
31
+ @click.option('--verbose', '-v', is_flag=True, help='Enables verbose mode.')
32
+ @click.version_option(rcdb_version)
33
+ @click.pass_context
34
+ def rcdb_cli(ctx, user_config, connection, config, verbose):
35
+ """'rcdb' is a RCDB (run conditions database) command line tool
36
+ This tool allows to select runs and get values as well as manage RCDB values
37
+
38
+ RCDB CLI needs a DB connection string which could be provided via:
39
+ - RCDB_CONNECTION environment variable
40
+ - -c/--connection flag
41
+ """
42
+
43
+ # Create a rcdb_app_context object and remember it as the context object. From
44
+ # this point onwards other commands can refer to it by using the
45
+ # @pass_rcdb_context decorator.
46
+ if not connection:
47
+ print("(!)WARNING no connection provided! "
48
+ "Provide DB connection string via --connection/-c or RCDB_CONNECTION environment variable.")
49
+ ctx.obj = RcdbApplicationContext(os.path.abspath(user_config), connection)
50
+ ctx.obj.verbose = verbose
51
+ for key, value in config:
52
+ ctx.obj.set_config(key, value)
53
+
54
+ # Bo commands given
55
+ if ctx.invoked_subcommand is None:
56
+ # There is a connection but no subcommand
57
+ if connection:
58
+ # If user typed just `rcdb -c <db>`, call info() automatically:
59
+ ctx.invoke(info_command) # => invoke the "info" command
60
+ else:
61
+ # No subcommand, no connection => show help
62
+ click.echo(ctx.get_help())
63
+
64
+
65
+ # Add commands to application
66
+ rcdb_cli.add_command(ls_command)
67
+ rcdb_cli.add_command(repair_command)
68
+ rcdb_cli.add_command(db_command)
69
+ rcdb_cli.add_command(rp_command)
70
+ rcdb_cli.add_command(web_command)
71
+ rcdb_cli.add_command(info_command)
72
+
@@ -1,6 +1,6 @@
1
1
  import click
2
2
  import sqlalchemy
3
- from sqlalchemy import create_engine, MetaData, Table, desc, select
3
+ from sqlalchemy import create_engine, MetaData, Table, desc, select, text
4
4
  from sqlalchemy.exc import OperationalError
5
5
 
6
6
  import rcdb
@@ -10,9 +10,9 @@ from rcdb.cli.context import pass_rcdb_context
10
10
  from rcdb.provider import stamp_schema_version
11
11
 
12
12
 
13
- @click.group(invoke_without_command=True)
13
+ @click.group(name="db", invoke_without_command=True)
14
14
  @click.pass_context
15
- def db(ctx):
15
+ def db_command(ctx):
16
16
  """Database management commands."""
17
17
  if ctx.invoked_subcommand is None:
18
18
  connection_str = ctx.obj.connection_str
@@ -28,8 +28,63 @@ def db(ctx):
28
28
  schema_version, = provider.session.execute(query).first()
29
29
  print("Schema version: {} - '{}'".format(schema_version.version, schema_version.comment))
30
30
 
31
-
32
- @db.command()
31
+ if connection_str.startswith("mysql"):
32
+ _print_mysql_table_sizes(engine=provider.engine)
33
+ elif connection_str.startswith("sqlite"):
34
+ _print_sqlite_table_sizes(engine=provider.engine)
35
+ else:
36
+ click.echo("Table size info: not supported for this database dialect")
37
+
38
+ def _print_mysql_table_sizes(engine):
39
+ """Query MySQL information_schema to print approximate table sizes in MB."""
40
+ # Find which database/schema we are connected to
41
+ db_name = engine.url.database
42
+
43
+ sql = text(f"""
44
+ SELECT
45
+ table_name AS tbl,
46
+ ROUND(((data_length + index_length) / 1024 / 1024), 2) AS size_mb
47
+ FROM information_schema.tables
48
+ WHERE table_schema = :db
49
+ ORDER BY size_mb DESC
50
+ """)
51
+
52
+ with engine.connect() as conn:
53
+ results = conn.execute(sql, {"db": db_name}).fetchall()
54
+
55
+ click.echo("\nTable sizes in MB (MySQL):")
56
+ for row in results:
57
+ table, size_mb = row
58
+ click.echo(f" {table:30} {size_mb} MB")
59
+
60
+ def _print_sqlite_table_sizes(engine):
61
+ """Use 'dbstat' virtual table (if available) to estimate table sizes."""
62
+ try:
63
+ with engine.connect() as conn:
64
+ # Enable the dbstat extension if needed
65
+ # conn.execute("SELECT load_extension('dbstat')")
66
+ # (Only if your SQLite requires explicit load_extension calls)
67
+
68
+ # dbstat vtable can be queried like this:
69
+ rows = conn.execute(text("""
70
+ SELECT
71
+ name AS table_name,
72
+ SUM(pgsize) as total_bytes
73
+ FROM dbstat
74
+ GROUP BY name
75
+ ORDER BY total_bytes DESC
76
+ """)).fetchall()
77
+
78
+ click.echo("\nApproximate per-table sizes (SQLite dbstat):")
79
+ for table_name, total_bytes in rows:
80
+ size_mb = round(total_bytes / 1024 / 1024, 2)
81
+ click.echo(f" {table_name:30} {size_mb} MB")
82
+
83
+ except Exception as ex:
84
+ click.echo("\n No table size info: sqlite dbstat extension is not installed. Use sqlite3_analyzer to get table sizes")
85
+
86
+
87
+ @db_command.command()
33
88
  @pass_rcdb_context
34
89
  def update(context):
35
90
  provider = RCDBProvider(context.connection_str, check_version=False)
@@ -102,7 +157,7 @@ def update(context):
102
157
  print("Stamped schema version: {} - '{}'".format(version.version, version.comment))
103
158
 
104
159
 
105
- @db.command()
160
+ @db_command.command()
106
161
  @click.option('--no-defaults', is_flag=True, help="Don't create default condition types")
107
162
  @click.option('--drop-all', is_flag=True, help='Drops existing RCDB data if exists')
108
163
  @click.option('--confirm', is_flag=True, help='For CI automation and tests')
@@ -0,0 +1,60 @@
1
+ import click
2
+ import datetime
3
+ from .context import pass_rcdb_context
4
+ from rcdb.model import Condition, Run, ConfigurationFile, RunPeriod
5
+ from .. import ConditionType
6
+
7
+
8
+ @click.command("info", help="Prints summary info about RCDB contents")
9
+ @pass_rcdb_context
10
+ def info_command(context):
11
+ """
12
+ Shows various summary information about the RCDB database contents.
13
+ """
14
+ db = context.db
15
+
16
+ # Number of condition types
17
+ cnd_type_count = db.session.query(ConditionType).count()
18
+
19
+ # Number of conditions
20
+ cnd_count = db.session.query(Condition).count()
21
+
22
+ # Date-time of the last condition added:
23
+ last_cnd = db.session.query(Condition).order_by(Condition.id.desc()).first()
24
+ cnd_last_time = last_cnd.created if (last_cnd and hasattr(last_cnd, 'created')) else None
25
+
26
+ # Number of runs saved
27
+ run_count = db.session.query(Run).count()
28
+
29
+ # Number of files saved
30
+ file_count = db.session.query(ConfigurationFile).count()
31
+
32
+ # The last 5 runs saved (by run_number DESC)
33
+ last_5_runs = db.session.query(Run).order_by(Run.number.desc()).limit(5).all()
34
+
35
+ # The number of run periods saved
36
+ rp_count = db.session.query(RunPeriod).count()
37
+
38
+ # 6. The last run period (by ID DESC, or whichever logic you prefer)
39
+ last_rp = db.session.query(RunPeriod).order_by(RunPeriod.id.desc()).first()
40
+
41
+ # Print it all
42
+ click.echo(f"Num, condition types: {cnd_type_count}")
43
+ click.echo(f"Num. condition values: {cnd_count}")
44
+ click.echo(f"Last condition date/time: {cnd_last_time}")
45
+ click.echo(f"Number of runs: {run_count}")
46
+ click.echo(f"Number of files: {file_count}")
47
+ click.echo("Last 5 runs saved: " + ", ".join(str(r.number) for r in last_5_runs) if last_5_runs else "No runs")
48
+ click.echo(f"Number of run periods: {rp_count}")
49
+ if last_rp:
50
+ click.echo(f"Last Run Period:")
51
+ click.echo(f" Name: {last_rp.name}")
52
+ click.echo(f" Description: {last_rp.name}")
53
+ click.echo(f" Run Range: {last_rp.run_min} - {last_rp.run_max}")
54
+ click.echo(f" Start Date: {last_rp.start_date}")
55
+ click.echo(f" End Date: {last_rp.end_date}")
56
+
57
+ # Finally, show all possible commands (help):
58
+ ctx = click.get_current_context()
59
+ click.echo("\nrun 'rcdb --help' for the list of available commands")
60
+
@@ -4,12 +4,12 @@ from rcdb.provider import RCDBProvider
4
4
  from .context import pass_rcdb_context
5
5
 
6
6
 
7
- @click.command()
7
+ @click.command(name="ls")
8
8
  @click.argument('search', required=False)
9
9
  @click.option('--long', '-l', 'is_long', is_flag=True, help='Prints condition full information')
10
10
  @pass_rcdb_context
11
- def ls(context, search, is_long):
12
- """Lists conditions"""
11
+ def ls_command(context, search, is_long):
12
+ """List conditions"""
13
13
 
14
14
  db = context.db
15
15
  assert isinstance(db, RCDBProvider)
@@ -0,0 +1,12 @@
1
+ import click
2
+ from .evio_files import evio_files_command
3
+
4
+
5
+ @click.group(name="repair")
6
+ def repair_command():
7
+ """ Group of commands that help repair and consolidate RCDB """
8
+ pass
9
+
10
+
11
+ repair_command.add_command(evio_files_command)
12
+
@@ -48,14 +48,14 @@ def read_run_directories(mask, run_min, run_max):
48
48
 
49
49
  return run_files
50
50
 
51
- @click.command()
51
+ @click.command(name="evio-files")
52
52
  @click.option('--run-range', required=False, default=None)
53
53
  @click.option('--mask', required=False, default="/gluex/data/rawdata/all/Run*111*")
54
54
  @click.option('--save-list', required=False, default=None, help="Save found evio files to json file with this name")
55
55
  @click.option('--load-list', required=False, default=None, help="Instead of scanning, load eviofiles from a list")
56
56
  @click.option('--execute', is_flag=True, required=False, default=False, help="Instead of scanning, load eviofiles from a list")
57
57
  @pass_rcdb_context
58
- def evio_files(ctx, run_range, mask, save_list, load_list, execute):
58
+ def evio_files_command(ctx, run_range, mask, save_list, load_list, execute):
59
59
  """
60
60
  Example of usage:
61
61
  # search /mss and save evio files to a json file list
@@ -9,9 +9,10 @@ from rcdb import RCDBProvider
9
9
  from rcdb.model import RunPeriod
10
10
  from rcdb.cli.context import pass_rcdb_context
11
11
 
12
- @click.group(invoke_without_command=True)
12
+
13
+ @click.group(name="rp", invoke_without_command=True)
13
14
  @click.pass_context
14
- def rp(context):
15
+ def rp_command(context):
15
16
  """
16
17
  Run Periods management commands.
17
18
 
@@ -38,7 +39,7 @@ def rp(context):
38
39
  print_run_periods(run_periods)
39
40
 
40
41
 
41
- @rp.command()
42
+ @rp_command.command()
42
43
  @click.option('--name', required=True, help="Name of the run period, e.g. RunPeriod-2025-01.")
43
44
  @click.option('--description', default='', help="Description of the run period.")
44
45
  @click.option('--run-min', 'run_min', required=True, type=int, help="Minimum run number in the period.")
@@ -90,7 +91,8 @@ def add(context, name, description, run_min, run_max, start_date, end_date):
90
91
 
91
92
  print(f"Added new run period: {new_period}")
92
93
 
93
- @rp.command()
94
+
95
+ @rp_command.command()
94
96
  @click.argument('period_id', type=int)
95
97
  @click.option('--yes', is_flag=True, help="Skip prompt confirmation and remove directly.")
96
98
  @pass_rcdb_context
@@ -122,7 +124,8 @@ def rm(context, period_id, yes):
122
124
  session.commit()
123
125
  print(f"Removed run period ID={period_id} ({rp_item.name}).")
124
126
 
125
- @rp.command()
127
+
128
+ @rp_command.command()
126
129
  @click.argument('period_id', type=int)
127
130
  @click.option('--name', default=None, help="New name of the run period.")
128
131
  @click.option('--description', default=None, help="New description of the run period.")
@@ -166,6 +169,7 @@ def update(context, period_id, name, description, run_min, run_max, start_date,
166
169
  session.commit()
167
170
  print(f"Updated run period ID={period_id}: {rp_item}")
168
171
 
172
+
169
173
  def print_run_periods(run_periods):
170
174
  # 1) Gather data strings and compute column widths
171
175
  # ------------------------------------------------
@@ -7,7 +7,7 @@ from .context import pass_rcdb_context
7
7
 
8
8
  @click.command("web")
9
9
  @pass_rcdb_context
10
- def web(context):
10
+ def web_command(context):
11
11
  """
12
12
  Runs the local RCDB web application using the connection string from
13
13
  either the CLI context or the RCDB_CONNECTION environment variable.
@@ -1,5 +1,5 @@
1
1
  # String version. Used both for setup.py and for internal code
2
- version = '2.2.7'
2
+ version = '2.2.9'
3
3
 
4
4
  # version as the tuple of ints
5
5
  version_tuple = tuple(int(val) for val in version.split('.'))
@@ -24,7 +24,7 @@ SQL_CONNECTION_STRING = "mysql+pymysql://rcdb@127.0.0.1/rcdb"
24
24
  # Get the current directory
25
25
  current_directory = os.path.dirname(os.path.abspath(__file__))
26
26
  template_folder=os.path.join(current_directory, 'templates')
27
- print(f"template_folder={template_folder}")
27
+
28
28
  # Create Flask app with custom template folder
29
29
  app = Flask(__name__, template_folder=template_folder)
30
30
 
@@ -1,17 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rcdb
3
- Version: 2.2.7
3
+ Version: 2.2.9
4
4
  Summary: RCDB - Run Conditions DataBase
5
5
  Author-email: Dmitry Romanov <romanov@jlab.org>
6
6
  License-Expression: MIT
7
- Classifier: Development Status :: 4 - Beta
7
+ Classifier: Development Status :: 5 - Production/Stable
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: Implementation :: CPython
14
15
  Classifier: Intended Audience :: Science/Research
16
+ Classifier: Intended Audience :: Developers
15
17
  Classifier: Operating System :: OS Independent
16
18
  Classifier: Topic :: Scientific/Engineering :: Physics
17
19
  Classifier: Topic :: Database
@@ -4,7 +4,6 @@ pyproject.toml
4
4
  ../README.md
5
5
  rcdb/__init__.py
6
6
  rcdb/__main__.py
7
- rcdb/admin_cmd.py
8
7
  rcdb/alias.py
9
8
  rcdb/app_context.py
10
9
  rcdb/coda_parser.py
@@ -32,8 +31,8 @@ rcdb/cli/__main__.py
32
31
  rcdb/cli/app.py
33
32
  rcdb/cli/context.py
34
33
  rcdb/cli/db.py
34
+ rcdb/cli/info.py
35
35
  rcdb/cli/ls.py
36
- rcdb/cli/mkdb.py
37
36
  rcdb/cli/rp.py
38
37
  rcdb/cli/run.py
39
38
  rcdb/cli/select.py
@@ -1,83 +0,0 @@
1
- import os
2
- import sys
3
- import posixpath
4
-
5
- import click
6
-
7
- from rcdb.app_context import RcdbApplicationContext, parse_run_range
8
- from rcdb import RCDBProvider
9
-
10
- pass_rcdb_context = click.make_pass_decorator(RcdbApplicationContext)
11
-
12
-
13
- def get_default_config_path():
14
- return os.path.join(os.path.expanduser('~'), '.rcdb_user')
15
-
16
-
17
- @click.group()
18
- @click.option('--user-config', envvar='RCDB_USER_CONFIG', default=get_default_config_path, metavar='PATH', help='Changes the user config location.')
19
- @click.option('--connection', '-c', envvar='RCDB_CONNECTION', help='Database connection string', default=None, required=True)
20
- @click.option('--config', nargs=2, multiple=True, metavar='KEY VALUE', help='Overrides a config key/value pair.')
21
- @click.option('--verbose', '-v', is_flag=True, help='Enables verbose mode.')
22
- @click.version_option('1.0')
23
- @click.pass_context
24
- def cli(ctx, user_config, connection, config, verbose):
25
- """'rcdb' is a RCDB (run conditions database) command line tool
26
-
27
- This tool allows to select runs and get values as well as manage RCDB values
28
- """
29
-
30
- # Create a rcdb_app_context object and remember it as as the context object. From
31
- # this point onwards other commands can refer to it by using the
32
- # @pass_rcdb_context decorator.
33
- ctx.obj = RcdbApplicationContext(os.path.abspath(user_config), connection)
34
- ctx.obj.verbose = verbose
35
- for key, value in config:
36
- ctx.obj.set_config(key, value)
37
-
38
-
39
- @cli.command(help="")
40
- @click.argument('search', required=False)
41
- @click.option('--long', '-l', 'is_long', is_flag=True, help='Prints condition full information')
42
- @pass_rcdb_context
43
- def walk(context, search, is_long):
44
- """Lists condition
45
-
46
-
47
- """
48
- db = context.db
49
- assert isinstance(db, RCDBProvider)
50
- cnd_types = db.get_condition_types_by_name()
51
- names = sorted(cnd_types.keys())
52
- if search:
53
- names = [n for n in names if search in n]
54
-
55
- longest_len = len(max(names, key=len))
56
- for name in names:
57
- cnd_type = cnd_types[name]
58
- click.echo("{0:<{1}} {2}".format(name, longest_len, cnd_type.description))
59
-
60
- @cli.command()
61
- @click.argument('search', required=False)
62
- @click.option('--long', '-l', 'is_long', is_flag=True, help='Prints condition full information')
63
- @pass_rcdb_context
64
- def ls(context, search, is_long):
65
- """Lists condition
66
-
67
-
68
- """
69
- db = context.db
70
- assert isinstance(db, RCDBProvider)
71
- cnd_types = db.get_condition_types_by_name()
72
- names = sorted(cnd_types.keys())
73
- if search:
74
- names = [n for n in names if search in n]
75
-
76
- longest_len = len(max(names, key=len))
77
- for name in names:
78
- cnd_type = cnd_types[name]
79
- click.echo("{0:<{1}} {2}".format(name, longest_len, cnd_type.description))
80
-
81
-
82
- if __name__ == '__main__':
83
- cli(prog_name="rcdb")
@@ -1,106 +0,0 @@
1
- import os
2
- import sys
3
- import posixpath
4
- import click
5
- from click import Command
6
-
7
- from rcdb.app_context import RcdbApplicationContext, parse_run_range
8
- from rcdb import RCDBProvider
9
- from rcdb.model import ConfigurationFile
10
-
11
- from .ls import ls as ls_cmd
12
- from .repair import repair as repair_grp
13
- from .db import db as db_grp
14
- from .rp import rp as rp_grp
15
- from .web import web as web_cmd
16
-
17
-
18
- pass_rcdb_context = click.make_pass_decorator(RcdbApplicationContext)
19
-
20
-
21
- def get_default_config_path():
22
- return os.path.join(os.path.expanduser('~'), '.rcdb_user')
23
-
24
-
25
- @click.group(invoke_without_command=True)
26
- @click.option('--user-config', envvar='RCDB_USER_CONFIG', default=get_default_config_path,
27
- metavar='PATH', help='Changes the user config location.')
28
- @click.option('--connection', '-c', envvar='RCDB_CONNECTION', help='Database connection string',
29
- default=None, required=False)
30
- @click.option('--config', nargs=2, multiple=True,
31
- metavar='KEY VALUE', help='Overrides a config key/value pair.')
32
- @click.option('--verbose', '-v', is_flag=True, help='Enables verbose mode.')
33
- @click.version_option('1.0')
34
- @click.pass_context
35
- def rcdb_cli(ctx, user_config, connection, config, verbose):
36
- """'rcdb' is a RCDB (run conditions database) command line tool
37
- This tool allows to select runs and get values as well as manage RCDB values
38
-
39
- RCDB CLI needs a DB connection string which could be provided via:
40
- - RCDB_CONNECTION environment variable
41
- - -c/--connection flag
42
- """
43
-
44
- # Create a rcdb_app_context object and remember it as the context object. From
45
- # this point onwards other commands can refer to it by using the
46
- # @pass_rcdb_context decorator.
47
- if not connection:
48
- print("(!)WARNING no connection provided! "
49
- "Provide DB connection string via --connection/-c or RCDB_CONNECTION environment variable.")
50
- ctx.obj = RcdbApplicationContext(os.path.abspath(user_config), connection)
51
- ctx.obj.verbose = verbose
52
- for key, value in config:
53
- ctx.obj.set_config(key, value)
54
-
55
- if ctx.invoked_subcommand is None:
56
- "No command was specified"
57
- click.echo(ctx.get_help())
58
-
59
-
60
- # Add ls command
61
- # noinspection PyTypeChecker
62
- rcdb_cli.add_command(ls_cmd)
63
-
64
- # Add 'repair' group of commands
65
- # noinspection PyTypeChecker
66
- rcdb_cli.add_command(repair_grp)
67
-
68
- # Add 'db' group of commands
69
- # noinspection PyTypeChecker
70
- rcdb_cli.add_command(db_grp)
71
-
72
- # Add 'rp' group of commands
73
- # noinspection PyTypeChecker
74
- rcdb_cli.add_command(rp_grp)
75
-
76
- # Add 'web' group of commands
77
- # noinspection PyTypeChecker
78
- rcdb_cli.add_command(web_cmd)
79
-
80
-
81
- @rcdb_cli.command()
82
- @pass_rcdb_context
83
- @click.argument('run', required=True)
84
- @click.option('--long', '-l', 'is_long', is_flag=True, help='Prints condition full information')
85
- def files(context, run, is_long):
86
- """
87
- Shows files stored for a current run:
88
-
89
- RUN: Run number to show files for
90
- """
91
- db = context.db
92
- assert isinstance(db, RCDBProvider)
93
-
94
- run = db.get_run(int(run))
95
-
96
- for file in run.files:
97
- assert isinstance(file, ConfigurationFile)
98
- click.echo(file.path)
99
-
100
-
101
- def cat():
102
- pass
103
-
104
- def dump():
105
- pass
106
-
@@ -1,27 +0,0 @@
1
- import click
2
-
3
- from rcdb.provider import RCDBProvider
4
- from .context import pass_rcdb_context
5
-
6
-
7
- @click.command()
8
- @click.argument('search', required=False)
9
- @click.option('--long', '-l', 'is_long', is_flag=True, help='Prints condition full information')
10
- @pass_rcdb_context
11
- def mkdb(context, search, is_long):
12
- """Lists conditions"""
13
-
14
- print(context)
15
- exit(0)
16
-
17
- db = context.db
18
- assert isinstance(db, RCDBProvider)
19
- cnd_types = db.get_condition_types_by_name()
20
- names = sorted(cnd_types.keys())
21
- if search:
22
- names = [n for n in names if search in n]
23
-
24
- longest_len = len(max(names, key=len))
25
- for name in names:
26
- cnd_type = cnd_types[name]
27
- click.echo("{0:<{1}} {2}".format(name, longest_len, cnd_type.description))
@@ -1,13 +0,0 @@
1
- import click
2
- from . import evio_files
3
-
4
- @click.group()
5
- def repair():
6
- """
7
- Group of commands that help repair and consolidate RCDB
8
- """
9
- pass
10
-
11
-
12
- repair.add_command(evio_files.evio_files)
13
-
File without changes
File without changes
File without changes