How to start developing Plone - from the scratch approach.
Use man pages, info pages and commandline help before asking others, please.
_customized_web_server_port = 8522 | |
@pytest.fixture() | |
def customized_web_server(request, app) -> typing.Callable: | |
"""py.test fixture to create a WSGI web server for functional tests with custom INI options set. | |
This is similar to ``web_server``, but instead directly spawning a server, it returns a factory method which you can use to launch the web server which custom parameters besides those given in test.ini. | |
Example:: |
"""Prestodoctor OAuth on Authomatic implementation with data import and mapping to internal database.""" | |
from argparse import Namespace | |
import time | |
from authomatic.core import json_qs_parser | |
from authomatic.providers.oauth2 import OAuth2 | |
from websauna.system.model import now | |
from websauna.system.user.social import EmailSocialLoginMapper, \ | |
NotSatisfiedWithData |
Zope start process | |
Zope2.__init__ contains ZopeStarter | |
def prepare(self): | |
self.setupInitialLogging() | |
self.setupLocale() | |
self.setupSecurityOptions() | |
self.setupPublisher() | |
# Start ZServer servers before we drop privileges so we can bind to |
import sys | |
old_f = sys.stdout | |
BAD_OUTPUT = "hospitalArrival_dateTimeStrokeOnSet" | |
class F: | |
def write(self, x): | |
if x == BAD_OUTPUT: | |
import pdb ; pdb.set_trace() |
# -*- coding: utf8 -*- | |
import os | |
import subprocess | |
def create_prelisten_ogg(mp3, ogg): | |
""" | |
Run en-code for a single file | |
Do 48 kbit files for prelisten. | |
""" |
# Python 2.6 compatible ordered dict | |
# NOTE: API is not 1:1, but for normal dict access of | |
# set member, iterate keys and values this is enough | |
# Add odict egg to your project http://pypi.python.org/pypi/odict/ | |
try: | |
from collections import OrderedDict | |
except ImportError: | |
from odict import odict as OrderedDict |
/** | |
* Kindly ask to redraw the one frame preview. | |
* | |
* This function has throttling support so you can | |
* fire this from mouse move events (color picking) safely. | |
* | |
* XXX: Make sure all the fonts are loaded in this point or the | |
* first round of text rendering fails. See hidden font preloader in creator.pt. | |
* |
import datetime | |
string = "1.1.2012" | |
date = datetime.datetime.strptime(string, '%d.%m.%Y').date() |
HTML: | |
<button id="add-photo" i18n:translate=""> | |
Upload photos | |
</button> | |
<div id="photo-upload"> | |
<form id="upload-form" action="/upload/" method="POST" enctype="multipart/form-data"> | |
<input id="add-photo-upload" style="display: none" type="file" name="files[]" multiple="multiple"/> | |
</form> |