Skip to content

Commit

Permalink
Merge d425a0c into f4f359c
Browse files Browse the repository at this point in the history
  • Loading branch information
hedyhli committed Jan 17, 2024
2 parents f4f359c + d425a0c commit 3d70b91
Show file tree
Hide file tree
Showing 58 changed files with 838 additions and 376 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Our projects on Python Discord are open source and [available on GitHub](https:/
<!-- Project cards -->
<div class="columns is-multiline is-centered is-3 is-variable">
<div class="column is-one-third-desktop is-half-tablet">
<div class="card github-card">
<div class="card-header">
<div class="card github-card has-background-white">
<div class="card-header has-background-white">
<div class="card-header-title is-centered">
<a class="is-size-5" href="https://github.com/python-discord/sir-lancebot">
<i class="fab fa-github"></i>&ensp;<strong >Sir Lancebot</strong>
Expand All @@ -22,11 +22,11 @@ Our projects on Python Discord are open source and [available on GitHub](https:/
Sir Lancebot has a collection of self-contained, for-fun features. If you're new to Discord bots or contributing, this is a great place to start!
</div>
</div>
<div class="card-footer">
<div class="card-footer has-background-white">
<a href="https://github.com/python-discord/sir-lancebot/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc" class="card-footer-item"><i class="fas fa-exclamation-circle"></i>&ensp;Issues</a>
<a href="https://github.com/python-discord/sir-lancebot/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc" class="card-footer-item"><i class="fas fa-code-merge"></i>&ensp;PRs</a>
</div>
<div class="card-footer">
<div class="card-footer has-background-white">
<a href="/pages/guides/pydis-guides/contributing/sir-lancebot" class="card-footer-item"><i class="fas fa-cogs"></i>&ensp;Setup and Configuration Guide</a>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ It just returns a new one.
Let's examine what's going on here.
At first, the variable `s` refers to some object, the string `'hello'`.

![s refers to the string "hello"](/static/images/content/mutability/s_refers_hello.png)
![s refers to the string "hello"](/static/images/content/mutability/s_refers_hello.png){: class="has-dark-mode-background" }

When you call `s.upper()`, a new string, which contains the characters `'HELLO'`, gets created.

![s.upper creates "HELLO"](/static/images/content/mutability/s_upper_creates_HELLO.png)
![s.upper creates "HELLO"](/static/images/content/mutability/s_upper_creates_HELLO.png){: class="has-dark-mode-background" }

This happens even if you just call `s.upper()` without any assignment, on its own line:
```python
Expand All @@ -44,12 +44,12 @@ In this case, a new object will be created and discarded right away.

Then the assignment part comes in: the name `s` gets disconnected from `'hello'`, and gets connected to `'HELLO'`.

![s gets assigned to "HELLO"](/static/images/content/mutability/s_gets_assigned_to_HELLO.png)
![s gets assigned to "HELLO"](/static/images/content/mutability/s_gets_assigned_to_HELLO.png){: class="has-dark-mode-background" }

Now we can say that `'HELLO'` is stored in the `s` variable.

Then, because no variables refer to the _object_ `'hello'`, it gets eaten by the garbage collector.

!["hello" Gets Eaten](/static/images/content/mutability/hello_gets_eaten.png)
!["hello" Gets Eaten](/static/images/content/mutability/hello_gets_eaten.png){: class="has-dark-mode-background" }

It means that the memory reserved for that object will be freed. If that didn't happen, the 'garbage' would accumulate over time and fill up all the RAM.
2 changes: 1 addition & 1 deletion pydis_site/apps/resources/resources/adafruit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Adafruit is an open-source electronics manufacturer
Their official community host regular show-and-tells,
provide help with your projects,
and the Adafruit devs do all the CircuitPython Development right out in the open.
title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png
title_image: /static/images/resources/adafruit.png
title_url: https://adafruit.com/
urls:
- icon: branding/discord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title_url: https://automatetheboringstuff.com/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: We have listed our favourite communities,
An awesome list collating the best programming related Discord servers is available on GitHub
and has all sorts of topics from blockchain to virtual reality!
title_icon: branding/github
title_icon_color: black
title_icon_color: dark
title_url: https://github.com/mhxion/awesome-programming-discord
name: awesome-programming-discord
tags:
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/byte_of_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title_url: https://python.swaroopch.com/
urls:
- icon: regular/book
url: https://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html
color: black
color: dark
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/6762544-a-byte-of-python
color: black
color: dark
tags:
topics:
- general
Expand Down
2 changes: 1 addition & 1 deletion pydis_site/apps/resources/resources/code_combat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title_url: https://codecombat.com/
urls:
- icon: branding/github
url: https://github.com/codecombat/codecombat
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ title_url: https://www.oreilly.com/library/view/data-science-from/9781492041122/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/en/book/show/52059715-data-science-from-scratch
color: black
color: dark
- icon: branding/github
url: https://github.com/joelgrus/data-science-from-scratch
color: black
color: dark
tags:
topics:
- data science
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/effective_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title_url: https://effectivepython.com/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/48566725-effective-python
color: black
color: dark
- icon: branding/github
url: https://github.com/bslatkin/effectivepython
color: black
color: dark
tags:
topics:
- general
Expand Down
2 changes: 1 addition & 1 deletion pydis_site/apps/resources/resources/exercism.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title_url: https://exercism.org/
urls:
- icon: branding/github
url: https://github.com/exercism/python
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title_url: http://shop.oreilly.com/product/0636920031116.do
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/18774655-flask-web-development
color: black
color: dark
- icon: branding/github
url: https://github.com/miguelgrinberg/flasky
color: black
color: dark
tags:
topics:
- web development
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/fluent_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title_url: https://www.oreilly.com/library/view/fluent-python/9781491946237/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/22800567-fluent-python
color: black
color: dark
- icon: branding/github
url: https://github.com/fluentpython
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title_url: https://python-guide.org/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python
color: black
color: dark
tags:
topics:
- general
Expand Down
6 changes: 2 additions & 4 deletions pydis_site/apps/resources/resources/kivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ name: Kivy
description: The Kivy project, through the Kivy framework and its sister projects,
aims to provide all the tools to create desktop and mobile applications in Python.
Allowing rapid development of multitouch applications with custom and exciting user interfaces.
icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/content/logos/kivy-logo-black-256.png
icon_size: 50
title_image: https://i.imgur.com/EVP3jZR.png
title_image: /static/images/resources/kivy.png
title_url: https://kivy.org/
urls:
- icon: branding/discord
url: https://discord.gg/djPtTRJ
color: blurple
- icon: branding/github
url: https://github.com/kivy
color: black
color: dark
tags:
topics:
- user interface
Expand Down
2 changes: 1 addition & 1 deletion pydis_site/apps/resources/resources/mission_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title_url: https://www.sean.co.uk/books/mission-python/index.shtm
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/35545850-mission-python
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title_url: https://nnfs.io/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/55927899-neural-networks-from-scratch-in-python
color: black
color: dark
tags:
topics:
- data science
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/python_cookbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title_url: http://shop.oreilly.com/product/0636920027072.do
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/17152735-python-cookbook
color: black
color: dark
- icon: branding/github
url: https://github.com/dabeaz/python-cookbook
color: black
color: dark
tags:
topics:
- general
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/python_crash_course.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ title_url: https://nostarch.com/pythoncrashcourse2e
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/23241059-python-crash-course
color: black
color: dark
- icon: branding/github
url: https://ehmatthes.github.io/pcc/
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title_url: https://www.python-graph-gallery.com/
urls:
- icon: branding/github
url: https://github.com/holtzy/The-Python-Graph-Gallery
color: black
color: dark
tags:
topics:
- data science
Expand Down
2 changes: 1 addition & 1 deletion pydis_site/apps/resources/resources/python_tricks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title_url: https://realpython.com/products/python-tricks-book/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/36990732-python-tricks
color: black
color: dark
tags:
topics:
- general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: A simple, no-nonsense guide to the basics of using Git.
name: A Simple Guide to Git
title_url: https://rogerdudler.github.io/git-guide/
title_icon: branding/github
title_icon_color: black
title_icon_color: dark
tags:
topics:
- tooling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ title_url: https://third-bit.com/sdxpy/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/199430059-software-design-by-example
color: black
color: dark
- icon: branding/github
url: https://github.com/gvwilson/sdxpy
color: black
color: dark
tags:
topics:
- general
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/think_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ title_url: https://greenteapress.com/wp/think-python-2e/
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/14514306-think-python
color: black
color: dark
- icon: branding/github
url: https://github.com/AllenDowney/ThinkPython2
color: black
color: dark
tags:
topics:
- general
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/apps/resources/resources/two_scoops_of_django.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title_url: https://www.feldroy.com/books/two-scoops-of-django-3-x
urls:
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/55822151-two-scoops-of-django-3-x
color: black
color: dark
- icon: branding/github
url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples
color: black
color: dark
tags:
topics:
- web development
Expand Down
4 changes: 2 additions & 2 deletions pydis_site/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf import settings
from django.template import RequestContext
from django.http import HttpRequest


def git_sha_processor(_: RequestContext) -> dict:
def git_sha_processor(_: HttpRequest) -> dict:
"""Expose the git SHA for this repo to all views."""
return {'git_sha': settings.GIT_SHA}
50 changes: 48 additions & 2 deletions pydis_site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@

# Custom settings for django-simple-bulma
BULMA_SETTINGS = {
"variables": { # If you update these colours, please update the notification.css file
"primary": "#7289DA", # Discord blurple
"variables": {
"primary": "#7289DA", # PyDis blurple
"green": "#32ac66", # Colour picked after Discord discussion
"turquoise": "#7289DA", # Blurple, because Bulma uses this regardless of `primary` above
"blue": "#2482c1", # Colour picked after Discord discussion
Expand All @@ -315,6 +315,52 @@
"footer-padding": "1rem 1.5rem 1rem",
"tooltip-max-width": "30rem",
},
"dark_variables": {
"primary": "#7289DA", # PyDis blurple
"warning": "#4B4636",
"warning-invert": "#FFFFFF",
"primary-dark": "#EFF1FB", # Bulma's primary-light
"primary-light": "#2B3660",
"success-dark": "#EFFAF5", # Bulma's success-light
"success-light": "#214133",
"danger-dark": "#FEECF0", # Bulma's danger-light
"danger-light": "#4C1822",
"info-dark": "#EFF5FB", # Bulma's info-light
"info-light": "#254056",

"white": "#2C2F33",
"white-bis": "#23272A ",
"white-ter": "#36393F",
"light": "$white",

"black": "#F7F7F7",
"black-bis": "#F2F2F2",
"black-ter": "#E6E6E6",
"dark": "$black",

"text": "#F4F4F4",
"text-light": "#F7F7F7",
"text-strong": "#FEFEFE",

"link": "#99B0FF", # A brighter PyDis blurple
"link-hover": "#FFFFFF",
"link-focus": "$link-hover",
"link-active": "$link-hover",

"code": "#FF7990", # Adjusted to 4.5 contrast ratio per WCAG Level AA
"code-background": "#464951", # A graduation lighter than the default for light theme

# Same as bulma, adjusted for dark mode
"shadow": "0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0px 0 1px rgba(10, 10, 10, 0.02)",
"border": "#4E4F51",
"border-light": "#313233",

# Use the same sizes
"dimensions": "16 24 32 48 64 96 128 256 512",
"navbar-height": "4.75rem",
"footer-padding": "1rem 1.5rem 1rem",
"tooltip-max-width": "30rem",
},
"extensions": [
"bulma-dropdown",
"bulma-navbar-burger",
Expand Down
Loading

0 comments on commit 3d70b91

Please sign in to comment.