Kivy-1.10.1/ 0000775 0001750 0001750 00000000000 13320367406 013556 5 ustar gabriel gabriel 0000000 0000000 Kivy-1.10.1/PKG-INFO 0000664 0001750 0001750 00000016540 13320367406 014661 0 ustar gabriel gabriel 0000000 0000000 Metadata-Version: 1.1
Name: Kivy
Version: 1.10.1
Summary: A software library for rapid development of hardware-accelerated multitouch applications.
Home-page: http://kivy.org
Author: Kivy Team and other contributors
Author-email: kivy-dev@googlegroups.com
License: MIT
Description: Kivy
====
Innovative user interfaces made easy.
Kivy is an open source, cross-platform [Python](https://www.python.org)
framework for the development of applications that make use of innovative,
multi-touch user interfaces.
The aim is to allow for quick and easy interaction design and rapid prototyping
whilst making your code reusable and deployable.
Kivy is written in Python and [Cython](http://cython.org/), based on OpenGL ES
2, supports various input devices and has an extensive widget library. With the
same codebase, you can target Windows, OS X, Linux, Android and iOS. All Kivy
widgets are built with multitouch support.
Kivy is MIT licensed, actively developed by a great community and is supported
by many projects managed by the [Kivy Organization](https://kivy.org/#organization).
[](https://coveralls.io/r/kivy/kivy?branch=master)
[](https://travis-ci.org/kivy/kivy)
[](https://ci.appveyor.com/project/KivyOrg/kivy/branch/master)
[](https://www.bountysource.com/trackers/42681-kivy?utm_source=42681&utm_medium=shield&utm_campaign=TRACKER_BADGE)
Installation, Documentation and Examples
----------------------------------------
Extensive installation instructions as well as tutorials and general
documentation, including an API reference, can be found at https://kivy.org/docs.
A [PDF version](https://media.readthedocs.org/pdf/kivy/latest/kivy.pdf) is also available.
Kivy ships with many examples which can be found in the `examples` folder.
Support
-------
If you need assistance, you can ask for help on our mailing list:
* User Group : https://groups.google.com/group/kivy-users
* Email : kivy-users@googlegroups.com
We also have an IRC channel:
* Server : irc.freenode.net
* Port : 6667, 6697 (SSL only)
* Channel : #kivy
* Web client : [WebChat](https://webchat.freenode.net/?nick=kvuser.&channels=kivy&uio=d4)
Contributing
------------
We love pull requests and discussing novel ideas. Check out our
[contribution guide](https://kivy.org/docs/contribute.html) and
feel free to improve Kivy.
The following mailing list and IRC channel are used exclusively for
discussions about developing the Kivy framework and its sister projects:
* Dev Group : https://groups.google.com/group/kivy-dev
* Email : kivy-dev@googlegroups.com
IRC channel:
* Server : irc.freenode.net
* Port : 6667, 6697 (SSL only)
* Channel : #kivy-dev
* Web client : [WebChat](https://webchat.freenode.net/?nick=kvuser.&channels=kivy-dev&uio=d4)
Sister projects
---------------
- [Buildozer](https://github.com/kivy/buildozer): generic Python packager
for Android and iOS.
- [Plyer](https://github.com/kivy/plyer): platform-independent Python wrapper
for platform-dependent APIs.
- [Pyjnius](https://github.com/kivy/pyjnius): dynamic access to the Java/Android
API from Python.
- [Pyobjus](https://github.com/kivy/pyobjus): dynamic access to the
Objective-C/iOS API from Python.
- [Python for Android](https://github.com/kivy/python-for-android): toolchain
for building and packaging Python applications for Android.
- [Kivy iOS](https://github.com/kivy/kivy-ios): toolchain for building and
packaging Kivy applications for iOS.
- [Audiostream](https://github.com/kivy/audiostream): library for direct access
to the microphone and speaker.
- [Kivy Designer](https://github.com/kivy/kivy-designer): UI designer for Kivy.
- [KivEnt](https://github.com/kivy/kivent): entity-based game engine for Kivy.
- [Garden](https://github.com/kivy-garden): widgets and libraries created and
maintained by users.
* [Oscpy](https://github.com/kivy/oscpy/): a fast and tested python2/3
implementation of OSC.
Licenses
--------
- Kivy is released under the terms of the MIT License. Please refer to the
LICENSE file.
- The provided fonts Roboto and Roboto Mono are licensed and
distributed under the terms of the
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
The DejaVuSans (used for the virtual keyboard) license can be viewed
[here](https://github.com/dejavu-fonts/dejavu-fonts/blob/master/LICENSE).
- The current UI design has been adapted from Moblintouch theme's SVGs
and is licensed under the terms of the
[LGPLv2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1).
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: MacOS X
Classifier: Environment :: Win32 (MS Windows)
Classifier: Environment :: X11 Applications
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Artistic Software
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Multimedia :: Graphics :: 3D Rendering
Classifier: Topic :: Multimedia :: Graphics :: Capture :: Digital Camera
Classifier: Topic :: Multimedia :: Graphics :: Presentation
Classifier: Topic :: Multimedia :: Graphics :: Viewers
Classifier: Topic :: Multimedia :: Sound/Audio :: Players :: MP3
Classifier: Topic :: Multimedia :: Video :: Display
Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: User Interfaces
Kivy-1.10.1/LICENSE 0000664 0001750 0001750 00000002071 13311466120 014554 0 ustar gabriel gabriel 0000000 0000000 Copyright (c) 2010-2018 Kivy Team and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Kivy-1.10.1/doc/ 0000775 0001750 0001750 00000000000 13320367406 014323 5 ustar gabriel gabriel 0000000 0000000 Kivy-1.10.1/doc/autobuild.py 0000644 0001750 0001750 00000015723 13207064022 016663 0 ustar gabriel gabriel 0000000 0000000 '''
Script to generate Kivy API from source code.
Code is messy, but working.
Be careful if you change anything in !
'''
ignore_list = (
'kivy._clock',
'kivy._event',
'kivy.factory_registers',
'kivy.graphics.buffer',
'kivy.graphics.vbo',
'kivy.graphics.vertex',
'kivy.uix.recycleview.__init__',
'kivy.setupconfig',
'kivy.version'
)
import os
import sys
from glob import glob
import kivy
# force loading of kivy modules
import kivy.app
import kivy.metrics
import kivy.atlas
import kivy.context
import kivy.core.audio
import kivy.core.camera
import kivy.core.clipboard
import kivy.core.gl
import kivy.core.image
import kivy.core.spelling
import kivy.core.text
import kivy.core.text.markup
import kivy.core.video
import kivy.core.window
import kivy.geometry
import kivy.graphics
import kivy.graphics.shader
import kivy.graphics.tesselator
import kivy.animation
import kivy.modules.console
import kivy.modules.keybinding
import kivy.modules.monitor
import kivy.modules.touchring
import kivy.modules.inspector
import kivy.modules.recorder
import kivy.modules.screen
import kivy.modules.joycursor
import kivy.storage
import kivy.storage.dictstore
import kivy.storage.jsonstore
import kivy.storage.redisstore
import kivy.network.urlrequest
import kivy.modules.webdebugger
import kivy.support
import kivy.tools.packaging.pyinstaller_hooks
import kivy.input.recorder
import kivy.interactive
import kivy.garden
from kivy.factory import Factory
from kivy.lib import osc, ddsfile, mtdev
# check for silenced build
BE_QUIET = True
if os.environ.get('BE_QUIET') == 'False':
BE_QUIET = False
# force loading of all classes from factory
for x in list(Factory.classes.keys())[:]:
getattr(Factory, x)
# Directory of doc
base_dir = os.path.dirname(__file__)
dest_dir = os.path.join(base_dir, 'sources')
examples_framework_dir = os.path.join(base_dir, '..', 'examples', 'framework')
# Check touch file
base = 'autobuild.py-done'
with open(os.path.join(base_dir, base), 'w') as f:
f.write('')
def writefile(filename, data):
global dest_dir
# avoid to rewrite the file if the content didn't change
f = os.path.join(dest_dir, filename)
if not BE_QUIET:
print('write', filename)
if os.path.exists(f):
with open(f) as fd:
if fd.read() == data:
return
h = open(f, 'w')
h.write(data)
h.close()
# Activate Kivy modules
'''
for k in kivy.kivy_modules.list().keys():
kivy.kivy_modules.import_module(k)
'''
# Search all kivy module
l = [(x, sys.modules[x],
os.path.basename(sys.modules[x].__file__).rsplit('.', 1)[0])
for x in sys.modules if x.startswith('kivy') and sys.modules[x]]
# Extract packages from modules
packages = []
modules = {}
api_modules = []
for name, module, filename in l:
if name in ignore_list:
continue
if not any([name.startswith(x) for x in ignore_list]):
api_modules.append(name)
if filename == '__init__':
packages.append(name)
else:
if hasattr(module, '__all__'):
modules[name] = module.__all__
else:
modules[name] = [x for x in dir(module) if not x.startswith('__')]
packages.sort()
# Create index
api_index = '''API Reference
-------------
The API reference is a lexicographic list of all the different classes,
methods and features that Kivy offers.
.. toctree::
:maxdepth: 1
'''
api_modules.sort()
for package in api_modules:
api_index += " api-%s.rst\n" % package
writefile('api-index.rst', api_index)
# Create index for all packages
# Note on displaying inherited members;
# Adding the directive ':inherited-members:' to automodule achieves this
# but is not always desired. Please see
# https://github.com/kivy/kivy/pull/3870
template = '\n'.join((
'=' * 100,
'$SUMMARY',
'=' * 100,
'''
$EXAMPLES_REF
.. automodule:: $PACKAGE
:members:
:show-inheritance:
.. toctree::
$EXAMPLES
'''))
template_examples = '''.. _example-reference%d:
Examples
--------
%s
'''
template_examples_ref = ('# :ref:`Jump directly to Examples'
' `')
def extract_summary_line(doc):
"""
:param doc: the __doc__ field of a module
:return: a doc string suitable for a header or empty string
"""
if doc is None:
return ''
for line in doc.split('\n'):
line = line.strip()
# don't take empty line
if len(line) < 1:
continue
# ref mark
if line.startswith('.. _'):
continue
return line
for package in packages:
summary = extract_summary_line(sys.modules[package].__doc__)
if summary is None or summary == '':
summary = 'NO DOCUMENTATION (package %s)' % package
t = template.replace('$SUMMARY', summary)
t = t.replace('$PACKAGE', package)
t = t.replace('$EXAMPLES_REF', '')
t = t.replace('$EXAMPLES', '')
# search packages
for subpackage in packages:
packagemodule = subpackage.rsplit('.', 1)[0]
if packagemodule != package or len(subpackage.split('.')) <= 2:
continue
t += " api-%s.rst\n" % subpackage
# search modules
m = list(modules.keys())
m.sort(key=lambda x: extract_summary_line(sys.modules[x].__doc__).upper())
for module in m:
packagemodule = module.rsplit('.', 1)[0]
if packagemodule != package:
continue
t += " api-%s.rst\n" % module
writefile('api-%s.rst' % package, t)
# Create index for all module
m = list(modules.keys())
m.sort()
refid = 0
for module in m:
summary = extract_summary_line(sys.modules[module].__doc__)
if summary is None or summary == '':
summary = 'NO DOCUMENTATION (module %s)' % package
# search examples
example_output = []
example_prefix = module
if module.startswith('kivy.'):
example_prefix = module[5:]
example_prefix = example_prefix.replace('.', '_')
# try to found any example in framework directory
list_examples = glob('%s*.py' % os.path.join(
examples_framework_dir, example_prefix))
for x in list_examples:
# extract filename without directory
xb = os.path.basename(x)
# add a section !
example_output.append('File :download:`%s <%s>` ::' % (
xb, os.path.join('..', x)))
# put the file in
with open(x, 'r') as fd:
d = fd.read().strip()
d = '\t' + '\n\t'.join(d.split('\n'))
example_output.append(d)
t = template.replace('$SUMMARY', summary)
t = t.replace('$PACKAGE', module)
if len(example_output):
refid += 1
example_output = template_examples % (
refid, '\n\n\n'.join(example_output))
t = t.replace('$EXAMPLES_REF', template_examples_ref % refid)
t = t.replace('$EXAMPLES', example_output)
else:
t = t.replace('$EXAMPLES_REF', '')
t = t.replace('$EXAMPLES', '')
writefile('api-%s.rst' % module, t)
# Generation finished
print('Auto-generation finished')
Kivy-1.10.1/doc/README.md 0000644 0001750 0001750 00000002160 13207064022 015567 0 ustar gabriel gabriel 0000000 0000000 Kivy - Documentation
====================
You can access the latest documentation on the web:
* http://kivy.org/docs
Contributing
------------
If you intend on editing and contributing documentation, assure the kivy source
code is up to date before proceeding. If your documentation is outdated, it
could result in merge conflicts.
Install Sphinx
--------------
- With pip:
``pip install sphinx``
- With apt-get:
``apt-get install python-sphinx``
- With MacPorts:
``port install py34-sphinx``
- On Windows (or from inside your virtualenv):
Get pip (https://pypi.python.org/pypi/pip). You'll use it to install the dependencies.
To install pip, run ``python setup.py install`` in the pip directory. Now run:
``pip install sphinxcontrib-blockdiag sphinxcontrib-seqdiag``
``pip install sphinxcontrib-actdiag sphinxcontrib-nwdiag``
Or just use the provided *doc-requirements.txt*:
``pip install -r doc-requirements.txt``
Building the documentation
--------------------------
Generate documentation using make: ``make html``.
Documentation will be accessible in ``build/html/``.
Kivy-1.10.1/doc/doc-requirements.txt 0000644 0001750 0001750 00000000237 13150135243 020343 0 ustar gabriel gabriel 0000000 0000000 Cython>=0.23
# Frozen Sphinx requirements for easier pip installation
sphinxcontrib-actdiag
sphinxcontrib-blockdiag
sphinxcontrib-nwdiag
sphinxcontrib-seqdiag
Kivy-1.10.1/doc/Makefile 0000644 0001750 0001750 00000011211 13150135243 015746 0 ustar gabriel gabriel 0000000 0000000 # Makefile for Sphinx documentation
#
ENDUSER_BUILD = yes
# You can set these variables from the command line.
PYTHON = python
SPHINXOPTS = -Q
SPHINXOPTS_TEST = -W -T
SPHINXBUILD = sphinx-build
PAPER =
fasthtml: SPHINXOPTS += -j4
# platform independent path separator
# only system calls need to use $(P), b/c on win system calls have issues with /
ifdef ComSpec
PATHSEP2=\\
MKDIR=mkdir
else
PATHSEP2=/
MKDIR=mkdir -p
endif
P=$(strip $(PATHSEP2))
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sources
ALLSPHINXOPTS_TEST = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS_TEST) sources
ALLSPHINXOPTSGT = -d build/doctrees_gettext $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sources
ALLSPHINXOPTSGT_TEST = -d build/doctrees_gettext $(PAPEROPT_$(PAPER)) $(SPHINXOPTS_TEST) sources
LATEXOPTS = -interaction=batchmode
LATEXOPTS_TESTS =
ifeq ($(ENDUSER_BUILD),yes)
_TESTS =
else
_TESTS = _TEST
endif
# Created in autobuild.py
AUTOBUILD_STAMP = "autobuild.py-done"
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck gettext
help:
@echo "Please use \`make ' where is one of"
@echo " build-all to build the common documentation types."
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " clean to remove generated files"
@echo " gettext to make gettext pages"
@echo " html to make standalone HTML files"
@echo " fasthtml same as html, with 4 concurrent processes"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " linkcheck to check through the reference linking"
@echo " man to build Man doctrees."
@echo " pdf to make standalone PDF files"
@echo " pickle to make pickle files (usable by e.g. sphinx-web)"
@echo " ps to make standalone PS files"
@echo " web same as pickle"
clean:
-rm -rf sources/api-*.rst
-rm -rf sources/examples/gen__*.rst
-rm -rf sources/examples/gallery.rst
-rm -rf sources/examples/index.rst
# windows just doesn't support e.g. build\*
ifdef ComSpec
-rmdir /s /q build
else
-rm -rf build/*
-rm $(AUTOBUILD_STAMP)*
endif
fasthtml: html
html:
$(MKDIR) build$(P)html build$(P)doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS$(_TESTS)) build/html
@echo
@echo "Build finished. The HTML pages are in build/html."
gettext:
$(MKDIR) build$(P)html build$(P)doctrees_gettext
$(SPHINXBUILD) -b gettext $(ALLSPHINXOPTSGT$(_TESTS)) build/gettext
@echo
@echo "Build finished. The Gettext pages are in build/gettext."
pickle:
$(MKDIR) build$(P)pickle build$(P)doctrees
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS$(_TESTS)) build/pickle
@echo
@echo "Build finished; now you can process the pickle files or run"
@echo " sphinx-web build/pickle"
@echo "to start the sphinx-web server."
web: pickle
htmlhelp:
$(MKDIR) build$(P)htmlhelp build$(P)doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS$(_TESTS)) build/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in build/htmlhelp."
latex:
$(MKDIR) build$(P)latex build$(P)doctrees
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS$(_TESTS)) build/latex
@echo
@echo "Build finished; the LaTeX files are in build/latex."
@echo "Run \`make all-pdf' or \`make all-ps' to" \
"run these through (pdf)latex."
pdf: latex
rm -f build$(P)latex$(P)Kivy.pdf
-$(MAKE) -C build$(P)latex all-pdf LATEXOPTS=$(LATEXOPTS$(_TESTS))
ifneq ("$(wildcard build$(P)latex$(P)Kivy.pdf)","")
@echo
@echo "Build finished; the PDF file(s) are in build/latex."
@echo "You can safely ignore the errors which might appeared above!"
else
@echo
@echo "Build failed; there is no PDF file(s) in build/latex."
exit 1
endif
ps: latex
$(MAKE) -C build$(P)latex all-ps
@echo
@echo "Build finished; the PS files are in build/latex."
man:
$(MKDIR) build$(P)man build$(P)doctrees
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS$(_TESTS)) build/man
@echo
@echo "Build finished. The manual pages are in build/man."
changes:
$(MKDIR) build$(P)changes build$(P)doctrees
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS$(_TESTS)) build/changes
@echo
@echo "The overview file is in build/changes."
linkcheck:
$(MKDIR) build$(P)linkcheck build$(P)doctrees
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS$(_TESTS)) build/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in build/linkcheck/output.txt."
build-all: html pickle htmlhelp pdf ps gettext
# TODO: Make test run in non-enduser-build mode
test: build-all
Kivy-1.10.1/doc/__init__.py 0000644 0001750 0001750 00000000000 13130163657 016421 0 ustar gabriel gabriel 0000000 0000000 Kivy-1.10.1/doc/gallery.py 0000664 0001750 0001750 00000027275 13311466120 016342 0 ustar gabriel gabriel 0000000 0000000 ''' Create rst documentation of the examples directory.
This uses screenshots in the screenshots_dir
(currently doc/sources/images/examples) along with source code and files
in the examples/ directory to create rst files in the generation_dir
(doc/sources/examples) gallery.rst, index.rst, and gen__*.rst
'''
import os
import re
from os.path import sep
from os.path import join as slash # just like that name better
from os.path import dirname, abspath
from kivy.logger import Logger
import textwrap
# from here to the kivy top
base_dir = dirname(dirname(abspath(__file__)))
examples_dir = slash(base_dir, 'examples')
screenshots_dir = slash(base_dir, 'doc/sources/images/examples')
generation_dir = slash(base_dir, 'doc/sources/examples')
image_dir = "../images/examples/" # relative to generation_dir
gallery_filename = slash(generation_dir, 'gallery.rst')
# Info is a dict built up from
# straight filename information, more from reading the docstring,
# and more from parsing the description text. Errors are often
# shown by setting the key 'error' with the value being the error message.
#
# It doesn't quite meet the requirements for a class, but is a vocabulary
# word in this module.
def iter_filename_info(dir_name):
"""
Yield info (dict) of each matching screenshot found walking the
directory dir_name. A matching screenshot uses double underscores to
separate fields, i.e. path__to__filename__py.png as the screenshot for
examples/path/to/filename.py.
Files not ending with .png are ignored, others are either parsed or
yield an error.
Info fields 'dunder', 'dir', 'file', 'ext', 'source' if not 'error'
"""
pattern = re.compile(r'^((.+)__(.+)__([^-]+))\.png')
for t in os.walk(dir_name):
for filename in t[2]:
if filename.endswith('.png'):
m = pattern.match(filename)
if m is None:
yield {'error': 'png filename not following screenshot'
' pattern: {}'.format(filename)}
else:
d = m.group(2).replace('__', sep)
yield {'dunder': m.group(1),
'dir': d,
'file': m.group(3),
'ext': m.group(4),
'source': slash(d, m.group(3) + '.' + m.group(4))
}
def parse_docstring_info(text):
''' parse docstring from text (normal string with '\n's) and return an info
dict. A docstring should the first triple quoted string, have a title
followed by a line of equal signs, and then a description at
least one sentence long.
fields are 'docstring', 'title', and 'first_sentence' if not 'error'
'first_sentence' is a single line without newlines.
'''
q = '\"\"\"|\'\'\''
p = r'({})\s+([^\n]+)\s+\=+\s+(.*?)(\1)'.format(q)
m = re.search(p, text, re.S)
if m:
comment = m.group(3).replace('\n', ' ')
first_sentence = comment[:comment.find('.') + 1]
return {'docstring': m.group(0), 'title': m.group(2),
'description': m.group(3), 'first_sentence': first_sentence}
else:
return {'error': 'Did not find docstring with title at top of file.'}
def iter_docstring_info(dir_name):
''' Iterate over screenshots in directory, yield info from the file
name and initial parse of the docstring. Errors are logged, but
files with errors are skipped.
'''
for file_info in iter_filename_info(dir_name):
if 'error' in file_info:
Logger.error(file_info['error'])
continue
source = slash(examples_dir, file_info['dir'],
file_info['file'] + '.' + file_info['ext'])
if not os.path.exists(source):
Logger.error('Screen shot references source code that does '
'not exist: %s', source)
continue
with open(source) as f:
text = f.read()
docstring_info = parse_docstring_info(text)
if 'error' in docstring_info:
Logger.error(docstring_info['error'] + ' File: ' + source)
continue # don't want to show ugly entries
else:
file_info.update(docstring_info)
yield file_info
def enhance_info_description(info, line_length=79):
''' Using the info['description'], add fields to info.
info['files'] is the source filename and any filenames referenced by the
magic words in the description, e.g. 'the file xxx.py' or
'The image this.png'. These are as written in the description, do
not allow ../dir notation, and are relative to the source directory.
info['enhanced_description'] is the description, as an array of
paragraphs where each paragraph is an array of lines wrapped to width
line_length. This enhanced description include the rst links to
the files of info['files'].
'''
# make text a set of long lines, one per paragraph.
paragraphs = info['description'].split('\n\n')
lines = [
paragraph.replace('\n', '$newline$')
for paragraph in paragraphs
]
text = '\n'.join(lines)
info['files'] = [info['file'] + '.' + info['ext']]
regex = r'[tT]he (?:file|image) ([\w\/]+\.\w+)'
for name in re.findall(regex, text):
if name not in info['files']:
info['files'].append(name)
# add links where the files are referenced
folder = '_'.join(info['source'].split(sep)[:-1]) + '_'
text = re.sub(r'([tT]he (?:file|image) )([\w\/]+\.\w+)',
r'\1:ref:`\2 <$folder$\2>`', text)
text = text.replace('$folder$', folder)
# now break up text into array of paragraphs, each an array of lines.
lines = [line.replace('$newline$', '\n') for line in text.split('\n')]
paragraphs = [
textwrap.wrap(line, line_length)
# ignore wrapping if .. note:: or similar block
if not line.startswith(' ') else [line]
for line in lines
]
info['enhanced_description'] = paragraphs
def get_infos(dir_name):
''' return infos, an array info dicts for each matching screenshot in the
dir, sorted by source file name, and adding the field 'num' as he unique
order in this array of dicts'.
'''
infos = [i for i in iter_docstring_info(dir_name)]
infos.sort(key=lambda x: x['source'])
for num, info in enumerate(infos):
info['num'] = num
enhance_info_description(info)
return infos
def make_gallery_page(infos):
''' return string of the rst (Restructured Text) of the gallery page,
showing information on all screenshots found.
'''
def a(s=''):
''' append formatted s to output, which will be joined into lines '''
output.append(s.format(**info))
def t(left='', right=''):
''' append left and right format strings into a table line. '''
l = left.format(**info)
r = right.format(**info)
if len(l) > width1 or len(r) > width2:
Logger.error('items to wide for generated table: "%s" and "%s"',
l, r)
return
output.append('| {0:{w1}} | {1:{w2}} |'
.format(l, r, w1=width1, w2=width2))
gallery_top = '''
Gallery
-------
.. _Tutorials: ../tutorials-index.html
.. container:: title
This gallery lets you explore the many examples included with Kivy.
Click on any screenshot to see the code.
This gallery contains:
* Examples from the examples/ directory that show specific capabilities of
different libraries and features of Kivy.
* Demonstrations from the examples/demos/ directory that explore many of
Kivy's abilities.
There are more Kivy programs elsewhere:
* Tutorials_ walks through the development of complete Kivy applications.
* Unit tests found in the source code under the subdirectory kivy/tests/
can also be useful.
We hope your journey into learning Kivy is exciting and fun!
'''
output = [gallery_top]
for info in infos:
a("\n.. |link{num}| replace:: :doc:`{source}`")
a("\n.. |pic{num}| image:: ../images/examples/{dunder}.png"
"\n :width: 216pt"
"\n :align: middle"
"\n :target: gen__{dunder}.html")
a("\n.. |title{num}| replace:: **{title}**")
# write the table
width1, width2 = 20, 50 # not including two end spaces
head = '+-' + '-' * width1 + '-+-' + '-' * width2 + '-+'
a()
a(head)
for info in infos:
t('| |pic{num}|', '| |title{num}|')
t('| |link{num}|', '')
paragraphs = info['description'].split("\n\n")
for p in paragraphs:
for line in textwrap.wrap(p, width2):
t('', line)
t() # line between paragraphs
t()
a(head)
return "\n".join(output) + "\n"
def make_detail_page(info):
''' return str of the rst text for the detail page of the file in info. '''
def a(s=''):
''' append formatted s to output, which will be joined into lines '''
output.append(s.format(**info))
output = []
a('{title}')
a('=' * len(info['title']))
a('\n.. |pic{num}| image:: /images/examples/{dunder}.png'
'\n :width: 50%'
'\n :align: middle')
a('\n|pic{num}|')
a()
for paragraph in info['enhanced_description']:
for line in paragraph:
a(line)
a()
# include images
last_lang = '.py'
for fname in info['files']:
full_name = slash(info['dir'], fname)
ext = re.search(r'\.\w+$', fname).group(0)
a('\n.. _`' + full_name.replace(sep, '_') + '`:')
# double separator if building on windows (sphinx skips backslash)
if '\\' in full_name:
full_name = full_name.replace(sep, sep*2)
if ext in ['.png', '.jpg', '.jpeg']:
title = 'Image **' + full_name + '**'
a('\n' + title)
a('~' * len(title))
a('\n.. image:: ../../../examples/' + full_name)
a(' :align: center')
else: # code
title = 'File **' + full_name + '**'
a('\n' + title)
a('~' * len(title))
if ext != last_lang and ext != '.txt':
a('\n.. highlight:: ' + ext[1:])
a(' :linenothreshold: 3')
last_lang = ext
# prevent highlight errors with 'none'
elif ext == '.txt':
a('\n.. highlight:: none')
a(' :linenothreshold: 3')
last_lang = ext
a('\n.. include:: ../../../examples/' + full_name)
a(' :code:')
return '\n'.join(output) + '\n'
def write_file(name, s):
''' write the string to the filename '''
with open(name, 'w') as f:
f.write(s)
def make_index(infos):
''' return string of the rst for the gallery's index.rst file. '''
start_string = '''
Gallery of Examples
===================
.. toctree::
:maxdepth: 1
gallery'''
output = [start_string]
for info in infos:
output.append(' gen__{}'.format(info['dunder']))
return '\n'.join(output) + '\n'
def write_all_rst_pages():
''' Do the main task of writing the gallery,
detail, and index rst pages.
'''
infos = get_infos(screenshots_dir)
s = make_gallery_page(infos)
write_file(gallery_filename, s)
for info in infos:
s = make_detail_page(info)
detail_name = slash(generation_dir,
'gen__{}.rst'.format(info['dunder']))
write_file(detail_name, s)
s = make_index(infos)
index_name = slash(generation_dir, 'index.rst')
write_file(index_name, s)
Logger.info('gallery.py: Created gallery rst documentation pages.')
if __name__ == '__main__':
write_all_rst_pages()
Kivy-1.10.1/doc/sources/ 0000775 0001750 0001750 00000000000 13320367406 016006 5 ustar gabriel gabriel 0000000 0000000 Kivy-1.10.1/doc/sources/logo.png 0000644 0001750 0001750 00000166620 13130163657 017466 0 ustar gabriel gabriel 0000000 0000000 PNG
IHDR 2 sRGB pHYs tIME7)%0 bKGD ̿ IDATxyg}&oU_shFXeɗ$6[6 l ~ sM>e!, 9$
ߗCc?꭪9>gyb ,p0K NB<|@8|Mr@ H zD,%^%[ HickUr O䟤x;\/H #h>&{F_@` ~%@;u_Gj+ !@ $ 3$J{SZ,w}A$ @ ~Ww#H {
@eI^$L})U@B@ H H_Ek'PT ?Mn_ @ ~}vfL P?@`$ym&yp)@- [j 0JSz @ 8_M\u+ EM oWQ @ pP>OR{j ҐpњJMONzz]OM;&o@U#@2@ H , בuJ_d`Z׆G~Lھn13uȡӻ<͝C2'IWJ
~xrrWZ~Iƒˠ44gM8cCwv+A_l! @ 0?i3 HO}ӗv%]vS<\oPP&_8ݻBR| +4PJ7D @ q9S~tekW]vɒuy t`Łtm ڷ]|x!VF
vT~@Җ @ $ ,OW$_{J 5oظiÚ
21/;&ۀ5SGwm{j?=u ΟFd@z @ 0qU~=l+7_iզ5YJO3urRB5'}rSl} [Z)2AI_E_7۴bC}I"uOwo~L`Vt?.;uʳBMД@K#5 9!lo&~/7tKFrfi_H7%w}EN1$@N Bo_?}O>uDVGZG@ SO-߄ _ke` Pӓ~w~{2A>R NE=>(D-ДD$h) } @ ЃocU/,$"}6t !?䏿SEm!
lR@L$/@ H Li˿2ߡ|oud̟P5'En@+ȟػww#fB?#B )(!@ $ zF_G `\_ʘYfo&UaV 'm>
fD\rZ [@"@ H tIϕFݼgشeh
I95F $Pdgp|S}ۏd@V
2D @ (*gK֩%[TĿpmr@rH}>'C-B VB;$@ $
*Ojyw|tϣ5,17oq+U]@r }3A3n 9?kgߗg?yO-^k"5"|@ur0 ^m_f&L2D @ ?uÃ=kYd瘿8e }8G_`F̠CJD @ EhOA1nӛ߸V^㙙igD2B!М|wψf0#fDS 2 .
@@^S俼oM><