Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'doc_updates' of https://github.com/aspidites/kivy into …

…aspidites-doc_updates
  • Loading branch information...
commit 57fe6b504fb8bc5971e582f13936173813257578 2 parents ba58922 + c7408e0
@tito tito authored
Showing with 156 additions and 144 deletions.
  1. +1 −0  Makefile
  2. +9 −1 doc/Makefile
  3. +3 −6 doc/README
  4. +3 −6 doc/sources/conf.py
  5. +1 −0  doc/sources/contribute.rst
  6. +1 −1  doc/sources/gettingstarted/events.rst
  7. +1 −1  doc/sources/gettingstarted/layouts.rst
  8. +2 −2 doc/sources/guide/inputs.rst
  9. +3 −2 doc/sources/guide/layouts.rst
  10. +1 −1  doc/sources/guide/widgettree.rst
  11. +1 −1  doc/sources/installation/installation.rst
  12. +1 −1  doc/sources/sphinxext/preprocess.py
  13. +13 −9 kivy/__init__.py
  14. +1 −1  kivy/animation.py
  15. +1 −1  kivy/app.py
  16. +1 −1  kivy/base.py
  17. +4 −4 kivy/clock.py
  18. +1 −1  kivy/config.py
  19. +2 −2 kivy/core/clipboard/__init__.py
  20. +1 −1  kivy/core/image/__init__.py
  21. +10 −7 kivy/core/window/__init__.py
  22. +3 −3 kivy/graphics/compiler.pyx
  23. +1 −1  kivy/graphics/fbo.pyx
  24. +3 −3 kivy/graphics/transformation.pyx
  25. +2 −2 kivy/input/factory.py
  26. +4 −4 kivy/input/motionevent.py
  27. +1 −1  kivy/input/postproc/dejitter.py
  28. +1 −1  kivy/input/postproc/doubletap.py
  29. +1 −1  kivy/input/postproc/ignorelist.py
  30. +1 −1  kivy/input/postproc/retaintouch.py
  31. +2 −2 kivy/input/providers/hidinput.py
  32. +1 −1  kivy/input/providers/linuxwacom.py
  33. +2 −2 kivy/input/providers/mouse.py
  34. +1 −1  kivy/input/providers/mtdev.py
  35. +1 −1  kivy/input/providers/probesysfs.py
  36. +2 −2 kivy/lang.py
  37. +1 −1  kivy/loader.py
  38. +1 −1  kivy/properties.pyx
  39. +1 −1  kivy/tools/pep8checker/pre-commit.githook
  40. +1 −1  kivy/uix/anchorlayout.py
  41. +2 −2 kivy/uix/button.py
  42. +2 −2 kivy/uix/camera.py
  43. +10 −11 kivy/uix/floatlayout.py
  44. +4 −4 kivy/uix/image.py
  45. +4 −4 kivy/uix/label.py
  46. +4 −4 kivy/uix/popup.py
  47. +1 −1  kivy/uix/progressbar.py
  48. +6 −6 kivy/uix/relativelayout.py
  49. +6 −6 kivy/uix/scatter.py
  50. +1 −1  kivy/uix/screenmanager.py
  51. +1 −1  kivy/uix/scrollview.py
  52. +5 −5 kivy/uix/slider.py
  53. +3 −3 kivy/uix/tabbedpanel.py
  54. +7 −7 kivy/uix/textinput.py
  55. +1 −1  kivy/uix/togglebutton.py
  56. +2 −1  kivy/uix/treeview.py
  57. +2 −2 kivy/uix/video.py
  58. +1 −1  kivy/uix/videoplayer.py
  59. +3 −3 kivy/utils.py
View
1  Makefile
@@ -48,6 +48,7 @@ clean:
-rm .coverage
-rm .noseids
-rm -rf kivy/tests/build
+ -find kivy -iname '*.so' -exec rm {} \;
-find kivy -iname '*.pyc' -exec rm {} \;
-find kivy -iname '*.pyo' -exec rm {} \;
View
10 doc/Makefile
@@ -2,7 +2,8 @@
#
# You can set these variables from the command line.
-SPHINXOPTS =
+PYTHON = python
+SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
PAPER =
@@ -28,12 +29,14 @@ clean:
html:
mkdir -p build/html build/doctrees
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
@echo
@echo "Build finished. The HTML pages are in build/html."
gettext:
mkdir -p build/html build/doctrees_gettext
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b gettext $(ALLSPHINXOPTSGT) build/gettext
@echo
@echo "Build finished. The Gettext pages are in build/gettext."
@@ -41,6 +44,7 @@ gettext:
pickle:
mkdir -p build/pickle build/doctrees
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
@echo
@echo "Build finished; now you can process the pickle files or run"
@@ -51,6 +55,7 @@ web: pickle
htmlhelp:
mkdir -p build/htmlhelp build/doctrees
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
@@ -58,6 +63,7 @@ htmlhelp:
latex:
mkdir -p build/latex build/doctrees
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
@echo
@echo "Build finished; the LaTeX files are in build/latex."
@@ -66,12 +72,14 @@ latex:
changes:
mkdir -p build/changes build/doctrees
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
@echo
@echo "The overview file is in build/changes."
linkcheck:
mkdir -p build/linkcheck build/doctrees
+ $(PYTHON) autobuild.py
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
View
9 doc/README
@@ -1,9 +1,9 @@
Kivy - Documentation
====================
-You can access to the API documentation on web :
+You can access the API documentation on web :
* last released version : http://kivy.org/docs/api
- * trunk version, nightly updated : http://kivy.org/docs/api-trunk/
+ * trunk version, updated nightly : http://kivy.org/docs/api-trunk/
How to build the documentation
@@ -13,10 +13,7 @@ You need to install :
* Python Sphinx (apt-get install python-sphinx)
* Latest kivy
-Run autobuild.py :
- python autobuild.py
-
-And generate documentation
+Generate documentation using make::
make html
Documentation will be accessible in build/html/
View
9 doc/sources/conf.py
@@ -62,12 +62,9 @@
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directories, that shouldn't be searched
-# for source files.
-#exclude_dirs = []
+# suppress exclusion warnings
+exclude_patterns = ['gettingstarted/*', 'api-index.rst',
+ 'api-kivy.lib.osc.*', 'guide/android.rst', 'guide/layouts.rst']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
View
1  doc/sources/contribute.rst
@@ -219,6 +219,7 @@ Will result in:
.. note:: This new feature will likely blow your mind
.. warning:: Please take a seat before trying this feature
+
"""
View
2  doc/sources/gettingstarted/events.rst
@@ -57,7 +57,7 @@ Going further
Another thing to note is that if you override an event, you become responsible
for implementing all its behaviour previously handled by the base class. The
-easiest way to do this is to call `super()`: ::
+easiest way to do this is to call `super()`::
def on_touch_down(self, touch):
if super(OurClassName, self).on_touch_down(touch):
View
2  doc/sources/gettingstarted/layouts.rst
@@ -5,7 +5,7 @@ Layouts
Arranging Your Widgets
-Layouts are used to arrange widgets in a perticular manner. ::
+Layouts are used to arrange widgets in a perticular manner::
AnchorLayout: widgets can be anchored to 'top', 'bottom', 'left', 'right', 'center'
BoxLayout: widgets are arranged in a box in either 'vertical' or 'horizontal' orientation
View
4 doc/sources/guide/inputs.rst
@@ -2,7 +2,7 @@ Input management
================
Input architecture
------------------
+------------------
Kivy is able to handle most types of input: mouse, touchscreen, accelerometer,
gyroscope, etc. It handles the native multitouch protocols on the following
@@ -96,7 +96,7 @@ profile exists::
if 'angle' in touch.profile:
print 'The touch angle is', touch.a
-You can find a list of available profiles in the :doc:`api-kivy.input.motionevent`
+You can find a list of available profiles in the :mod:`api-kivy.input.motionevent`
documentation.
Touch events
View
5 doc/sources/guide/layouts.rst
@@ -25,8 +25,9 @@ BoxLayout:
.. image:: ../images/boxlayout.gif
GridLayout:
- Arrange widgets in a grid, you must specifiy at least one dimension of the
- grid, so kivy can comput size of the elements and how to arrange them
+ Arrange widgets in a grid. You must specifiy at least one dimension of the
+ grid so kivy can compute the size of the elements and how to arrange them.
+
`pos_hint` not honored
.. image:: ../images/gridlayout.gif
View
2  doc/sources/guide/widgettree.rst
@@ -54,7 +54,7 @@ Traversing the tree
-------------------
The widget class has a :data:`~kivy.uix.widget.Widget.children` list property
-that contains all the children. You can easily traverse the tree by doing ::
+that contains all the children. You can easily traverse the tree by doing::
root = BoxLayout()
# ... add widgets to root ...
View
2  doc/sources/installation/installation.rst
@@ -141,7 +141,7 @@ Uninstalling Kivy
If you are mixing multiple Kivy installations, you might be confused about where each Kivy version is
located. Please note that you might need to follow these steps multiple times, if you have multiple kivy versions
installed in the Python library path.
-To find your current installed version, you can use the command line: ::
+To find your current installed version, you can use the command line::
$ python -c 'import kivy; print kivy.__path__'
View
2  doc/sources/sphinxext/preprocess.py
@@ -63,7 +63,7 @@ def callback_docstring(app, what, name, obj, options, lines):
line = lines.pop(0)
# trick to realign the first line to the second one.
- # FIXME: fail if we finishing with ::
+ # FIXME: fail if we finishing with::
line_with_text = [x for x in lines if len(x.strip())]
if len(line_with_text) and line is not None and len(lines):
l = len(line_with_text[0]) - len(line_with_text[0].lstrip())
View
22 kivy/__init__.py
@@ -24,7 +24,7 @@
'kivy_configure', 'kivy_register_post_configuration',
'kivy_options', 'kivy_base_dir',
'kivy_modules_dir', 'kivy_data_dir', 'kivy_shader_dir',
- 'kivy_icons_dir', 'kivy_home_dir',
+ 'kivy_icons_dir', 'kivy_home_dir', 'kivy_userexts_dir',
'kivy_config_fn', 'kivy_usermodules_dir',
)
@@ -143,7 +143,7 @@ def kivy_register_post_configuration(callback):
def kivy_usage():
- '''Kivy Usage: %s [OPTION...] ::
+ '''Kivy Usage: %s [OPTION...]::
-h, --help
Prints this help message.
@@ -224,20 +224,24 @@ def kivy_usage():
#: Kivy icons config path (don't remove the last '')
kivy_icons_dir = join(kivy_data_dir, 'icons', '')
#: Kivy user-home storage directory
-kivy_home_dir = None
+kivy_home_dir = ''
#: Kivy configuration filename
-kivy_config_fn = None
+kivy_config_fn = ''
#: Kivy user modules directory
-kivy_usermodules_dir = None
+kivy_usermodules_dir = ''
+#: Kivy user extensions directory
+kivy_userexts_dir = ''
+
# Don't go further if we generate documentation
-if basename(sys.argv[0]) in ('sphinx-build', 'autobuild.py'):
+if any(name in sys.argv[0] for name in ('sphinx-build', 'autobuild.py')):
environ['KIVY_DOC'] = '1'
-if basename(sys.argv[0]) in ('sphinx-build', ):
+if 'sphinx-build' in sys.argv[0]:
environ['KIVY_DOC_INCLUDE'] = '1'
-if basename(sys.argv[0]) in ('nosetests', ) or 'nosetests' in sys.argv:
+if any('nosetests' in arg for arg in sys.argv):
environ['KIVY_UNITTEST'] = '1'
-if not 'KIVY_DOC_INCLUDE' in environ:
+
+if not environ.get('KIVY_DOC_INCLUDE'):
# Configuration management
user_home_dir = expanduser('~')
if platform() == 'android':
View
2  kivy/animation.py
@@ -136,7 +136,7 @@ def stop_all(widget, *largs):
'''Stop all animations that concern a specific widget / list of
properties.
- Example ::
+ Example::
anim = Animation(x=50)
anim.start(widget)
View
2  kivy/app.py
@@ -309,7 +309,7 @@ def build(self):
widget and added to the window.
:return: None or a root :class:`~kivy.uix.widget.Widget` instance is no
- self.root exist.
+ self.root exist.
'''
if not self.root:
return Widget()
View
2  kivy/base.py
@@ -26,7 +26,7 @@
class ExceptionHandler:
'''Base handler that catch exception in runTouchApp().
- You can derivate and use it like this ::
+ You can derivate and use it like this::
class E(ExceptionHandler):
def handle_exception(self, inst):
View
8 kivy/clock.py
@@ -3,7 +3,7 @@
============
The :class:`Clock` object allows you to schedule a function call in the
-future; once or on interval. ::
+future; once or on interval::
def my_callback(dt):
pass
@@ -93,7 +93,7 @@ def callback(self, dt):
A triggered event is a way to defer a callback exactly like schedule_once(),
but with some added convenience. The callback will only be scheduled once per
frame, even if you call the trigger twice (or more). This is not the case
-with :func:`Clock.schedule_once` ::
+with :func:`Clock.schedule_once`::
# will run the callback twice before the next frame
Clock.schedule_once(my_callback)
@@ -104,7 +104,7 @@ def callback(self, dt):
t()
t()
-Before triggered events, you may have used this approach in a widget ::
+Before triggered events, you may have used this approach in a widget::
def trigger_callback(self, *largs):
Clock.unschedule(self.callback)
@@ -112,7 +112,7 @@ def trigger_callback(self, *largs):
As soon as you call `trigger_callback()`, it will correctly schedule the
callback once in the next frame. It is more convenient to create and bind to
-the triggered event than using :func:`Clock.schedule_once` in a function ::
+the triggered event than using :func:`Clock.schedule_once` in a function::
from kivy.clock import Clock
from kivy.uix.widget import Widget
View
2  kivy/config.py
@@ -255,7 +255,7 @@ def write(self):
return True
-if not 'KIVY_DOC_INCLUDE' in environ:
+if not environ.get('KIVY_DOC_INCLUDE'):
#
# Read, analyse configuration file
View
4 kivy/core/clipboard/__init__.py
@@ -20,8 +20,8 @@
>>> Clipboard.get('UTF8_STRING')
'Great'
-.. note:: the main implementation rely on Pygame, and works great with
-text/string. Anything else might not work the same on all platform.
+.. note:: The main implementation rely on Pygame, and works great with
+ text/string. Anything else might not work the same on all platform.
'''
__all__ = ('ClipboardBase', 'Clipboard')
View
2  kivy/core/image/__init__.py
@@ -623,7 +623,7 @@ def read_pixel(self, x, y):
.. warning::
This function can be used only with images loaded with
- keep_data=True keyword. For examples ::
+ keep_data=True keyword. For examples::
m = Image.load('image.png', keep_data=True)
color = m.read_pixel(150, 150)
View
17 kivy/core/window/__init__.py
@@ -195,18 +195,21 @@ class WindowBase(EventDispatcher):
`on_keyboard`: key, scancode, codepoint, modifier
Fired when the keyboard is in action
.. versionchanged:: 1.3.0
- The *unicode* parameter has be deprecated in favor of
- codepoint, and will be removed completely in future versions
+
+ The *unicode* parameter has be deprecated in favor of
+ codepoint, and will be removed completely in future versions
`on_key_down`: key, scancode, codepoint
Fired when a key is down
.. versionchanged:: 1.3.0
- The *unicode* parameter has be deprecated in favor of
- codepoint, and will be removed completely in future versions
+
+ The *unicode* parameter has be deprecated in favor of
+ codepoint, and will be removed completely in future versions
`on_key_up`: key, scancode, codepoint
Fired when a key is up
.. versionchanged:: 1.3.0
- The *unicode* parameter has be deprecated in favor of
- codepoint, and will be removed completely in future versions
+
+ The *unicode* parameter has be deprecated in favor of
+ codepoint, and will be removed completely in future versions
`on_dropfile`: str
Fired when a file is dropped on the application
'''
@@ -287,7 +290,7 @@ def _set_clearcolor(self, value):
bind=('_clearcolor', ))
'''Color used to clear window.
- ::
+ ::
from kivy.core.window import Window
# red background color
View
6 kivy/graphics/compiler.pyx
@@ -9,7 +9,7 @@ at rendering time.
Reducing the context instructions
---------------------------------
-Imagine that you have a scheme like this ::
+Imagine that you have a scheme like this::
Color(1, 1, 1)
Rectangle(source='button.png', pos=(0, 0), size=(20, 20))
@@ -18,7 +18,7 @@ Imagine that you have a scheme like this ::
Color(1, 1, 1)
Rectangle(source='button.png', pos=(10, 20), size=(20, 20))
-The real instruction seen by the graphics canvas would be ::
+The real instruction seen by the graphics canvas would be::
Color: change 'color' context to 1, 1, 1
BindTexture: change 'texture0' to `button.png texture`
@@ -32,7 +32,7 @@ The real instruction seen by the graphics canvas would be ::
Only the first :class:`~kivy.graphics.context_instructions.Color` and
:class:`~kivy.graphics.context_instructions.BindTexture` are useful, and really
-change the context. We can reduce them to ::
+change the context. We can reduce them to::
Color: change 'color' context to 1, 1, 1
BindTexture: change 'texture0' to `button.png texture`
View
2  kivy/graphics/fbo.pyx
@@ -7,7 +7,7 @@ texture, and use your fbo as a texture for another drawing.
Fbo act as a :class:`kivy.graphics.instructions.Canvas`.
-Exemple of using an fbo for some color rectangles ::
+Example of using an fbo for some color rectangles::
from kivy.graphics import Fbo, Color, Rectangle
View
6 kivy/graphics/transformation.pyx
@@ -29,7 +29,8 @@ cdef extern from "string.h":
cdef double _EPS = 8.8817841970012523e-16
cdef class Matrix:
- '''Optimized matrix class for OpenGL ::
+ '''
+ Optimized matrix class for OpenGL::
>>> from kivy.graphics.transformation import Matrix
>>> m = Matrix()
@@ -42,8 +43,7 @@ cdef class Matrix:
[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]
- [12 13 14 15]
-
+ [ 12 13 14 15]
'''
def __cinit__(self):
View
4 kivy/input/factory.py
@@ -10,8 +10,8 @@
class MotionEventFactory:
'''MotionEvent factory is a class who register all availables input
- factories. If you create a new input factory, don't forget to register it
- ::
+ factories. If you create a new input factory, don't forget to register
+ it::
MotionEventFactory.register('myproviderid', MyInputProvider)
View
8 kivy/input/motionevent.py
@@ -30,7 +30,7 @@
----------------------
If you want to receive all Motion Event, Touch or not, you can bind motion event
-from :class:`~kivy.core.window.Window` to your own callbacks ::
+from :class:`~kivy.core.window.Window` to your own callbacks::
def on_motion(self, etype, motionevent):
# will receive all motion event.
@@ -64,13 +64,13 @@ def on_motion(self, etype, motionevent):
shape Contact shape. Use property `shape`
============== ================================================================
-If yo want to know if the current :class:`MotionEvent` have an angle ::
+If yo want to know if the current :class:`MotionEvent` have an angle::
def on_touch_move(self, touch):
if 'angle' in touch.profile:
print 'The touch angle is', touch.a
-If you want to select only the fiducials ::
+If you want to select only the fiducials::
def on_touch_move(self, touch):
if 'markerid' not in touch.profile:
@@ -276,7 +276,7 @@ def depack(self, args):
def grab(self, class_instance, exclusive=False):
'''Grab this motion event. You can grab a touch if you absolutly want to
receive on_touch_move() and on_touch_up(), even if the touch is not
- dispatched by your parent ::
+ dispatched by your parent::
def on_touch_down(self, touch):
touch.grab(self)
View
2  kivy/input/postproc/dejitter.py
@@ -20,7 +20,7 @@
class InputPostprocDejitter(object):
'''
Get rid of jitterish BLOBs.
- Example ::
+ Example::
[postproc]
jitter_distance = 0.004
View
2  kivy/input/postproc/doubletap.py
@@ -16,7 +16,7 @@ class InputPostprocDoubleTap(object):
'''
InputPostProcDoubleTap is a post-processor to check if
a touch is a double tap or not.
- Double tap can be configured in the Kivy config file ::
+ Double tap can be configured in the Kivy config file::
[postproc]
double_tap_time = 250
View
2  kivy/input/postproc/ignorelist.py
@@ -14,7 +14,7 @@
class InputPostprocIgnoreList(object):
'''
InputPostprocIgnoreList is a post-processor who remove touch in ignore list.
- Ignore list can be configured in the Kivy config file ::
+ Ignore list can be configured in the Kivy config file::
[postproc]
# Format: [(xmin, ymin, xmax, ymax), ...]
View
2  kivy/input/postproc/retaintouch.py
@@ -18,7 +18,7 @@ class InputPostprocRetainTouch(object):
touch, to reuse it under certains conditions. This module is designed to
prevent finger lost on some hardware/setup.
- Retain touch can be configured in the Kivy config file ::
+ Retain touch can be configured in the Kivy config file::
[postproc]
retain_time = 100
View
4 kivy/input/providers/hidinput.py
@@ -4,7 +4,7 @@
Support start from 2.6.32-ubuntu, or 2.6.34.
-To configure HIDInput, put in your configuration ::
+To configure HIDInput, put in your configuration::
[input]
# devicename = hidinput,/dev/input/eventXX
@@ -29,7 +29,7 @@
For example, on Asus T101M, the touchscreen report a range from 0-4095 for X and
Y value, but real value are in a range from 0-32768. You can put it on
-configuration ::
+configuration::
[input]
t101m = hidinput,/dev/input/event7,max_position_x=32768,max_position_y=32768
View
2  kivy/input/providers/linuxwacom.py
@@ -2,7 +2,7 @@
Native support of Wacom tablet from linuxwacom driver
=====================================================
-To configure LinuxWacom, put in your configuration ::
+To configure LinuxWacom, put in your configuration::
[input]
pen = linuxwacom,/dev/input/event2,mode=pen
View
4 kivy/input/providers/mouse.py
@@ -8,7 +8,7 @@
To avoid this behavior, you can activate the "disable_on_activity" token in
mouse. Then, if they are any touch active from another provider, the mouse will
-be discarded. Put in your configuration ::
+be discarded. Put in your configuration::
[input]
mouse = mouse,disable_on_activity
@@ -20,7 +20,7 @@
By default middle and right mouse buttons ared used for multitouch emulation.
If you want to use them for other purpose you can disable this behavior by
-activating the "disable_multitouch" token ::
+activating the "disable_multitouch" token::
[input]
mouse = mouse,disable_multitouch
View
2  kivy/input/providers/mtdev.py
@@ -8,7 +8,7 @@
To configure MTDev, it's preferable to use probesysfs providers.
Check :py:class:`~kivy.input.providers.probesysfs` for more information.
-Otherwise, you can put in your configuration ::
+Otherwise, you can put in your configuration::
[input]
# devicename = hidinput,/dev/input/eventXX
View
2  kivy/input/providers/probesysfs.py
@@ -9,7 +9,7 @@
prior to other providers. For more information about mtdev, check
:py:class:`~kivy.input.providers.mtdev`.
-Here is an example of auto creation ::
+Here is an example of auto creation::
[input]
# using mtdev
View
4 kivy/lang.py
@@ -265,7 +265,7 @@
and a label on the right. You can create a template for making that definition
more easy to use.
So, we'll create a template that require 2 entry in the context: a image
-filename and a title ::
+filename and a title::
[IconItem@BoxLayout]:
Image:
@@ -275,7 +275,7 @@
.. highlight:: python
-Then in Python, you can create instanciate the template with ::
+Then in Python, you can create instanciate the template with::
from kivy.lang import Builder
View
2  kivy/loader.py
@@ -206,7 +206,7 @@ def image(self, filename, load_callback=None, post_callback=None, **kwargs):
'''Load a image using loader. A Proxy image is returned with a loading
image.
- ::
+ ::
img = Loader.image(filename)
# img will be a ProxyImage.
# You'll use it the same as an Image class.
View
2  kivy/properties.pyx
@@ -835,7 +835,7 @@ cdef class AliasProperty(Property):
If you didn't find a Property class that fits to your needs, you can still
create Python getters and setters and create a property with both of them.
- Example from kivy/uix/widget.py ::
+ Example from kivy/uix/widget.py::
def get_right(self):
return self.x + self.width
View
2  kivy/tools/pep8checker/pre-commit.githook
@@ -12,7 +12,7 @@
the styleguide checker over your code and abort the commit if there are any
errors. If that happens, please fix & retry.
- To install ::
+ To install::
cp kivy/tools/pep8checker/pre-commit.githook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
View
2  kivy/uix/anchorlayout.py
@@ -16,7 +16,7 @@
or center.
-To draw a button in the lower-right corner ::
+To draw a button in the lower-right corner::
layout = AnchorLayout(
anchor_x='right', anchor_y='bottom')
View
4 kivy/uix/button.py
@@ -13,7 +13,7 @@
button = Button(text='Hello world', font_size=14)
To attach a callback when the button is pressed (clicked/touched), use
-:class:`~kivy.uix.widget.Widget.bind` ::
+:class:`~kivy.uix.widget.Widget.bind`::
def callback(instance):
print 'The button <%s> is being pressed' % instance.text
@@ -24,7 +24,7 @@ def callback(instance):
btn2.bind(on_press=callback)
If you want to be notified every time the button state changes, you can attach
-to the :data:`Button.state` property ::
+to the :data:`Button.state` property::
def callback(instance, value):
print 'My button <%s> state is <%s>' % (instance, value)
View
4 kivy/uix/camera.py
@@ -40,7 +40,7 @@ class Camera(Image):
play = BooleanProperty(True)
'''Boolean indicate if the camera is playing.
- You can start/stop the camera by setting this property. ::
+ You can start/stop the camera by setting this property::
# start the camera playing at creation (default)
cam = Camera(play=True)
@@ -63,7 +63,7 @@ class Camera(Image):
resolution = ListProperty([-1, -1])
'''Preferred resolution to use when invoking the camera. If you are using
- [-1, -1], the resolution will be the default one. ::
+ [-1, -1], the resolution will be the default one::
# create a camera object with the best image available
cam = Camera()
View
21 kivy/uix/floatlayout.py
@@ -15,28 +15,27 @@
.. image:: images/floatlayout.png
:align: right
-For example, if you create a FloatLayout with size of (300, 300)::
+For example, if you create a FloatLayout with size a of (300, 300)::
layout = FloatLayout(size=(300, 300))
- # By default, all widgets have size_hint=(1, 1)
- # So this button will have the same size as
- # the layout
+By default, all widgets have size_hint=(1, 1), so this button will have the
+same size as the layout::
+
button = Button(text='Hello world')
layout.add_widget(button)
- # To create a button of 50% width and 25%
- # height of the layout and positioned at
- # 20, 20, you can do
+To create a button of 50% width and 25% height of the layout and positioned at
+(20, 20), you can do::
+
button = Button(
text='Hello world',
size_hint=(.5, .25),
pos=(20, 20))
-::
+If you want to create a button that will always be the size of layout minus
+20% on each side::
- # If you want to create a button that will always be the size of layout
- # minus 20% on each side:
button = Button(text='Hello world', size_hint=(.6, .6),
pos_hint={'x':.2, 'y':.2})
@@ -53,7 +52,7 @@
'''
-__all__ = ('FloatLayout', 'RelativeFloatLayout')
+__all__ = ('FloatLayout',)
from kivy.uix.layout import Layout
View
8 kivy/uix/image.py
@@ -2,7 +2,7 @@
Image
=====
-The :class:`Image` widget is used to display an image. ::
+The :class:`Image` widget is used to display an image::
wimg = Image(source='mylogo.png')
@@ -10,7 +10,7 @@
--------------------
To load an image asynchronously (for example from an external webserver), use
-the :class:`AsyncImage` subclass ::
+the :class:`AsyncImage` subclass::
aimg = AsyncImage(source='http://mywebsite.com/logo.png')
@@ -21,12 +21,12 @@
If you don't want that, you can inherit from Image and create your own style.
For example, if you want your image to take the same size of your widget, you
-can do ::
+can do::
class FullImage(Image):
pass
-And in your kivy language file, you can do ::
+And in your kivy language file, you can do::
<FullImage>:
canvas:
View
8 kivy/uix/label.py
@@ -3,7 +3,7 @@
=====
The :class:`Label` widget is for rendering text. It supports ascii and unicode
-strings ::
+strings::
# hello world text
l = Label(text='Hello world')
@@ -211,11 +211,11 @@ def on_ref_press(self, ref):
text = StringProperty('')
'''Text of the label.
- Creation of a simple hello world ::
+ Creation of a simple hello world::
widget = Label(text='Hello world')
- If you want to create the widget with an unicode string, use ::
+ If you want to create the widget with an unicode string, use::
widget = Label(text=u'My unicode string')
@@ -365,7 +365,7 @@ def on_ref_press(self, ref):
The :data:`texture` update is scheduled for the next frame. If you need
the texture immediately after changing a property, you have to call
- the :func:`texture_update` function before accessing :data:`texture` ::
+ the :func:`texture_update` function before accessing :data:`texture`::
l = Label(text='Hello world')
# l.texture is good
View
8 kivy/uix/popup.py
@@ -41,7 +41,7 @@
popup.dismiss()
The :meth:`Popup.open` and :meth:`Popup.dismiss` are bindable. That means you
-can directly bind the function to an action, e.g., to a button's on_press ::
+can directly bind the function to an action, e.g., to a button's on_press::
# create content and assign to the popup
content = Button(text='Close me!')
@@ -59,7 +59,7 @@
There are two events available: `on_open` when the popup is opening, and
`on_dismiss` when it is closed. For `on_dismiss`, you can prevent the
-popup from closing by explictly returning True from your callback ::
+popup from closing by explictly returning True from your callback::
def my_callback(instance):
print 'Popup', instance, 'is being dismissed, but is prevented!'
@@ -73,8 +73,8 @@ def my_callback(instance):
__all__ = ('Popup', 'PopupException')
from kivy.uix.modalview import ModalView
-from kivy.properties import StringProperty, ObjectProperty, \
- NumericProperty, ListProperty
+from kivy.properties import (StringProperty, ObjectProperty,
+ NumericProperty, ListProperty)
class PopupException(Exception):
View
2  kivy/uix/progressbar.py
@@ -12,7 +12,7 @@
The progress bar has no interactive elements, It is a display-only widget.
-To use it, simply assign a value to indicate the current progress ::
+To use it, simply assign a value to indicate the current progress::
from kivy.uix.progressbar import ProgressBar
pb = ProgressBar(max=1000)
View
12 kivy/uix/relativelayout.py
@@ -7,24 +7,24 @@
This layout allows you to set relative coordinate for children. If you want
absolute positioning, check :class:`~kivy.uix.floatlayout.FloatLayout`.
-The :class:`RelativeFloatLayout` class behaves just like the regular Float
+The :class:`RelativeLayout` class behaves just like the regular Float
Layout, except that its child widgets are positioned relative to the layout.
-For example, if you create a RelativeFloatLayout, add a widgets with
+For example, if you create a RelativeLayout, add a widgets with
position = (0,0), the child widget will also move, when you change the
-position of the RelativeFloatLayout. The child widgets coordiantes remain
+position of the RelativeLayout. The child widgets coordiantes remain
(0,0), i.e. they are relative to the containing layout.
..note::
- The :class:`RelativeFloatLayout` is implemented as a :class`FloatLayout`
+ The :class:`RelativeLayout` is implemented as a :class`FloatLayout`
inside a :class:`Scatter`.
.. warning::
- Since the actual RelativeFloatLayout is a Scatter, its add_widget and
+ Since the actual RelativeLayout is a Scatter, its add_widget and
remove_widget functions are overwritten to add children to the embedded
- FloatLayout (accessible as `content` property of RelativeFloatLayout)
+ FloatLayout (accessible as `content` property of RelativeLayout)
automatically. So if you want to access the added child elements,
you need self.content.children, instead of self.children.
'''
View
12 kivy/uix/scatter.py
@@ -29,7 +29,7 @@
By default, the widget does not have a graphical representation. It is a
container only. The idea is to combine Scatter with another widget, for
-example :class:`~kivy.uix.image.Image` ::
+example :class:`~kivy.uix.image.Image`::
scatter = Scatter()
image = Image(source='sun.jpg')
@@ -41,15 +41,15 @@
By default, all interactions are enabled. You can selectively disable
them using the do_{rotation, translation, scale} properties.
-Disable rotation ::
+Disable rotation::
scatter = Scatter(do_rotation=False)
-Allow only translation ::
+Allow only translation::
scatter = Scatter(do_rotation=False, do_scale=False)
-Allow only translation on x axis ::
+Allow only translation on x axis::
scatter = Scatter(do_rotation=False, do_scale=False,
do_translation_y=False)
@@ -72,7 +72,7 @@
implementation. Generally, you don't hit the minimum scale (because you don't
see it on the screen), but the maximum scale is 9.99506983235e+19 (2^66).
-You can also limit the minimum and maximum scale allowed. ::
+You can also limit the minimum and maximum scale allowed::
scatter = Scatter(scale_min=.5, scale_max=3.)
@@ -203,7 +203,7 @@ def _get_bbox(self):
return (xmin, ymin), (xmax-xmin, ymax-ymin)
bbox = AliasProperty(_get_bbox, None, bind=(
'transform', 'width', 'height'))
- '''Bounding box of the widget in parent space. ::
+ '''Bounding box of the widget in parent space::
((x, y), (w, h))
# x, y = lower left corner
View
2  kivy/uix/screenmanager.py
@@ -513,7 +513,7 @@ class ScreenManager(FloatLayout):
current = StringProperty(None)
'''Name of the screen currently show, or the screen to show.
- ::
+ ::
from kivy.uix.screenmanager import ScreenManager, Screen
View
2  kivy/uix/scrollview.py
@@ -50,7 +50,7 @@
To scroll a :class:`GridLayout` on Y-axis/vertically, set the child's width
identical to that of the ScrollView (size_hint_x=1, default), and set the
-size_hint_y property to None ::
+size_hint_y property to None::
layout = GridLayout(cols=1, spacing=10, size_hint_y=None)
#Make sure the height is such that there is something to scroll.
View
10 kivy/uix/slider.py
@@ -7,12 +7,12 @@
The :class:`Slider` widget looks like a scrollbar. It supports horizontal and
vertical orientation, min/max and a default value.
-To create a slider from -100 to 100 starting at 25 ::
+To create a slider from -100 to 100 starting at 25::
from kivy.uix.slider import Slider
s = Slider(min=-100, max=100, value=25)
-To create a vertical slider ::
+To create a vertical slider::
from kivy.uix.slider import Slider
s = Slider(orientation='vertical')
@@ -71,7 +71,7 @@ class Slider(Widget):
'''
range = ReferenceListProperty(min, max)
- '''Range of the slider, in the format (minimum value, maximum value). ::
+ '''Range of the slider, in the format (minimum value, maximum value)::
>>> slider = Slider(min=10, max=80)
>>> slider.range
@@ -98,7 +98,7 @@ def set_norm_value(self, value):
self.value = value * (self.max - vmin) + vmin
value_normalized = AliasProperty(get_norm_value, set_norm_value,
bind=('value', 'min', 'max'))
- '''Normalized value inside the :data:`range` (min/max) to 0-1 range. ::
+ '''Normalized value inside the :data:`range` (min/max) to 0-1 range::
>>> slider = Slider(value=50, min=0, max=100)
>>> slider.value
@@ -113,7 +113,7 @@ def set_norm_value(self, value):
1
You can also use it for setting the real value without knowing the minimum
- and maximum. ::
+ and maximum::
>>> slider = Slider(min=0, max=200)
>>> slider.value_normalized = .5
View
6 kivy/uix/tabbedpanel.py
@@ -20,7 +20,7 @@
Simple example
--------------
-.. include :: ../../examples/widgets/tabbedpanel.py
+.. include:: ../../examples/widgets/tabbedpanel.py
:literal:
Customize the Tabbed Panel
@@ -252,7 +252,7 @@ def get_current_tab(self):
'''Specifies the text displayed on the default tab header.
:data:`default_tab_text` is a :class:`~kivy.properties.StringProperty`,
- default to 'default tab'.
+ defaults to 'default tab'.
'''
default_tab_cls = ObjectProperty(TabbedPanelHeader)
@@ -307,7 +307,7 @@ def set_def_tab(self, new_tab):
'''Holds the default tab.
.. Note:: For convenience, the automatically provided default tab is deleted
- when you change default_tab to something else.
+ when you change default_tab to something else.
:data:`default_tab` is a :class:`~kivy.properties.AliasProperty`
'''
View
14 kivy/uix/textinput.py
@@ -30,7 +30,7 @@
textinput = TextInput(text='Hello world')
To create a monoline textinput, set the multiline property to false ('enter'
-key will defocus the textinput and emit on_text_validate event) ::
+key will defocus the textinput and emit on_text_validate event)::
def on_enter(instance, value):
print 'User pressed enter in', instance
@@ -38,7 +38,7 @@ def on_enter(instance, value):
textinput = TextInput(text='Hello world', multiline=False)
textinput.bind(on_text_validate=on_enter)
-To run a callback when the text changes ::
+To run a callback when the text changes::
def on_text(instance, value):
print 'The widget', instance, 'have:', value
@@ -47,13 +47,13 @@ def on_text(instance, value):
textinput.bind(text=on_text)
You can 'focus' a textinput, meaning that the input box will be highlighted,
-and keyboard focus will be requested ::
+and keyboard focus will be requested::
textinput = TextInput(focus=True)
The textinput is defocused if the 'escape' key is pressed, or if another
widget requests the keyboard. You can bind a callback to the focus property to
-get notified of focus changes ::
+get notified of focus changes::
def on_focus(instance, value):
if value:
@@ -1209,7 +1209,7 @@ def _keyboard_on_key_up(self, window, keycode):
'''
password = BooleanProperty(False)
- '''If True, the widget will display its characters as the character *.
+ '''If True, the widget will display its characters as the character '*'.
.. versionadded:: 1.2.0
@@ -1437,11 +1437,11 @@ def _set_text(self, text):
text = AliasProperty(_get_text, _set_text, bind=('_lines', ))
'''Text of the widget.
- Creation of a simple hello world ::
+ Creation of a simple hello world::
widget = TextInput(text='Hello world')
- If you want to create the widget with an unicode string, use ::
+ If you want to create the widget with an unicode string, use::
widget = TextInput(text=u'My unicode string')
View
2  kivy/uix/togglebutton.py
@@ -8,7 +8,7 @@
Toggle buttons can also be grouped to make radio buttons - only one button in
a group can be in 'down' state. The group name can be a string or any other
-hashable Python object ::
+hashable Python object::
btn1 = ToggleButton(text='Male', group='sex',)
btn2 = ToggleButton(text='Female', group='sex', state='down')
View
3  kivy/uix/treeview.py
@@ -355,7 +355,8 @@ def get_node_at_pos(self, pos):
def iterate_open_nodes(self, node=None):
'''Generator to iterate over expanded nodes.
- To get all the open nodes:
+
+ To get all the open nodes::
treeview = TreeView()
# ... add nodes ...
View
4 kivy/uix/video.py
@@ -11,7 +11,7 @@
under the hood.
Video loading is asynchronous - many properties are not available until
-the video is loaded (when the texture is created). ::
+the video is loaded (when the texture is created)::
def on_position_change(instance, value):
print 'The position in the video is', value
@@ -38,7 +38,7 @@ class Video(Image):
play = BooleanProperty(False)
'''Boolean, indicates if the video is playing.
- You can start/stop the video by setting this property. ::
+ You can start/stop the video by setting this property::
# start playing the video at creation
video = Video(source='movie.mkv', play=True)
View
2  kivy/uix/videoplayer.py
@@ -288,7 +288,7 @@ class VideoPlayer(GridLayout):
play = BooleanProperty(False)
'''Boolean, indicates if the video is playing.
- You can start/stop the video by setting this property. ::
+ You can start/stop the video by setting this property::
# start playing the video at creation
video = VideoPlayer(source='movie.mkv', play=True)
View
6 kivy/utils.py
@@ -37,7 +37,7 @@ def difference(set1, set2):
def interpolate(value_from, value_to, step=10):
'''Interpolate a value to another. Can be useful to smooth some transition.
- For example ::
+ For example::
# instead of setting directly
self.pos = pos
@@ -61,7 +61,7 @@ def interpolate(value_from, value_to, step=10):
def strtotuple(s):
'''Convert a tuple string into tuple,
with some security check. Designed to be used
- with eval() function ::
+ with eval() function::
a = (12, 54, 68)
b = str(a) # return '(12, 54, 68)'
@@ -272,7 +272,7 @@ class QueryDict(dict):
.. versionadded:: 1.0.4
- ::
+ ::
d = QueryDict()
# create a key named toto, with the value 1
Please sign in to comment.
Something went wrong with that request. Please try again.