Skip to content

Commit

Permalink
Black all the things! (#1136)
Browse files Browse the repository at this point in the history
* Black all the things!

* changed line length to 120
  • Loading branch information
mariusandra authored Jul 2, 2020
1 parent 1ecabe3 commit da5a48c
Show file tree
Hide file tree
Showing 144 changed files with 3,085 additions and 3,612 deletions.
4 changes: 2 additions & 2 deletions cypress/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def main():
continue
else:
# recieved not 200 from PostHog, but service is up
print("Found status %d" % (r.status, ))
with open('cypress/screenshots/curl.html', 'wb') as f:
print("Found status %d" % (r.status,))
with open("cypress/screenshots/curl.html", "wb") as f:
f.write(r.read)
print("PostHog is still booting. Sleeping for 1 second")
except:
Expand Down
15 changes: 8 additions & 7 deletions gunicorn.config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

loglevel = "error"

def on_starting(server):
print("""
\x1b[1;34m""" +

r"""
def on_starting(server):
print(
"""
\x1b[1;34m"""
+ r"""
_____ _ _ _
| __ \ | | | | | |
| |__) |__ ___| |_| |__| | ___ __ _
Expand All @@ -17,11 +18,11 @@ def on_starting(server):
|_| \___/|___/\__|_| |_|\___/ \__, |
__/ |
|___/
""" +

"""
+ """
\x1b[0m
""")
"""
)
print("Server running on \x1b[4mhttp://{}:{}\x1b[0m".format(*server.address[0]))
print("Questions? Please shoot us an email at \x1b[[email protected]\x1b[0m")
print("\nTo stop, press CTRL + C")
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'posthog.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "posthog.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand All @@ -17,5 +17,5 @@ def main():
execute_from_command_line(sys.argv)


if __name__ == '__main__':
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"lint-staged": {
"*.{js,css,scss}": "prettier --write",
"*.js": "eslint",
"*.py": "black"
"*.py": "black -l 120"
},
"optionalDependencies": {
"fsevents": "^2.1.2"
Expand Down
2 changes: 1 addition & 1 deletion posthog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Django starts so that shared_task will use this app.
from posthog.celery import app as celery_app

__all__ = ('celery_app',)
__all__ = ("celery_app",)
17 changes: 2 additions & 15 deletions posthog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,11 @@ class UserAdmin(DjangoUserAdmin):
fieldsets = (
(None, {"fields": ("email", "password")}),
(_("Personal info"), {"fields": ("first_name", "last_name")}),
(
_("Permissions"),
{
"fields": (
"is_active",
"is_staff",
"is_superuser",
"groups",
"user_permissions",
)
},
),
(_("Permissions"), {"fields": ("is_active", "is_staff", "is_superuser", "groups", "user_permissions",)},),
(_("Important dates"), {"fields": ("last_login", "date_joined")}),
(_("PostHog"), {"fields": ("temporary_token",)}),
)
add_fieldsets = (
(None, {"classes": ("wide",), "fields": ("email", "password1", "password2"),}),
)
add_fieldsets = ((None, {"classes": ("wide",), "fields": ("email", "password1", "password2"),}),)
list_display = ("email", "first_name", "last_name", "is_staff")
search_fields = ("email", "first_name", "last_name")
ordering = ("email",)
Loading

0 comments on commit da5a48c

Please sign in to comment.