Skip to content

Commit be1d748

Browse files
committedFeb 10, 2014
first release
1 parent 63db33d commit be1d748

23 files changed

+2279
-0
lines changed
 

‎LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Miguel Grinberg
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README.md

+29
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,32 @@ Flask-SocketIO
22
==============
33

44
Socket.IO integration for Flask applications.
5+
6+
Example
7+
-------
8+
9+
from flask import Flask, render_template
10+
from flask.ext.socketio import SocketIO, emit
11+
12+
app = Flask(__name__)
13+
app.config['SECRET_KEY'] = 'secret!'
14+
socketio = SocketIO(app)
15+
16+
@app.route('/')
17+
def index():
18+
return render_template('index.html')
19+
20+
@socketio.on('my event')
21+
def test_message(message):
22+
emit('my response', {'data': 'got it!'})
23+
24+
if __name__ == '__main__':
25+
socketio.run(app)
26+
27+
Resources
28+
---------
29+
30+
- [Tutorial](http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent)
31+
- [Documentation](http://pythonhosted.org/Flask-SocketIO)
32+
- [PyPI](https://pypi.python.org/pypi/Flask-SocketIO)
33+

‎docs/Makefile

+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = _build
9+
10+
# User-friendly check for sphinx-build
11+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13+
endif
14+
15+
# Internal variables.
16+
PAPEROPT_a4 = -D latex_paper_size=a4
17+
PAPEROPT_letter = -D latex_paper_size=letter
18+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19+
# the i18n builder cannot share the environment and doctrees with the others
20+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21+
22+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23+
24+
help:
25+
@echo "Please use \`make <target>' where <target> is one of"
26+
@echo " html to make standalone HTML files"
27+
@echo " dirhtml to make HTML files named index.html in directories"
28+
@echo " singlehtml to make a single large HTML file"
29+
@echo " pickle to make pickle files"
30+
@echo " json to make JSON files"
31+
@echo " htmlhelp to make HTML files and a HTML help project"
32+
@echo " qthelp to make HTML files and a qthelp project"
33+
@echo " devhelp to make HTML files and a Devhelp project"
34+
@echo " epub to make an epub"
35+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
37+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38+
@echo " text to make text files"
39+
@echo " man to make manual pages"
40+
@echo " texinfo to make Texinfo files"
41+
@echo " info to make Texinfo files and run them through makeinfo"
42+
@echo " gettext to make PO message catalogs"
43+
@echo " changes to make an overview of all changed/added/deprecated items"
44+
@echo " xml to make Docutils-native XML files"
45+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
46+
@echo " linkcheck to check all external links for integrity"
47+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
48+
49+
clean:
50+
rm -rf $(BUILDDIR)/*
51+
52+
html:
53+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54+
@echo
55+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56+
57+
dirhtml:
58+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59+
@echo
60+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61+
62+
singlehtml:
63+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64+
@echo
65+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66+
67+
pickle:
68+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69+
@echo
70+
@echo "Build finished; now you can process the pickle files."
71+
72+
json:
73+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74+
@echo
75+
@echo "Build finished; now you can process the JSON files."
76+
77+
htmlhelp:
78+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79+
@echo
80+
@echo "Build finished; now you can run HTML Help Workshop with the" \
81+
".hhp project file in $(BUILDDIR)/htmlhelp."
82+
83+
qthelp:
84+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85+
@echo
86+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
87+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Flask-SocketIO.qhcp"
89+
@echo "To view the help file:"
90+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Flask-SocketIO.qhc"
91+
92+
devhelp:
93+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94+
@echo
95+
@echo "Build finished."
96+
@echo "To view the help file:"
97+
@echo "# mkdir -p $$HOME/.local/share/devhelp/Flask-SocketIO"
98+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Flask-SocketIO"
99+
@echo "# devhelp"
100+
101+
epub:
102+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103+
@echo
104+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105+
106+
latex:
107+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108+
@echo
109+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
111+
"(use \`make latexpdf' here to do that automatically)."
112+
113+
latexpdf:
114+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115+
@echo "Running LaTeX files through pdflatex..."
116+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
117+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118+
119+
latexpdfja:
120+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121+
@echo "Running LaTeX files through platex and dvipdfmx..."
122+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124+
125+
text:
126+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127+
@echo
128+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
129+
130+
man:
131+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132+
@echo
133+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134+
135+
texinfo:
136+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137+
@echo
138+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139+
@echo "Run \`make' in that directory to run these through makeinfo" \
140+
"(use \`make info' here to do that automatically)."
141+
142+
info:
143+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144+
@echo "Running Texinfo files through makeinfo..."
145+
make -C $(BUILDDIR)/texinfo info
146+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147+
148+
gettext:
149+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150+
@echo
151+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152+
153+
changes:
154+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155+
@echo
156+
@echo "The overview file is in $(BUILDDIR)/changes."
157+
158+
linkcheck:
159+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160+
@echo
161+
@echo "Link check complete; look for any errors in the above output " \
162+
"or in $(BUILDDIR)/linkcheck/output.txt."
163+
164+
doctest:
165+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166+
@echo "Testing of doctests in the sources finished, look at the " \
167+
"results in $(BUILDDIR)/doctest/output.txt."
168+
169+
xml:
170+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171+
@echo
172+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173+
174+
pseudoxml:
175+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176+
@echo
177+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

‎docs/_static/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Flask-SocketIO documentation</title>
5+
<meta http-equiv="refresh" content="0; URL=http://flask-socketio.readthedocs.org/">
6+
<meta name="keywords" content="automatic redirection">
7+
</head>
8+
<body>
9+
The Flask-SocketIO documentation is available at <a href="http://flask-socketio.readthedocs.org">Read the Docs</a>.
10+
If your browser does not automatically redirect you, please <a href="http://flask-socketio.readthedocs.org">click here</a>.
11+
</body>
12+
</html>

‎docs/_static/logo.png

15.6 KB
Loading

‎docs/_themes/LICENSE

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Copyright (c) 2010 by Armin Ronacher.
2+
3+
Some rights reserved.
4+
5+
Redistribution and use in source and binary forms of the theme, with or
6+
without modification, are permitted provided that the following conditions
7+
are met:
8+
9+
* Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above
13+
copyright notice, this list of conditions and the following
14+
disclaimer in the documentation and/or other materials provided
15+
with the distribution.
16+
17+
* The names of the contributors may not be used to endorse or
18+
promote products derived from this software without specific
19+
prior written permission.
20+
21+
We kindly ask you to only use these themes in an unmodified manner just
22+
for Flask and Flask-related products, not for unrelated projects. If you
23+
like the visual style and want to use it for your own projects, please
24+
consider making some larger changes to the themes (such as changing
25+
font faces, sizes, colors or margins).
26+
27+
THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36+
ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE
37+
POSSIBILITY OF SUCH DAMAGE.

‎docs/_themes/README

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Flask Sphinx Styles
2+
===================
3+
4+
This repository contains sphinx styles for Flask and Flask related
5+
projects. To use this style in your Sphinx documentation, follow
6+
this guide:
7+
8+
1. put this folder as _themes into your docs folder. Alternatively
9+
you can also use git submodules to check out the contents there.
10+
2. add this to your conf.py:
11+
12+
sys.path.append(os.path.abspath('_themes'))
13+
html_theme_path = ['_themes']
14+
html_theme = 'flask'
15+
16+
The following themes exist:
17+
18+
- 'flask' - the standard flask documentation theme for large
19+
projects
20+
- 'flask_small' - small one-page theme. Intended to be used by
21+
very small addon libraries for flask.
22+
23+
The following options exist for the flask_small theme:
24+
25+
[options]
26+
index_logo = '' filename of a picture in _static
27+
to be used as replacement for the
28+
h1 in the index.rst file.
29+
index_logo_height = 120px height of the index logo
30+
github_fork = '' repository name on github for the
31+
"fork me" badge

‎docs/_themes/flask/layout.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{%- extends "basic/layout.html" %}
2+
{%- block extrahead %}
3+
{{ super() }}
4+
{% if theme_touch_icon %}
5+
<link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
6+
{% endif %}
7+
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
8+
{% endblock %}
9+
{%- block relbar2 %}{% endblock %}
10+
{% block header %}
11+
{{ super() }}
12+
{% if pagename == 'index' %}
13+
<div class=indexwrapper>
14+
{% endif %}
15+
{% endblock %}
16+
{%- block footer %}
17+
<div class="footer">
18+
&copy; Copyright {{ copyright }}.
19+
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
20+
</div>
21+
{% if pagename == 'index' %}
22+
</div>
23+
{% endif %}
24+
{%- endblock %}

‎docs/_themes/flask/relations.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<h3>Related Topics</h3>
2+
<ul>
3+
<li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul>
4+
{%- for parent in parents %}
5+
<li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul>
6+
{%- endfor %}
7+
{%- if prev %}
8+
<li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter')
9+
}}">{{ prev.title }}</a></li>
10+
{%- endif %}
11+
{%- if next %}
12+
<li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter')
13+
}}">{{ next.title }}</a></li>
14+
{%- endif %}
15+
{%- for parent in parents %}
16+
</ul></li>
17+
{%- endfor %}
18+
</ul></li>
19+
</ul>

0 commit comments

Comments
 (0)
Please sign in to comment.