mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-06 17:51:36 +00:00
Initial Configuration Push
This commit is contained in:
142
deps/static3-0.7.0.dist-info/DESCRIPTION.rst
vendored
Normal file
142
deps/static3-0.7.0.dist-info/DESCRIPTION.rst
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
.. -*- mode: rst; coding: utf-8 -*-
|
||||
|
||||
static3 - A really simple WSGI way to serve static (or mixed) content.
|
||||
====================================================================================
|
||||
|
||||
.. image:: https://travis-ci.org/rmohr/static3.svg?branch=master
|
||||
:target: https://travis-ci.org/rmohr/static3
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:backlinks: top
|
||||
|
||||
This software is a Python3 compatible fork of Luke Arnos library static_.
|
||||
|
||||
The library is now Python3 compatible and Genshi_ support (the sucessor of
|
||||
kid_) is added. On Python2 Genshi and/or kid can be used as template engine. On
|
||||
Python3 only Genshi is available.
|
||||
|
||||
This library provides an easy way to include static content
|
||||
in your WSGI applications. There is a convenience method for serving
|
||||
files located via pkg_resources. There are also facilities for serving
|
||||
mixed (static and dynamic) content using "magic" file handlers.
|
||||
Python builtin string substitution, kid and Genshi template support are provided
|
||||
and it is easy to roll your own handlers. Note that this distribution
|
||||
does not require kid or Genshi unless you want to use that type of template. Also
|
||||
provides a command of the same name as a convenience when you just want
|
||||
to share a little content over HTTP, ad hoc.
|
||||
|
||||
Installation and Usage
|
||||
----------------------
|
||||
|
||||
Latest release via PIP::
|
||||
|
||||
pip install static3
|
||||
|
||||
Installation via GitHub::
|
||||
|
||||
git clone https://github.com/rmohr/static3.git
|
||||
cd static3
|
||||
pip install .
|
||||
|
||||
Cling
|
||||
^^^^^
|
||||
|
||||
`Cling` serves static content only. Just give it the base directory with your
|
||||
files you want to make accessible. You get a full WSGI app with an example as
|
||||
simple as that::
|
||||
|
||||
from static import Cling
|
||||
from wsgiref.simple_server import make_server
|
||||
my_app = Cling("/my/directory")
|
||||
make_server("localhost", 9999, my_app).serve_forever()
|
||||
|
||||
Now you can access everything in the given directory via http://localhost:9999.D
|
||||
|
||||
Serving compressed files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If a gzip compressed file with the ´gz´ postfix is present, it is served, along with the corresponding headers.
|
||||
So if the file 'index.html' and the file 'index.html.gz' are present, the file 'index.html.gz' is served, if the the client indicated that it supports gzipped content.
|
||||
|
||||
Additionally, you can configure arbitrary headers. You can match files by mime
|
||||
type, file extension, or prefix. For example, the following would add
|
||||
Cache-Control headers to paths with a css mime type for 10s, no-cache for all
|
||||
paths ending in .js for 100s, and add CORS header to all paths under the /imgs/
|
||||
dir::
|
||||
|
||||
headers = [
|
||||
{'type': 'text/css', 'Cache-Control': 'max-age=10'},
|
||||
{'ext': '.js', 'Cache-Control': 'no-cache'},
|
||||
{'prefix': '/imgs/', 'Access-Control-Allow-Origin': '*'},
|
||||
]
|
||||
Cling("/my/directory", headers=headers)
|
||||
|
||||
|
||||
Shock
|
||||
^^^^^
|
||||
|
||||
`Shock` has the same basic functionality like `Cling` but with Shock we can
|
||||
also have some templating fun. Shock comes with three templating backends.
|
||||
String substitution, kid and Genshi. The decision which backend to use is done
|
||||
by examining the extension of the file to serve. The file extensions are 'stp',
|
||||
'kid' and 'genshi'. So if you want to provide a file called 'index.html' via
|
||||
the kid backend, name your file 'index.html.kid'. A short example might look
|
||||
like this::
|
||||
|
||||
from static import Shock, KidMagic
|
||||
from wsgiref.simple_server import make_server
|
||||
my_app = Shock("/my/directory", magics=[KidMagic(title="Hello World")])
|
||||
make_server("localhost", 9999, my_app).serve_forever()
|
||||
|
||||
And the example 'index.html.kid'::
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:py="http://purl.org/kid/ns#"
|
||||
xml:lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<h1>$title</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
A similar template 'index.html.genshi' for Genshi::
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:py="http://genshi.edgewall.org/"
|
||||
xml:lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<h1>$title</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
This simple application will replace the placeholder `title` with 'Hello World'
|
||||
in every provided file which ends in '.kid'.
|
||||
In this example it already is already obvious, that although different template
|
||||
engines can be used, they can only be used in a very `static` way. Never the
|
||||
less `Shock` is perfectly suitable for simple semi-static things like make the
|
||||
URL to your companies logo, or the company name variable.
|
||||
|
||||
Unicode Support
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
When using a template system in Python3 it might be necessary to explicitly
|
||||
set an encoding for the sites provided. This can be done via the
|
||||
`encoding` attribute of `Shock`::
|
||||
|
||||
from static import Shock
|
||||
shock = Shock("/var/www/pub")
|
||||
shock.encoding="latin-1"
|
||||
|
||||
When using `Cling` or `Shock` to serve static content the
|
||||
encoding need not to be set, as the content is just streamed through.
|
||||
If you have templates encoded in different formats, an instance of
|
||||
`Shock` needs to be instantiated for every codec used.
|
||||
|
||||
.. _static: https://pypi.python.org/pypi/static
|
||||
.. _kid: https://pypi.python.org/pypi/kid
|
||||
.. _Genshi: https://pypi.python.org/pypi/Genshi
|
||||
|
||||
|
||||
1
deps/static3-0.7.0.dist-info/INSTALLER
vendored
Normal file
1
deps/static3-0.7.0.dist-info/INSTALLER
vendored
Normal file
@@ -0,0 +1 @@
|
||||
pip
|
||||
166
deps/static3-0.7.0.dist-info/METADATA
vendored
Normal file
166
deps/static3-0.7.0.dist-info/METADATA
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
Metadata-Version: 2.0
|
||||
Name: static3
|
||||
Version: 0.7.0
|
||||
Summary: A really simple WSGI way to serve static (or mixed) content.
|
||||
Home-page: https://github.com/rmohr/static3
|
||||
Author: Roman Mohr
|
||||
Author-email: roman@fenkhuber.at
|
||||
License: LGPL
|
||||
Keywords: wsgi web http static content webapps
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 4 - Beta
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
|
||||
Classifier: Natural Language :: English
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Topic :: Software Development :: Libraries
|
||||
Classifier: Topic :: Utilities
|
||||
Provides-Extra: GenshiMagic
|
||||
Requires-Dist: Genshi; extra == 'GenshiMagic'
|
||||
Provides-Extra: KidMagic
|
||||
Requires-Dist: kid; extra == 'KidMagic'
|
||||
|
||||
.. -*- mode: rst; coding: utf-8 -*-
|
||||
|
||||
static3 - A really simple WSGI way to serve static (or mixed) content.
|
||||
====================================================================================
|
||||
|
||||
.. image:: https://travis-ci.org/rmohr/static3.svg?branch=master
|
||||
:target: https://travis-ci.org/rmohr/static3
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:backlinks: top
|
||||
|
||||
This software is a Python3 compatible fork of Luke Arnos library static_.
|
||||
|
||||
The library is now Python3 compatible and Genshi_ support (the sucessor of
|
||||
kid_) is added. On Python2 Genshi and/or kid can be used as template engine. On
|
||||
Python3 only Genshi is available.
|
||||
|
||||
This library provides an easy way to include static content
|
||||
in your WSGI applications. There is a convenience method for serving
|
||||
files located via pkg_resources. There are also facilities for serving
|
||||
mixed (static and dynamic) content using "magic" file handlers.
|
||||
Python builtin string substitution, kid and Genshi template support are provided
|
||||
and it is easy to roll your own handlers. Note that this distribution
|
||||
does not require kid or Genshi unless you want to use that type of template. Also
|
||||
provides a command of the same name as a convenience when you just want
|
||||
to share a little content over HTTP, ad hoc.
|
||||
|
||||
Installation and Usage
|
||||
----------------------
|
||||
|
||||
Latest release via PIP::
|
||||
|
||||
pip install static3
|
||||
|
||||
Installation via GitHub::
|
||||
|
||||
git clone https://github.com/rmohr/static3.git
|
||||
cd static3
|
||||
pip install .
|
||||
|
||||
Cling
|
||||
^^^^^
|
||||
|
||||
`Cling` serves static content only. Just give it the base directory with your
|
||||
files you want to make accessible. You get a full WSGI app with an example as
|
||||
simple as that::
|
||||
|
||||
from static import Cling
|
||||
from wsgiref.simple_server import make_server
|
||||
my_app = Cling("/my/directory")
|
||||
make_server("localhost", 9999, my_app).serve_forever()
|
||||
|
||||
Now you can access everything in the given directory via http://localhost:9999.D
|
||||
|
||||
Serving compressed files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If a gzip compressed file with the ´gz´ postfix is present, it is served, along with the corresponding headers.
|
||||
So if the file 'index.html' and the file 'index.html.gz' are present, the file 'index.html.gz' is served, if the the client indicated that it supports gzipped content.
|
||||
|
||||
Additionally, you can configure arbitrary headers. You can match files by mime
|
||||
type, file extension, or prefix. For example, the following would add
|
||||
Cache-Control headers to paths with a css mime type for 10s, no-cache for all
|
||||
paths ending in .js for 100s, and add CORS header to all paths under the /imgs/
|
||||
dir::
|
||||
|
||||
headers = [
|
||||
{'type': 'text/css', 'Cache-Control': 'max-age=10'},
|
||||
{'ext': '.js', 'Cache-Control': 'no-cache'},
|
||||
{'prefix': '/imgs/', 'Access-Control-Allow-Origin': '*'},
|
||||
]
|
||||
Cling("/my/directory", headers=headers)
|
||||
|
||||
|
||||
Shock
|
||||
^^^^^
|
||||
|
||||
`Shock` has the same basic functionality like `Cling` but with Shock we can
|
||||
also have some templating fun. Shock comes with three templating backends.
|
||||
String substitution, kid and Genshi. The decision which backend to use is done
|
||||
by examining the extension of the file to serve. The file extensions are 'stp',
|
||||
'kid' and 'genshi'. So if you want to provide a file called 'index.html' via
|
||||
the kid backend, name your file 'index.html.kid'. A short example might look
|
||||
like this::
|
||||
|
||||
from static import Shock, KidMagic
|
||||
from wsgiref.simple_server import make_server
|
||||
my_app = Shock("/my/directory", magics=[KidMagic(title="Hello World")])
|
||||
make_server("localhost", 9999, my_app).serve_forever()
|
||||
|
||||
And the example 'index.html.kid'::
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:py="http://purl.org/kid/ns#"
|
||||
xml:lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<h1>$title</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
A similar template 'index.html.genshi' for Genshi::
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:py="http://genshi.edgewall.org/"
|
||||
xml:lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<h1>$title</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
This simple application will replace the placeholder `title` with 'Hello World'
|
||||
in every provided file which ends in '.kid'.
|
||||
In this example it already is already obvious, that although different template
|
||||
engines can be used, they can only be used in a very `static` way. Never the
|
||||
less `Shock` is perfectly suitable for simple semi-static things like make the
|
||||
URL to your companies logo, or the company name variable.
|
||||
|
||||
Unicode Support
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
When using a template system in Python3 it might be necessary to explicitly
|
||||
set an encoding for the sites provided. This can be done via the
|
||||
`encoding` attribute of `Shock`::
|
||||
|
||||
from static import Shock
|
||||
shock = Shock("/var/www/pub")
|
||||
shock.encoding="latin-1"
|
||||
|
||||
When using `Cling` or `Shock` to serve static content the
|
||||
encoding need not to be set, as the content is just streamed through.
|
||||
If you have templates encoded in different formats, an instance of
|
||||
`Shock` needs to be instantiated for every codec used.
|
||||
|
||||
.. _static: https://pypi.python.org/pypi/static
|
||||
.. _kid: https://pypi.python.org/pypi/kid
|
||||
.. _Genshi: https://pypi.python.org/pypi/Genshi
|
||||
|
||||
|
||||
12
deps/static3-0.7.0.dist-info/RECORD
vendored
Normal file
12
deps/static3-0.7.0.dist-info/RECORD
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
static.py,sha256=_La_14FEfeHLxusxIiPIsvXfx8h-BiPA3W93hFoiVPI,17040
|
||||
static3-0.7.0.dist-info/DESCRIPTION.rst,sha256=H8E1uojGVjsLrX2WaEnwRHlx7cpJb_6PY7X8eW7quZ4,5112
|
||||
static3-0.7.0.dist-info/METADATA,sha256=nV4bLhDG07KaPt302QnFpLM1qrcZaVxKWm_p3zfU9eU,5985
|
||||
static3-0.7.0.dist-info/RECORD,,
|
||||
static3-0.7.0.dist-info/WHEEL,sha256=lCqt3ViRAf9c8mCs6o7ffkwROUdYSy8_YHn5f_rulB4,93
|
||||
static3-0.7.0.dist-info/entry_points.txt,sha256=DdXbkNZ6bybcQvZ1UuzKl4PVnC3URrD4HFJJPwOz6Qk,71
|
||||
static3-0.7.0.dist-info/metadata.json,sha256=pfP2D-0H2Wk3N7J1tTAp73fwE0Jhoz9WHwc4B9bQOH8,1235
|
||||
static3-0.7.0.dist-info/pbr.json,sha256=qOe2g9uYl7DuoXuDSDYyJCE74oPgvOe3KjK0lVvCT_c,47
|
||||
static3-0.7.0.dist-info/top_level.txt,sha256=ZSyr8N5s1w9m9ysX1kCSA7hJCb6YZCYf62FJQ_LmzGI,7
|
||||
../../bin/static,sha256=BfrmipVBEvbxp3MPJul4miOZeZMYWJ1zjo1Ts81iVjI,229
|
||||
static3-0.7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
__pycache__/static.cpython-34.pyc,,
|
||||
5
deps/static3-0.7.0.dist-info/WHEEL
vendored
Normal file
5
deps/static3-0.7.0.dist-info/WHEEL
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.29.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: cp34-none-any
|
||||
|
||||
4
deps/static3-0.7.0.dist-info/entry_points.txt
vendored
Normal file
4
deps/static3-0.7.0.dist-info/entry_points.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
[console_scripts]
|
||||
static=static:command
|
||||
|
||||
1
deps/static3-0.7.0.dist-info/metadata.json
vendored
Normal file
1
deps/static3-0.7.0.dist-info/metadata.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"classifiers": ["Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries", "Topic :: Utilities"], "extensions": {"python.commands": {"wrap_console": {"static": "static:command"}}, "python.details": {"contacts": [{"email": "roman@fenkhuber.at", "name": "Roman Mohr", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/rmohr/static3"}}, "python.exports": {"console_scripts": {"static": "static:command"}}}, "extras": ["GenshiMagic", "KidMagic"], "generator": "bdist_wheel (0.29.0)", "keywords": ["wsgi", "web", "http", "static", "content", "webapps"], "license": "LGPL", "metadata_version": "2.0", "name": "static3", "run_requires": [{"extra": "GenshiMagic", "requires": ["Genshi"]}, {"extra": "KidMagic", "requires": ["kid"]}], "summary": "A really simple WSGI way to serve static (or mixed) content.", "test_requires": [{"requires": ["pytest", "pytest-cov", "webtest"]}], "version": "0.7.0"}
|
||||
1
deps/static3-0.7.0.dist-info/pbr.json
vendored
Normal file
1
deps/static3-0.7.0.dist-info/pbr.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"is_release": false, "git_version": "e5f88c5"}
|
||||
1
deps/static3-0.7.0.dist-info/top_level.txt
vendored
Normal file
1
deps/static3-0.7.0.dist-info/top_level.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
static
|
||||
Reference in New Issue
Block a user