pygitweb 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. pygitweb/__init__.py +22 -0
  2. pygitweb/__meta__.py +9 -0
  3. pygitweb/actions.py +1303 -0
  4. pygitweb/addproject_permissions_test.py +114 -0
  5. pygitweb/api/__init__.py +0 -0
  6. pygitweb/api/action.py +20 -0
  7. pygitweb/api/plugins/__init__.py +0 -0
  8. pygitweb/api/plugins/project_zip.py +71 -0
  9. pygitweb/api/project.py +67 -0
  10. pygitweb/api/subpage.py +22 -0
  11. pygitweb/auth.py +387 -0
  12. pygitweb/auth.schema.json +106 -0
  13. pygitweb/auth_config.py +243 -0
  14. pygitweb/auth_oauth.py +343 -0
  15. pygitweb/auth_test.py +390 -0
  16. pygitweb/boards_permissions_test.py +113 -0
  17. pygitweb/change_queue.py +110 -0
  18. pygitweb/change_queue_routes_test.py +146 -0
  19. pygitweb/change_queue_test.py +91 -0
  20. pygitweb/comments_permissions_test.py +140 -0
  21. pygitweb/config.py +185 -0
  22. pygitweb/conftest.py +43 -0
  23. pygitweb/dependencies.py +87 -0
  24. pygitweb/formatting.py +182 -0
  25. pygitweb/formatting_test.py +68 -0
  26. pygitweb/git_helpers.py +454 -0
  27. pygitweb/git_helpers_test.py +223 -0
  28. pygitweb/gravatar.py +16 -0
  29. pygitweb/gravatar_test.py +10 -0
  30. pygitweb/hooks_install.py +278 -0
  31. pygitweb/hooks_install_test.py +363 -0
  32. pygitweb/hooks_permissions_test.py +116 -0
  33. pygitweb/main.py +887 -0
  34. pygitweb/merge_requests.py +230 -0
  35. pygitweb/merge_requests_test.py +85 -0
  36. pygitweb/mr_permissions_test.py +148 -0
  37. pygitweb/password_hash.py +74 -0
  38. pygitweb/password_hash_test.py +20 -0
  39. pygitweb/permissions.py +209 -0
  40. pygitweb/permissions_test.py +86 -0
  41. pygitweb/plugin_loader.py +83 -0
  42. pygitweb/projects.py +213 -0
  43. pygitweb/projects_test.py +186 -0
  44. pygitweb/sessions.py +73 -0
  45. pygitweb/settings.py +412 -0
  46. pygitweb/settings.schema.json +73 -0
  47. pygitweb/settings_config.py +122 -0
  48. pygitweb/settings_config_test.py +101 -0
  49. pygitweb/settings_permissions_test.py +76 -0
  50. pygitweb/static/blob-view.js +133 -0
  51. pygitweb/static/board.js +839 -0
  52. pygitweb/static/hook-install.js +53 -0
  53. pygitweb/static/icons/cloud-down.svg +1 -0
  54. pygitweb/static/icons/cloud-exclamation.svg +1 -0
  55. pygitweb/static/icons/cloud-filled.svg +1 -0
  56. pygitweb/static/icons/cloud-storm.svg +1 -0
  57. pygitweb/static/icons/cloud-up.svg +1 -0
  58. pygitweb/static/icons/cloud.svg +1 -0
  59. pygitweb/static/logo.svg +44 -0
  60. pygitweb/static/main.css +1210 -0
  61. pygitweb/static/navbar-auth.js +82 -0
  62. pygitweb/static/readme-render.js +174 -0
  63. pygitweb/static/search-page.js +139 -0
  64. pygitweb/static/summary-ref-switcher.js +130 -0
  65. pygitweb/static/themes/solarized.css +34 -0
  66. pygitweb/tasks.py +595 -0
  67. pygitweb/tasks_permissions_test.py +137 -0
  68. pygitweb/tasks_routes_test.py +430 -0
  69. pygitweb/templates/addproject.html +174 -0
  70. pygitweb/templates/blobdiff.html +57 -0
  71. pygitweb/templates/board.html +31 -0
  72. pygitweb/templates/board_card.html +44 -0
  73. pygitweb/templates/commitdiff.html +57 -0
  74. pygitweb/templates/hooks_summary_cell.html +37 -0
  75. pygitweb/templates/login.html +37 -0
  76. pygitweb/templates/merge_request_summary_cell.html +18 -0
  77. pygitweb/templates/merge_request_tag.html +90 -0
  78. pygitweb/templates/pagination.html +44 -0
  79. pygitweb/templates/preamble.html +89 -0
  80. pygitweb/templates/project_settings.html +13 -0
  81. pygitweb/templates/pygit2_settings.html +12 -0
  82. pygitweb/templates/pygitweb_settings.html +12 -0
  83. pygitweb/templates/search.html +77 -0
  84. pygitweb/templates/settings_form_field.html +27 -0
  85. pygitweb/templates/table.html +15 -0
  86. pygitweb/templates/user_profile.html +10 -0
  87. pygitweb/templates_env.py +21 -0
  88. pygitweb/timeline_cache.py +243 -0
  89. pygitweb/validation.py +75 -0
  90. pygitweb/validation_test.py +167 -0
  91. pygitweb-0.1.0.dist-info/METADATA +165 -0
  92. pygitweb-0.1.0.dist-info/RECORD +95 -0
  93. pygitweb-0.1.0.dist-info/WHEEL +5 -0
  94. pygitweb-0.1.0.dist-info/licenses/LICENSE +21 -0
  95. pygitweb-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,53 @@
1
+ (() => {
2
+ const postHookOp = async (project, sample, op, btn) => {
3
+ btn.disabled = true;
4
+ const params = new URLSearchParams({ name: sample, op });
5
+ try {
6
+ const resp = await fetch(`/project/${project}/hook?${params.toString()}`, {
7
+ method: "POST",
8
+ headers: { Accept: "application/json" },
9
+ });
10
+ if (!resp.ok) {
11
+ const detail = await resp.text();
12
+ window.alert(`Hook ${op} failed (${resp.status}): ${detail}`);
13
+ btn.disabled = false;
14
+ return;
15
+ }
16
+ window.location.reload();
17
+ } catch (err) {
18
+ window.alert(`Hook ${op} failed: ${err}`);
19
+ btn.disabled = false;
20
+ }
21
+ };
22
+
23
+ const handleClick = async (event) => {
24
+ const uninstallBtn = event.target.closest(".hook-toggle");
25
+ if (uninstallBtn) {
26
+ event.preventDefault();
27
+ const project = uninstallBtn.dataset.project;
28
+ const sample = uninstallBtn.dataset.sample;
29
+ const op = uninstallBtn.dataset.op;
30
+ if (!project || !sample || !op) {
31
+ return;
32
+ }
33
+ await postHookOp(project, sample, op, uninstallBtn);
34
+ return;
35
+ }
36
+
37
+ const installBtn = event.target.closest(".hook-install-btn");
38
+ if (!installBtn) {
39
+ return;
40
+ }
41
+ event.preventDefault();
42
+ const project = installBtn.dataset.project;
43
+ const op = installBtn.dataset.op;
44
+ const select = document.getElementById("hook-install-select");
45
+ const sample = select instanceof HTMLSelectElement ? select.value : "";
46
+ if (!project || !sample || !op) {
47
+ return;
48
+ }
49
+ await postHookOp(project, sample, op, installBtn);
50
+ };
51
+
52
+ document.addEventListener("click", handleClick);
53
+ })();
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cloud-down"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 18.004h-5.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.38 0 2.573 .813 3.13 1.99" /><path d="M19 16v6" /><path d="M22 19l-3 3l-3 -3" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cloud-exclamation"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 18.004h-8.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.374 0 2.562 .805 3.121 1.972" /><path d="M19 16v3" /><path d="M19 22v.01" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" class="icon icon-tabler icons-tabler-filled icon-tabler-cloud"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.04 4.305c2.195 -.667 4.615 -.224 6.36 1.176c1.386 1.108 2.188 2.686 2.252 4.34l.003 .212l.091 .003c2.3 .107 4.143 1.961 4.25 4.27l.004 .211c0 2.407 -1.885 4.372 -4.255 4.482l-.21 .005h-11.878l-.222 -.008c-2.94 -.11 -5.317 -2.399 -5.43 -5.263l-.005 -.216c0 -2.747 2.08 -5.01 4.784 -5.417l.114 -.016l.07 -.181c.663 -1.62 2.056 -2.906 3.829 -3.518l.244 -.08z" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cloud-storm"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1" /><path d="M13 14l-2 4l3 0l-2 4" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cloud-up"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 18.004h-5.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.38 0 2.57 .811 3.128 1.986" /><path d="M19 22v-6" /><path d="M22 19l-3 -3l-3 3" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cloud"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878" /></svg>
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ width="200mm"
6
+ height="200mm"
7
+ viewBox="0 0 200 200"
8
+ version="1.1"
9
+ id="svg1"
10
+ xml:space="preserve"
11
+ inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
12
+ sodipodi:docname="logo.svg"
13
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
14
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
17
+ id="namedview1"
18
+ pagecolor="#505050"
19
+ bordercolor="#eeeeee"
20
+ borderopacity="1"
21
+ inkscape:showpageshadow="0"
22
+ inkscape:pageopacity="0"
23
+ inkscape:pagecheckerboard="0"
24
+ inkscape:deskcolor="#505050"
25
+ inkscape:document-units="mm"
26
+ inkscape:zoom="1"
27
+ inkscape:cx="323.5"
28
+ inkscape:cy="530.5"
29
+ inkscape:window-width="2560"
30
+ inkscape:window-height="1377"
31
+ inkscape:window-x="-8"
32
+ inkscape:window-y="-8"
33
+ inkscape:window-maximized="1"
34
+ inkscape:current-layer="svg1" /><defs
35
+ id="defs1" /><path
36
+ style="display:inline;fill:#d1caa1;fill-opacity:1"
37
+ d="m 97.817306,196.01379 c -3.976529,-0.62308 -4.916609,-1.33611 -14.942115,-11.33339 l -8.54507,-8.52101 11.921972,-12.41383 11.921972,-12.41382 1.66968,-0.10808 c 2.896735,-0.18751 4.919985,-1.45651 6.076255,-3.81107 0.52443,-1.06793 0.64305,-1.62247 0.65685,-3.07052 l 0.0168,-1.76721 17.29996,-18.01769 17.29997,-18.01769 h 1.50968 c 2.89943,0 5.10893,-1.3424 6.33535,-3.84912 0.53364,-1.09072 0.63871,-1.59718 0.62889,-3.031258 -0.019,-2.77173 -1.30296,-4.820704 -3.83881,-6.126024 -0.96933,-0.49896 -1.51901,-0.61659 -2.96481,-0.63443 l -1.77487,-0.0219 -17.26451,-17.70036 -17.26451,-17.70035 0.0172,-1.89942 0.0172,-1.89942 11.91107,-12.423755 11.91107,-12.423751 30.00676,29.966026 c 16.50372,16.48131 30.51614,30.63699 31.1387,31.45706 3.69979,4.87355 4.15422,11.494262 1.18874,17.318962 -0.76292,1.4985 -3.62223,4.41455 -42.81597,43.66553 -24.2034,24.23874 -42.50117,42.38793 -43.18491,42.83423 -2.37122,1.54779 -6.17366,2.37459 -8.932604,1.94229 z"
38
+ id="path16" /><path
39
+ style="display:inline;fill:#66717e;fill-opacity:1"
40
+ d="M 38.70616,140.50922 C 5.3912695,107.1585 7.0026395,108.89534 5.5943025,104.81906 c -0.568758,-1.64622 -0.63461,-2.15391 -0.639707,-4.931888 -0.0065,-3.53901 0.260176,-4.698864 1.766823,-7.684574 0.912758,-1.80881 1.520044,-2.42915 42.3536585,-43.26423 L 90.502699,7.509257 92.452516,6.571881 c 2.673739,-1.2854018 4.465959,-1.7109258 7.22579,-1.7156068 3.580634,-0.0061 6.154394,0.761741 9.043644,2.6979328 0.93676,0.627756 4.39693,3.905702 9.13134,8.65045 l 7.62303,7.639679 -11.94859,12.444415 -11.94858,12.444417 h -1.57264 c -2.293034,0 -3.808064,0.63413 -5.228694,2.18852 -1.435912,1.57112 -1.942184,2.99117 -1.832086,5.13886 l 0.08026,1.56565 -17.089566,17.80306 -17.089564,17.80306 -1.50752,10e-4 c -1.958276,0.002 -3.376441,0.50219 -4.684148,1.65328 -1.619739,1.425754 -2.268187,2.878364 -2.283337,5.114992 -0.01608,2.37328 0.741107,4.06081 2.416148,5.38485 1.429386,1.12987 2.456775,1.47446 4.433037,1.48689 l 1.585644,0.01 17.109653,17.78547 17.109653,17.78546 v 2.03949 2.03949 l -9.153703,9.53698 c -5.034537,5.24534 -10.369101,10.78469 -11.854588,12.30966 l -2.700884,2.77268 z"
41
+ id="path17" /><path
42
+ style="display:inline;fill:#d4d6b9;fill-opacity:1"
43
+ d="m 81.019002,119.80676 -17.125558,-17.81509 0.01474,-1.94288 0.01474,-1.942868 17.142156,-17.849074 17.142155,-17.84907 1.63417,-0.0144 1.634164,-0.0144 17.29749,17.71122 17.2975,17.711234 0.018,1.93767 0.018,1.937668 -17.25738,17.96613 -17.25737,17.96612 -1.723634,0.006 -1.72363,0.006 z"
44
+ id="path18" /></svg>