datasette-debug-gotham 0.1.0a1__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.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: datasette-debug-gotham
3
+ Version: 0.1.0a1
4
+ Summary: A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
5
+ Author: Alex Garcia
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/datasette/datasette-debug-gotham
8
+ Project-URL: Changelog, https://github.com/datasette/datasette-debug-gotham/releases
9
+ Project-URL: Issues, https://github.com/datasette/datasette-debug-gotham/issues
10
+ Project-URL: CI, https://github.com/datasette/datasette-debug-gotham/actions
11
+ Classifier: Framework :: Datasette
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: datasette
16
+ Dynamic: license-file
17
+
18
+ # datasette-debug-gotham
19
+
20
+ [![PyPI](https://img.shields.io/pypi/v/datasette-debug-gotham.svg)](https://pypi.org/project/datasette-debug-gotham/)
21
+ [![Changelog](https://img.shields.io/github/v/release/datasette/datasette-debug-gotham?include_prereleases&label=changelog)](https://github.com/datasette/datasette-debug-gotham/releases)
22
+ [![Tests](https://github.com/datasette/datasette-debug-gotham/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-debug-gotham/actions/workflows/test.yml)
23
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-debug-gotham/blob/main/LICENSE)
24
+
25
+ A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
@@ -0,0 +1,8 @@
1
+ # datasette-debug-gotham
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/datasette-debug-gotham.svg)](https://pypi.org/project/datasette-debug-gotham/)
4
+ [![Changelog](https://img.shields.io/github/v/release/datasette/datasette-debug-gotham?include_prereleases&label=changelog)](https://github.com/datasette/datasette-debug-gotham/releases)
5
+ [![Tests](https://github.com/datasette/datasette-debug-gotham/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-debug-gotham/actions/workflows/test.yml)
6
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-debug-gotham/blob/main/LICENSE)
7
+
8
+ A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
@@ -0,0 +1,78 @@
1
+ from datasette import hookimpl
2
+
3
+
4
+ def pfp(letter, fg="white", bg="black"):
5
+ return f"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='16' fill='{bg}'%3E%3C/circle%3E%3Ctext fill='{fg}' x='16' y='16' text-anchor='middle' dominant-baseline='middle'%3E{letter}%3C/text%3E%3C/svg%3E"
6
+
7
+
8
+ ACTORS = {
9
+ ###### DAILY PLANET ######
10
+ "clark": {
11
+ "id": "clark",
12
+ "name": "Clark Kent",
13
+ "newsroom": "daily-planet",
14
+ "profile_picture_url": pfp("C", bg="blue"),
15
+ },
16
+ "lois": {
17
+ "id": "lois",
18
+ "name": "Lois Lane",
19
+ "newsroom": "daily-planet",
20
+ "profile_picture_url": pfp("L", bg="red"),
21
+ },
22
+ "jimmy": {
23
+ "id": "jimmy",
24
+ "name": "Jimmy Olsen",
25
+ "newsroom": "daily-planet",
26
+ "profile_picture_url": pfp("J", bg="orange"),
27
+ },
28
+ ###### GOTHAM GAZETTE ######
29
+ "bruce": {
30
+ "id": "bruce",
31
+ "name": "Bruce Wayne",
32
+ "newsroom": "gotham-gazette",
33
+ "profile_picture_url": pfp("B", bg="black"),
34
+ },
35
+ "alfred": {
36
+ "id": "alfred",
37
+ "name": "Alfred Pennyworth",
38
+ "newsroom": "gotham-gazette",
39
+ "profile_picture_url": pfp("A", bg="gray"),
40
+ },
41
+ "selina": {
42
+ "id": "selina",
43
+ "name": "Selina Kyle",
44
+ "newsroom": "gotham-gazette",
45
+ "profile_picture_url": pfp("S", bg="purple"),
46
+ },
47
+ }
48
+
49
+
50
+ @hookimpl
51
+ def actor_from_request(datasette, request):
52
+ actor_id = request.cookies.get("actor")
53
+ for key in ACTORS:
54
+ if key == actor_id:
55
+ return ACTORS[key]
56
+
57
+
58
+ @hookimpl
59
+ def actors_from_ids(datasette, actor_ids):
60
+ return ACTORS
61
+
62
+
63
+ @hookimpl
64
+ def datasette_comments_mentioned(datasette):
65
+ return "Response from this plugin hook"
66
+
67
+
68
+ @hookimpl
69
+ def datasette_comments_users():
70
+ async def inner():
71
+ return list(ACTORS.values())
72
+
73
+ return inner
74
+
75
+
76
+ @hookimpl
77
+ def extra_js_urls(template, database, table, columns, view_name, request, datasette):
78
+ return [datasette.urls.static_plugins("datasette_debug_gotham", "widget.js")]
@@ -0,0 +1,187 @@
1
+ /*
2
+ * USER SWITCHING DEBUG WIDGET
3
+ *
4
+ * ORIGINAL PROMPT:
5
+ * Create a single-file JavaScript solution (no dependencies) that adds a debugging
6
+ * "user switching" widget. Requirements:
7
+ * - Widget positioned at bottom right of screen, always on top
8
+ * - Shows current user and provides dropdown to change users
9
+ * - Six users across two newsrooms:
10
+ * - Daily Planet: clark, lois, jimmy
11
+ * - Gotham Gazette: bruce, alfred, selina
12
+ * - When user is selected, set cookie named "actor" to the selected user's name
13
+ * - Include small SVG icons to distinguish between the two newsrooms
14
+ * - Default user is clark
15
+ * - Provide basic test index.html showing current "logged in" user
16
+ *
17
+ * IMPLEMENTATION DETAILS:
18
+ *
19
+ * Data Structure:
20
+ * - users array contains objects with { name, newsroom } properties
21
+ * - Two newsrooms: 'daily-planet' and 'gotham-gazette'
22
+ *
23
+ * Cookie Management:
24
+ * - setCookie(name, value, days) - stores cookie with 365 day expiration by default
25
+ * - getCookie(name) - retrieves cookie value
26
+ * - Cookie name is "actor", value is the user's name (e.g., "clark")
27
+ *
28
+ * Widget Components:
29
+ * - Fixed position div at bottom: 20px, right: 20px
30
+ * - z-index: 999999 to ensure always on top
31
+ * - Displays: debug label, current user icon, current user name, newsroom, and dropdown
32
+ * - Dropdown (<select>) lists all 6 users with their newsroom in parentheses
33
+ *
34
+ * SVG Icons:
35
+ * - daily-planet: Blue circle with white center (planet-like)
36
+ * - gotham-gazette: Dark square with white X (edgier/darker theme)
37
+ * - Icons are 16x16px, stored in icons object keyed by newsroom name
38
+ *
39
+ * Functionality:
40
+ * - getCurrentUser() reads "actor" cookie and returns matching user object (defaults to clark)
41
+ * - createWidget() builds and injects the widget HTML into document.body
42
+ * - Change event on dropdown updates cookie and refreshes both widget and page displays
43
+ * - updatePageDisplay() updates elements with IDs 'current-user' and 'current-newsroom' if present
44
+ * - Widget initializes on DOMContentLoaded event
45
+ *
46
+ * Styling:
47
+ * - Widget: white background, rounded corners, shadow, bordered
48
+ * - Dropdown: full width, styled with padding and border radius
49
+ * - Demo page: centered content card with user info display
50
+ *
51
+ * Usage:
52
+ * - Drop the <script> section into any HTML page
53
+ * - Widget will appear automatically on page load
54
+ * - User selection persists across page refreshes via cookie
55
+ * - No external dependencies required
56
+ */
57
+
58
+ // User data
59
+ const users = [
60
+ { name: 'clark', newsroom: 'daily-planet' },
61
+ { name: 'lois', newsroom: 'daily-planet' },
62
+ { name: 'jimmy', newsroom: 'daily-planet' },
63
+ { name: 'bruce', newsroom: 'gotham-gazette' },
64
+ { name: 'alfred', newsroom: 'gotham-gazette' },
65
+ { name: 'selina', newsroom: 'gotham-gazette' }
66
+ ];
67
+
68
+ // Cookie utilities
69
+ function setCookie(name, value, days = 365) {
70
+ const date = new Date();
71
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
72
+ document.cookie = `${name}=${value};expires=${date.toUTCString()};path=/`;
73
+ // refresh page
74
+ location.reload();
75
+ }
76
+
77
+ function getCookie(name) {
78
+ const nameEQ = name + "=";
79
+ const ca = document.cookie.split(';');
80
+ for (let i = 0; i < ca.length; i++) {
81
+ let c = ca[i];
82
+ while (c.charAt(0) === ' ') c = c.substring(1, c.length);
83
+ if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
84
+ }
85
+ return null;
86
+ }
87
+
88
+ // Get current user
89
+ function getCurrentUser() {
90
+ let actorName = getCookie('actor');
91
+ if (!actorName) {
92
+ // No actor cookie found, set clark as default
93
+ actorName = 'clark';
94
+ setCookie('actor', actorName);
95
+ }
96
+ return users.find(u => u.name === actorName) || users[0];
97
+ }
98
+
99
+ // SVG icons for newsrooms
100
+ const icons = {
101
+ 'daily-planet': `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
102
+ <circle cx="8" cy="8" r="6" fill="#0066cc" stroke="#004499" stroke-width="1.5"/>
103
+ <circle cx="8" cy="8" r="2" fill="white"/>
104
+ </svg>`,
105
+ 'gotham-gazette': `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
106
+ <rect x="2" y="2" width="12" height="12" fill="#333" stroke="#000" stroke-width="1.5"/>
107
+ <path d="M5 5 L11 11 M11 5 L5 11" stroke="#fff" stroke-width="2"/>
108
+ </svg>`
109
+ };
110
+
111
+ // Create widget
112
+ function createWidget() {
113
+ const widget = document.createElement('div');
114
+ widget.id = 'user-switch-widget';
115
+ widget.style.cssText = `
116
+ position: fixed;
117
+ bottom: 20px;
118
+ right: 20px;
119
+ background: white;
120
+ border: 2px solid #ddd;
121
+ border-radius: 8px;
122
+ padding: 12px 16px;
123
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
124
+ z-index: 999999;
125
+ font-family: Arial, sans-serif;
126
+ font-size: 14px;
127
+ min-width: 200px;
128
+ `;
129
+
130
+ const currentUser = getCurrentUser();
131
+
132
+ widget.innerHTML = `
133
+ <div style="margin-bottom: 8px; font-weight: bold; color: #666; font-size: 11px; text-transform: uppercase;">
134
+ Debug: User Switch
135
+ </div>
136
+ <div style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px;">
137
+ <span id="current-icon">${icons[currentUser.newsroom]}</span>
138
+ <span id="current-actor" style="font-weight: bold; color: #333;">${currentUser.name}</span>
139
+ <span style="color: #999; font-size: 12px;">(${currentUser.newsroom})</span>
140
+ </div>
141
+ <select id="user-selector" style="
142
+ width: 100%;
143
+ padding: 6px 8px;
144
+ border: 1px solid #ccc;
145
+ border-radius: 4px;
146
+ font-size: 14px;
147
+ cursor: pointer;
148
+ background: white;
149
+ ">
150
+ ${users.map(user => `
151
+ <option value="${user.name}" ${user.name === currentUser.name ? 'selected' : ''}>
152
+ ${user.name} (${user.newsroom})
153
+ </option>
154
+ `).join('')}
155
+ </select>
156
+ `;
157
+
158
+ document.body.appendChild(widget);
159
+
160
+ // Add change listener
161
+ document.getElementById('user-selector').addEventListener('change', function(e) {
162
+ const selectedUser = users.find(u => u.name === e.target.value);
163
+ setCookie('actor', selectedUser.name);
164
+
165
+ // Update widget display
166
+ document.getElementById('current-icon').innerHTML = icons[selectedUser.newsroom];
167
+ document.getElementById('current-actor').textContent = selectedUser.name;
168
+
169
+ // Update main page display if elements exist
170
+ updatePageDisplay(selectedUser);
171
+ });
172
+ }
173
+
174
+ // Update page display
175
+ function updatePageDisplay(user) {
176
+ const userEl = document.getElementById('current-user');
177
+ const newsroomEl = document.getElementById('current-newsroom');
178
+ if (userEl) userEl.textContent = user.name;
179
+ if (newsroomEl) newsroomEl.textContent = user.newsroom;
180
+ }
181
+
182
+ // Initialize
183
+ window.addEventListener('DOMContentLoaded', function() {
184
+ const currentUser = getCurrentUser();
185
+ updatePageDisplay(currentUser);
186
+ createWidget();
187
+ });
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: datasette-debug-gotham
3
+ Version: 0.1.0a1
4
+ Summary: A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
5
+ Author: Alex Garcia
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/datasette/datasette-debug-gotham
8
+ Project-URL: Changelog, https://github.com/datasette/datasette-debug-gotham/releases
9
+ Project-URL: Issues, https://github.com/datasette/datasette-debug-gotham/issues
10
+ Project-URL: CI, https://github.com/datasette/datasette-debug-gotham/actions
11
+ Classifier: Framework :: Datasette
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: datasette
16
+ Dynamic: license-file
17
+
18
+ # datasette-debug-gotham
19
+
20
+ [![PyPI](https://img.shields.io/pypi/v/datasette-debug-gotham.svg)](https://pypi.org/project/datasette-debug-gotham/)
21
+ [![Changelog](https://img.shields.io/github/v/release/datasette/datasette-debug-gotham?include_prereleases&label=changelog)](https://github.com/datasette/datasette-debug-gotham/releases)
22
+ [![Tests](https://github.com/datasette/datasette-debug-gotham/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-debug-gotham/actions/workflows/test.yml)
23
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-debug-gotham/blob/main/LICENSE)
24
+
25
+ A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ datasette_debug_gotham/__init__.py
5
+ datasette_debug_gotham.egg-info/PKG-INFO
6
+ datasette_debug_gotham.egg-info/SOURCES.txt
7
+ datasette_debug_gotham.egg-info/dependency_links.txt
8
+ datasette_debug_gotham.egg-info/entry_points.txt
9
+ datasette_debug_gotham.egg-info/requires.txt
10
+ datasette_debug_gotham.egg-info/top_level.txt
11
+ datasette_debug_gotham/static/widget.js
12
+ tests/test_debug_gotham.py
@@ -0,0 +1,2 @@
1
+ [datasette]
2
+ debug_gotham = datasette_debug_gotham
@@ -0,0 +1 @@
1
+ datasette_debug_gotham
@@ -0,0 +1,42 @@
1
+ [project]
2
+ name = "datasette-debug-gotham"
3
+ version = "0.1.0a1"
4
+ description = "A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)"
5
+ readme = "README.md"
6
+ authors = [{name = "Alex Garcia"}]
7
+ license = "Apache-2.0"
8
+ classifiers=[
9
+ "Framework :: Datasette"
10
+ ]
11
+ requires-python = ">=3.10"
12
+ dependencies = [
13
+ "datasette"
14
+ ]
15
+
16
+ [dependency-groups]
17
+ dev = [
18
+ "pytest",
19
+ "pytest-asyncio"
20
+ ]
21
+
22
+ [build-system]
23
+ requires = ["setuptools"]
24
+ build-backend = "setuptools.build_meta"
25
+
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/datasette/datasette-debug-gotham"
29
+ Changelog = "https://github.com/datasette/datasette-debug-gotham/releases"
30
+ Issues = "https://github.com/datasette/datasette-debug-gotham/issues"
31
+ CI = "https://github.com/datasette/datasette-debug-gotham/actions"
32
+
33
+ [project.entry-points.datasette]
34
+ debug_gotham = "datasette_debug_gotham"
35
+
36
+ [tool.pytest.ini_options]
37
+ asyncio_mode = "strict"
38
+ asyncio_default_fixture_loop_scope = "function"
39
+
40
+ [tool.setuptools.package-data]
41
+ datasette_debug_gotham = ["static/*", "templates/*"]
42
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ from datasette.app import Datasette
2
+ import pytest
3
+
4
+
5
+ @pytest.mark.asyncio
6
+ async def test_plugin_is_installed():
7
+ datasette = Datasette(memory=True)
8
+ response = await datasette.client.get("/-/plugins.json")
9
+ assert response.status_code == 200
10
+ installed_plugins = {p["name"] for p in response.json()}
11
+ assert "datasette-debug-gotham" in installed_plugins