Stop having flamewars about code style.
- website: https://github.com/python/black
"""Showcasing Pyramid's Function Decorators. | |
Usage: | |
1. Install Pyramid: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html | |
2. Put this code into example.py | |
3. Run with ``$VENV/bin/python example.py``. | |
You can showcase with your browser or using curl: | |
$ curl http://localhost:8080/ |
"""Showcasing Pyramid's View Predicates. | |
Usage: | |
1. Install Pyramid: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html | |
2. Put this code into ``example.py``. | |
3. Run with ``$VENV/bin/python example.py``. | |
4. Showcase with your browser or using curl: | |
$ curl http://localhost:8080/ | |
Welcome! |
"""Showcasing Pyramid's Renderers. | |
Usage: | |
1. Install Pyramid: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html | |
2. Put this code into example.py | |
3. Run with ``$VENV/bin/python example.py``. | |
You can showcase with your browser or using curl: | |
$ curl http://localhost:8080/ |
# Run the following inside bin/instance debug to get list of paths + dates | |
# print ''.join(['{}|{}\n'.format(b.getURL(), b.modified) | |
# for b in app.office.portal_catalog.unrestrictedSearchResults()]) | |
# Put the list in the MODIFIEDS variable below. Then run the script inside | |
# bin/instance debug on new server | |
MODIFIEDS = [ | |
'events', | |
'news', |
<form method="POST" action="http://formspree.io/[email protected]"> | |
<textarea name="message" placeholder="Your message"></textarea> | |
<button type="submit">Send</button> | |
</form> |
# spin up a local instance | |
# portal_workflows, allow everything for Anonymous, click update portal security | |
# bin/instance debug | |
# >>> for brain in app.Plone.portal_catalog(): | |
# >>> print brain.getURL().split('http://nohost/Plone/')[1] | |
# Paste paths into paths.txt | |
# More info on https://blog.niteo.co/export-plone-to-pdfs/ | |
from subprocess import check_output | |
import os.path |
Stop having flamewars about code style.
### THIS IS DEPRECATED ### | |
# Use https://github.com/jamsix/ib-edavki instead | |
from collections import OrderedDict | |
from dataclasses import dataclass | |
from dataclasses import field | |
from decimal import Decimal | |
import xml.etree.ElementTree as ET | |
from datetime import date | |
from datetime import datetime |
7e9b0dff974c89e070da1ad85713ff3c20b0ca97 1622410071 1622503301 |
# Python 3.10 | |
from enum import Enum | |
class Direction(Enum): | |
up = "up" | |
down = "donw" | |
assert "up" == Direction.up.value | |
# Python 3.11 |