pretix-posthog 1.1.2__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.
- pretix_posthog-1.1.2/LICENSE +15 -0
- pretix_posthog-1.1.2/MANIFEST.in +5 -0
- pretix_posthog-1.1.2/PKG-INFO +67 -0
- pretix_posthog-1.1.2/README.rst +53 -0
- pretix_posthog-1.1.2/pretix_posthog/__init__.py +1 -0
- pretix_posthog-1.1.2/pretix_posthog/apps.py +26 -0
- pretix_posthog-1.1.2/pretix_posthog/locale/de/LC_MESSAGES/django.mo +0 -0
- pretix_posthog-1.1.2/pretix_posthog/locale/de/LC_MESSAGES/django.po +12 -0
- pretix_posthog-1.1.2/pretix_posthog/locale/de_Informal/.gitkeep +0 -0
- pretix_posthog-1.1.2/pretix_posthog/locale/de_Informal/LC_MESSAGES/django.mo +0 -0
- pretix_posthog-1.1.2/pretix_posthog/locale/de_Informal/LC_MESSAGES/django.po +12 -0
- pretix_posthog-1.1.2/pretix_posthog/signals.py +110 -0
- pretix_posthog-1.1.2/pretix_posthog/static/pretix_posthog/.gitkeep +0 -0
- pretix_posthog-1.1.2/pretix_posthog/templates/pretix_posthog/.gitkeep +0 -0
- pretix_posthog-1.1.2/pretix_posthog/templates/pretix_posthog/settings.html +19 -0
- pretix_posthog-1.1.2/pretix_posthog/urls.py +11 -0
- pretix_posthog-1.1.2/pretix_posthog/views.py +43 -0
- pretix_posthog-1.1.2/pretix_posthog.egg-info/PKG-INFO +67 -0
- pretix_posthog-1.1.2/pretix_posthog.egg-info/SOURCES.txt +26 -0
- pretix_posthog-1.1.2/pretix_posthog.egg-info/dependency_links.txt +1 -0
- pretix_posthog-1.1.2/pretix_posthog.egg-info/entry_points.txt +5 -0
- pretix_posthog-1.1.2/pretix_posthog.egg-info/requires.txt +1 -0
- pretix_posthog-1.1.2/pretix_posthog.egg-info/top_level.txt +1 -0
- pretix_posthog-1.1.2/pyproject.toml +43 -0
- pretix_posthog-1.1.2/setup.cfg +49 -0
- pretix_posthog-1.1.2/setup.py +4 -0
- pretix_posthog-1.1.2/tests/test_main.py +3 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright 2024 Daniel Malik
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pretix-posthog
|
|
3
|
+
Version: 1.1.2
|
|
4
|
+
Summary: PostHog Integration for Pretix
|
|
5
|
+
Author-email: Daniel Malik <daniel@binarycollective.de>
|
|
6
|
+
Maintainer-email: Daniel Malik <daniel@binarycollective.de>
|
|
7
|
+
License: Apache
|
|
8
|
+
Project-URL: homepage, https://github.com/fronbasal/pretix-posthog
|
|
9
|
+
Project-URL: repository, https://github.com/fronbasal/pretix-posthog
|
|
10
|
+
Keywords: pretix
|
|
11
|
+
Description-Content-Type: text/x-rst
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: posthog>=3.5
|
|
14
|
+
|
|
15
|
+
PostHog
|
|
16
|
+
==========================
|
|
17
|
+
|
|
18
|
+
This is a plugin for `pretix`_.
|
|
19
|
+
|
|
20
|
+
PostHog Integration for Pretix
|
|
21
|
+
|
|
22
|
+
Development setup
|
|
23
|
+
-----------------
|
|
24
|
+
|
|
25
|
+
1. Make sure that you have a working `pretix development setup`_.
|
|
26
|
+
|
|
27
|
+
2. Clone this repository.
|
|
28
|
+
|
|
29
|
+
3. Activate the virtual environment you use for pretix development.
|
|
30
|
+
|
|
31
|
+
4. Execute ``python setup.py develop`` within this directory to register this application with pretix's plugin registry.
|
|
32
|
+
|
|
33
|
+
5. Execute ``make`` within this directory to compile translations.
|
|
34
|
+
|
|
35
|
+
6. Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in
|
|
36
|
+
the 'plugins' tab in the settings.
|
|
37
|
+
|
|
38
|
+
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed::
|
|
39
|
+
|
|
40
|
+
pip install flake8 isort black
|
|
41
|
+
|
|
42
|
+
To check your plugin for rule violations, run::
|
|
43
|
+
|
|
44
|
+
black --check .
|
|
45
|
+
isort -c .
|
|
46
|
+
flake8 .
|
|
47
|
+
|
|
48
|
+
You can auto-fix some of these issues by running::
|
|
49
|
+
|
|
50
|
+
isort .
|
|
51
|
+
black .
|
|
52
|
+
|
|
53
|
+
To automatically check for these issues before you commit, you can run ``.install-hooks``.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
License
|
|
57
|
+
-------
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
Copyright 2024 Daniel Malik
|
|
61
|
+
|
|
62
|
+
Released under the terms of the Apache License 2.0
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
.. _pretix: https://github.com/pretix/pretix
|
|
67
|
+
.. _pretix development setup: https://docs.pretix.eu/en/latest/development/setup.html
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
PostHog
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
This is a plugin for `pretix`_.
|
|
5
|
+
|
|
6
|
+
PostHog Integration for Pretix
|
|
7
|
+
|
|
8
|
+
Development setup
|
|
9
|
+
-----------------
|
|
10
|
+
|
|
11
|
+
1. Make sure that you have a working `pretix development setup`_.
|
|
12
|
+
|
|
13
|
+
2. Clone this repository.
|
|
14
|
+
|
|
15
|
+
3. Activate the virtual environment you use for pretix development.
|
|
16
|
+
|
|
17
|
+
4. Execute ``python setup.py develop`` within this directory to register this application with pretix's plugin registry.
|
|
18
|
+
|
|
19
|
+
5. Execute ``make`` within this directory to compile translations.
|
|
20
|
+
|
|
21
|
+
6. Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in
|
|
22
|
+
the 'plugins' tab in the settings.
|
|
23
|
+
|
|
24
|
+
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed::
|
|
25
|
+
|
|
26
|
+
pip install flake8 isort black
|
|
27
|
+
|
|
28
|
+
To check your plugin for rule violations, run::
|
|
29
|
+
|
|
30
|
+
black --check .
|
|
31
|
+
isort -c .
|
|
32
|
+
flake8 .
|
|
33
|
+
|
|
34
|
+
You can auto-fix some of these issues by running::
|
|
35
|
+
|
|
36
|
+
isort .
|
|
37
|
+
black .
|
|
38
|
+
|
|
39
|
+
To automatically check for these issues before you commit, you can run ``.install-hooks``.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
License
|
|
43
|
+
-------
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Copyright 2024 Daniel Malik
|
|
47
|
+
|
|
48
|
+
Released under the terms of the Apache License 2.0
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
.. _pretix: https://github.com/pretix/pretix
|
|
53
|
+
.. _pretix development setup: https://docs.pretix.eu/en/latest/development/setup.html
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.1.2"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from django.utils.translation import gettext_lazy
|
|
2
|
+
|
|
3
|
+
from . import __version__
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from pretix.base.plugins import PluginConfig
|
|
7
|
+
except ImportError:
|
|
8
|
+
raise RuntimeError("Please use pretix 2.7 or above to run this plugin!")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PluginApp(PluginConfig):
|
|
12
|
+
default = True
|
|
13
|
+
name = "pretix_posthog"
|
|
14
|
+
verbose_name = "PostHog"
|
|
15
|
+
|
|
16
|
+
class PretixPluginMeta:
|
|
17
|
+
name = gettext_lazy("PostHog")
|
|
18
|
+
author = "Daniel Malik"
|
|
19
|
+
description = gettext_lazy("PostHog Integration for Pretix")
|
|
20
|
+
visible = True
|
|
21
|
+
version = __version__
|
|
22
|
+
category = "INTEGRATION"
|
|
23
|
+
compatibility = "pretix>=2.7.0"
|
|
24
|
+
|
|
25
|
+
def ready(self):
|
|
26
|
+
from . import signals # NOQA
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: 2017-03-07 19:01+0100\n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: Daniel Malik\n"
|
|
8
|
+
"Language-Team: \n"
|
|
9
|
+
"Language: de\n"
|
|
10
|
+
"MIME-Version: 1.0\n"
|
|
11
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
12
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: 2017-03-07 19:01+0100\n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: Daniel Malik\n"
|
|
8
|
+
"Language-Team: \n"
|
|
9
|
+
"Language: de\n"
|
|
10
|
+
"MIME-Version: 1.0\n"
|
|
11
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
12
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import secrets
|
|
3
|
+
from base64 import b64encode
|
|
4
|
+
from hashlib import sha384
|
|
5
|
+
|
|
6
|
+
import posthog
|
|
7
|
+
from django.dispatch import receiver
|
|
8
|
+
from django.urls import resolve, reverse
|
|
9
|
+
from django.utils.translation import gettext_lazy as _
|
|
10
|
+
from pretix.base.middleware import _merge_csp, _parse_csp, _render_csp
|
|
11
|
+
from pretix.base.models import Order
|
|
12
|
+
from pretix.base.signals import order_paid
|
|
13
|
+
from pretix.control.signals import nav_event_settings
|
|
14
|
+
from pretix.presale.signals import html_page_header, process_response
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def generate_nonce(length=12):
|
|
20
|
+
return secrets.token_urlsafe(length)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@receiver(nav_event_settings, dispatch_uid="posthog_nav_event_settings")
|
|
24
|
+
def navbar_event_settings(sender, request, **kwargs):
|
|
25
|
+
url = resolve(request.path_info)
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
"label": _("PostHog"),
|
|
29
|
+
"url": reverse(
|
|
30
|
+
"plugins:pretix_posthog:settings",
|
|
31
|
+
kwargs={
|
|
32
|
+
"event": request.event.slug,
|
|
33
|
+
"organizer": request.organizer.slug,
|
|
34
|
+
},
|
|
35
|
+
),
|
|
36
|
+
"active": url.namespace == "plugins:pretix_posthog"
|
|
37
|
+
and url.url_name.startswith("settings"),
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@receiver(html_page_header, dispatch_uid="posthog_html_page_header")
|
|
43
|
+
def html_page_header_presale(sender, request, **kwargs):
|
|
44
|
+
project_api_key = sender.settings.get("ph_project_api_key")
|
|
45
|
+
client_api_host = sender.settings.get("ph_client_api_host")
|
|
46
|
+
|
|
47
|
+
if not project_api_key:
|
|
48
|
+
return
|
|
49
|
+
# Generate a sha256 integrity hash for the script tag
|
|
50
|
+
script_content = """
|
|
51
|
+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys onSessionId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
|
|
52
|
+
posthog.init('%s',{api_host:'%s'})
|
|
53
|
+
""" % (project_api_key, client_api_host)
|
|
54
|
+
integrity = 'sha384-' + b64encode(sha384(script_content.encode("utf-8")).digest()).decode('utf-8')
|
|
55
|
+
return f"""
|
|
56
|
+
<script integrity="{integrity}">{script_content}</script>
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@receiver(process_response, dispatch_uid="posthog_process_response")
|
|
61
|
+
def process_response_presale_csp(sender, request, response, **kwargs):
|
|
62
|
+
project_api_key = sender.settings.get("ph_project_api_key")
|
|
63
|
+
if project_api_key:
|
|
64
|
+
if "Content-Security-Policy" in response:
|
|
65
|
+
headers = _parse_csp(response["Content-Security-Policy"])
|
|
66
|
+
else:
|
|
67
|
+
headers = {}
|
|
68
|
+
|
|
69
|
+
_merge_csp(
|
|
70
|
+
headers,
|
|
71
|
+
{
|
|
72
|
+
"script-src": [
|
|
73
|
+
"'self'",
|
|
74
|
+
"'unsafe-inline'",
|
|
75
|
+
"'unsafe-eval'",
|
|
76
|
+
"https://*.posthog.com",
|
|
77
|
+
"blob:",
|
|
78
|
+
],
|
|
79
|
+
"style-src": [
|
|
80
|
+
"'self'",
|
|
81
|
+
"'unsafe-inline'",
|
|
82
|
+
"https://*.posthog.com",
|
|
83
|
+
],
|
|
84
|
+
"img-src": [
|
|
85
|
+
"'self'",
|
|
86
|
+
"https://*.posthog.com",
|
|
87
|
+
],
|
|
88
|
+
"connect-src": [
|
|
89
|
+
"'self'",
|
|
90
|
+
"https://*.posthog.com",
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
if headers:
|
|
96
|
+
response["Content-Security-Policy"] = _render_csp(headers)
|
|
97
|
+
|
|
98
|
+
return response
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@receiver(order_paid, dispatch_uid="posthog_order_paid")
|
|
102
|
+
def posthog_order_paid(sender, order: Order, **kwargs):
|
|
103
|
+
api_key = sender.settings.get("ph_project_api_key")
|
|
104
|
+
client_api_host = sender.settings.get("ph_client_api_host")
|
|
105
|
+
if api_key and client_api_host:
|
|
106
|
+
ph = posthog.Posthog(api_key, client_api_host)
|
|
107
|
+
ph.capture(order.code, "order_paid", {
|
|
108
|
+
"value": order.total,
|
|
109
|
+
"email": order.email,
|
|
110
|
+
})
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% extends "pretixcontrol/event/settings_base.html" %}
|
|
2
|
+
{% load i18n %}
|
|
3
|
+
{% load bootstrap3 %}
|
|
4
|
+
{% block inside %}
|
|
5
|
+
<h1>{% trans "PostHog" %}</h1>
|
|
6
|
+
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
|
7
|
+
{% csrf_token %}
|
|
8
|
+
{% bootstrap_form_errors form %}
|
|
9
|
+
<fieldset>
|
|
10
|
+
{% bootstrap_field form.ph_project_api_key layout="control" %}
|
|
11
|
+
{% bootstrap_field form.ph_client_api_host layout="control" %}
|
|
12
|
+
</fieldset>
|
|
13
|
+
<div class="form-group submit-group">
|
|
14
|
+
<button type="submit" class="btn btn-primary btn-save">
|
|
15
|
+
{% trans "Save" %}
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
</form>
|
|
19
|
+
{% endblock %}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from django import forms
|
|
2
|
+
from django.urls import reverse
|
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
|
4
|
+
from pretix.base.forms import SettingsForm
|
|
5
|
+
from pretix.base.models import Event
|
|
6
|
+
from pretix.control.views.event import EventSettingsFormView, EventSettingsViewMixin
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PostHogSettingsForm(SettingsForm):
|
|
10
|
+
ph_project_api_key = forms.CharField(
|
|
11
|
+
label=_("PostHog Project API Key"),
|
|
12
|
+
required=True,
|
|
13
|
+
help_text=_(
|
|
14
|
+
"You will find the Project API Key in the Project settings."
|
|
15
|
+
),
|
|
16
|
+
max_length=47,
|
|
17
|
+
min_length=47,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
ph_client_api_host = forms.URLField(
|
|
21
|
+
label=_("PostHog Client API Host"),
|
|
22
|
+
required=True,
|
|
23
|
+
help_text=_(
|
|
24
|
+
"PostHog Client API Host"
|
|
25
|
+
),
|
|
26
|
+
initial="https://eu.i.posthog.com",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SettingsView(EventSettingsViewMixin, EventSettingsFormView):
|
|
31
|
+
model = Event
|
|
32
|
+
form_class = PostHogSettingsForm
|
|
33
|
+
template_name = "pretix_posthog/settings.html"
|
|
34
|
+
permission = "can_change_event_settings"
|
|
35
|
+
|
|
36
|
+
def get_success_url(self):
|
|
37
|
+
return reverse(
|
|
38
|
+
"plugins:pretix_posthog:settings",
|
|
39
|
+
kwargs={
|
|
40
|
+
"organizer": self.request.event.organizer.slug,
|
|
41
|
+
"event": self.request.event.slug,
|
|
42
|
+
},
|
|
43
|
+
)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pretix-posthog
|
|
3
|
+
Version: 1.1.2
|
|
4
|
+
Summary: PostHog Integration for Pretix
|
|
5
|
+
Author-email: Daniel Malik <daniel@binarycollective.de>
|
|
6
|
+
Maintainer-email: Daniel Malik <daniel@binarycollective.de>
|
|
7
|
+
License: Apache
|
|
8
|
+
Project-URL: homepage, https://github.com/fronbasal/pretix-posthog
|
|
9
|
+
Project-URL: repository, https://github.com/fronbasal/pretix-posthog
|
|
10
|
+
Keywords: pretix
|
|
11
|
+
Description-Content-Type: text/x-rst
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: posthog>=3.5
|
|
14
|
+
|
|
15
|
+
PostHog
|
|
16
|
+
==========================
|
|
17
|
+
|
|
18
|
+
This is a plugin for `pretix`_.
|
|
19
|
+
|
|
20
|
+
PostHog Integration for Pretix
|
|
21
|
+
|
|
22
|
+
Development setup
|
|
23
|
+
-----------------
|
|
24
|
+
|
|
25
|
+
1. Make sure that you have a working `pretix development setup`_.
|
|
26
|
+
|
|
27
|
+
2. Clone this repository.
|
|
28
|
+
|
|
29
|
+
3. Activate the virtual environment you use for pretix development.
|
|
30
|
+
|
|
31
|
+
4. Execute ``python setup.py develop`` within this directory to register this application with pretix's plugin registry.
|
|
32
|
+
|
|
33
|
+
5. Execute ``make`` within this directory to compile translations.
|
|
34
|
+
|
|
35
|
+
6. Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in
|
|
36
|
+
the 'plugins' tab in the settings.
|
|
37
|
+
|
|
38
|
+
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed::
|
|
39
|
+
|
|
40
|
+
pip install flake8 isort black
|
|
41
|
+
|
|
42
|
+
To check your plugin for rule violations, run::
|
|
43
|
+
|
|
44
|
+
black --check .
|
|
45
|
+
isort -c .
|
|
46
|
+
flake8 .
|
|
47
|
+
|
|
48
|
+
You can auto-fix some of these issues by running::
|
|
49
|
+
|
|
50
|
+
isort .
|
|
51
|
+
black .
|
|
52
|
+
|
|
53
|
+
To automatically check for these issues before you commit, you can run ``.install-hooks``.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
License
|
|
57
|
+
-------
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
Copyright 2024 Daniel Malik
|
|
61
|
+
|
|
62
|
+
Released under the terms of the Apache License 2.0
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
.. _pretix: https://github.com/pretix/pretix
|
|
67
|
+
.. _pretix development setup: https://docs.pretix.eu/en/latest/development/setup.html
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.rst
|
|
4
|
+
pyproject.toml
|
|
5
|
+
setup.cfg
|
|
6
|
+
setup.py
|
|
7
|
+
pretix_posthog/__init__.py
|
|
8
|
+
pretix_posthog/apps.py
|
|
9
|
+
pretix_posthog/signals.py
|
|
10
|
+
pretix_posthog/urls.py
|
|
11
|
+
pretix_posthog/views.py
|
|
12
|
+
pretix_posthog.egg-info/PKG-INFO
|
|
13
|
+
pretix_posthog.egg-info/SOURCES.txt
|
|
14
|
+
pretix_posthog.egg-info/dependency_links.txt
|
|
15
|
+
pretix_posthog.egg-info/entry_points.txt
|
|
16
|
+
pretix_posthog.egg-info/requires.txt
|
|
17
|
+
pretix_posthog.egg-info/top_level.txt
|
|
18
|
+
pretix_posthog/locale/de/LC_MESSAGES/django.mo
|
|
19
|
+
pretix_posthog/locale/de/LC_MESSAGES/django.po
|
|
20
|
+
pretix_posthog/locale/de_Informal/.gitkeep
|
|
21
|
+
pretix_posthog/locale/de_Informal/LC_MESSAGES/django.mo
|
|
22
|
+
pretix_posthog/locale/de_Informal/LC_MESSAGES/django.po
|
|
23
|
+
pretix_posthog/static/pretix_posthog/.gitkeep
|
|
24
|
+
pretix_posthog/templates/pretix_posthog/.gitkeep
|
|
25
|
+
pretix_posthog/templates/pretix_posthog/settings.html
|
|
26
|
+
tests/test_main.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
posthog>=3.5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pretix_posthog
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pretix-posthog"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "PostHog Integration for Pretix"
|
|
5
|
+
readme = "README.rst"
|
|
6
|
+
license = {text = "Apache"}
|
|
7
|
+
keywords = ["pretix"]
|
|
8
|
+
authors = [
|
|
9
|
+
{name = "Daniel Malik", email = "daniel@binarycollective.de"},
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{name = "Daniel Malik", email = "daniel@binarycollective.de"},
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
dependencies = [
|
|
16
|
+
"posthog>=3.5"
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.entry-points."pretix.plugin"]
|
|
20
|
+
pretix_posthog = "pretix_posthog:PretixPluginMeta"
|
|
21
|
+
|
|
22
|
+
[project.entry-points."distutils.commands"]
|
|
23
|
+
build = "pretix_plugin_build.build:CustomBuild"
|
|
24
|
+
|
|
25
|
+
[build-system]
|
|
26
|
+
requires = [
|
|
27
|
+
"setuptools",
|
|
28
|
+
"pretix-plugin-build",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
homepage = "https://github.com/fronbasal/pretix-posthog"
|
|
33
|
+
repository = "https://github.com/fronbasal/pretix-posthog"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools]
|
|
36
|
+
include-package-data = true
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.dynamic]
|
|
39
|
+
version = {attr = "pretix_posthog.__version__"}
|
|
40
|
+
|
|
41
|
+
[tool.setuptools.packages.find]
|
|
42
|
+
include = ["pretix*"]
|
|
43
|
+
namespaces = false
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[flake8]
|
|
2
|
+
ignore = N802,W503,E402
|
|
3
|
+
max-line-length = 160
|
|
4
|
+
exclude = migrations,.ropeproject,static,_static,build
|
|
5
|
+
|
|
6
|
+
[isort]
|
|
7
|
+
combine_as_imports = true
|
|
8
|
+
default_section = THIRDPARTY
|
|
9
|
+
include_trailing_comma = true
|
|
10
|
+
known_third_party = pretix
|
|
11
|
+
known_standard_library = typing
|
|
12
|
+
multi_line_output = 3
|
|
13
|
+
skip = setup.py
|
|
14
|
+
use_parentheses = True
|
|
15
|
+
force_grid_wrap = 0
|
|
16
|
+
line_length = 88
|
|
17
|
+
known_first_party = pretix_posthog
|
|
18
|
+
|
|
19
|
+
[tool:pytest]
|
|
20
|
+
DJANGO_SETTINGS_MODULE = pretix.testutils.settings
|
|
21
|
+
|
|
22
|
+
[coverage:run]
|
|
23
|
+
source = pretix_posthog
|
|
24
|
+
omit = */migrations/*,*/urls.py,*/tests/*
|
|
25
|
+
|
|
26
|
+
[coverage:report]
|
|
27
|
+
exclude_lines =
|
|
28
|
+
pragma: no cover
|
|
29
|
+
def __str__
|
|
30
|
+
der __repr__
|
|
31
|
+
if settings.DEBUG
|
|
32
|
+
NOQA
|
|
33
|
+
NotImplementedError
|
|
34
|
+
|
|
35
|
+
[check-manifest]
|
|
36
|
+
ignore =
|
|
37
|
+
.update-locales.sh
|
|
38
|
+
.install-hooks.sh
|
|
39
|
+
pretixplugin.toml
|
|
40
|
+
Makefile
|
|
41
|
+
manage.py
|
|
42
|
+
tests/*
|
|
43
|
+
*.po
|
|
44
|
+
.gitkeep
|
|
45
|
+
|
|
46
|
+
[egg_info]
|
|
47
|
+
tag_build =
|
|
48
|
+
tag_date = 0
|
|
49
|
+
|