From d5e5281d22360047345c453f127b488de2c63d7b Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Fri, 17 Dec 2010 00:02:30 +0100 Subject: [PATCH] doc: now doc generation is working. --- doc/autobuild.py | 2 +- kivy/__init__.py | 2 +- kivy/cache.py | 9 ++++++--- kivy/clock.py | 10 +++++++--- kivy/core/gl/__init__.py | 24 +++++++++++++----------- 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/doc/autobuild.py b/doc/autobuild.py index 17724b7fb..baf8b348f 100644 --- a/doc/autobuild.py +++ b/doc/autobuild.py @@ -125,8 +125,8 @@ for package in packages: summary = 'NO DOCUMENTATION (package %s)' % package t = template.replace('$SUMMARY', summary) t = t.replace('$PACKAGE', package) - t = t.replace('$EXAMPLES', '') t = t.replace('$EXAMPLES_REF', '') + t = t.replace('$EXAMPLES', '') # search packages for subpackage in packages: diff --git a/kivy/__init__.py b/kivy/__init__.py index ddd1a14f5..d1c3f5c3c 100644 --- a/kivy/__init__.py +++ b/kivy/__init__.py @@ -146,7 +146,7 @@ if not 'KIVY_DOC_INCLUDE' in os.environ: ''' # configuration - from kivy.config import * + from kivy.config import Config # Set level of logger level = LOG_LEVELS.get(Config.get('kivy', 'log_level')) diff --git a/kivy/cache.py b/kivy/cache.py index cde068b5a..63b5f3bff 100644 --- a/kivy/cache.py +++ b/kivy/cache.py @@ -1,7 +1,8 @@ ''' -Cache Manager: cache object and delete them automaticly +Cache Manager: cache object and delete them automatically How to use the cache :: + # register a new Cache Cache.register('mycache', limit=10, timeout=5) @@ -19,6 +20,7 @@ not used the label since 5 seconds, and you've reach the limit. __all__ = ('Cache', ) +from os import environ from kivy.logger import Logger from kivy.clock import Clock @@ -218,5 +220,6 @@ class Cache(object): str(Cache._categories[category]['timeout']) ) -# install the schedule clock for purging -Clock.schedule_interval(Cache._purge_by_timeout, 1) +if 'KIVY_DOC_INCLUDE' not in environ: + # install the schedule clock for purging + Clock.schedule_interval(Cache._purge_by_timeout, 1) diff --git a/kivy/clock.py b/kivy/clock.py index e80c91c8f..b3caa8db4 100644 --- a/kivy/clock.py +++ b/kivy/clock.py @@ -15,8 +15,9 @@ You can add new event like this :: If the callback return False, the schedule will be removed. ''' -__all__ = ('Clock', ) +__all__ = ('Clock', 'ClockBase') +from os import environ from time import time, sleep from kivy.weakmethod import WeakMethod from kivy.config import Config @@ -164,6 +165,9 @@ class ClockBase(object): self._events.remove(event) -#: Instance of the ClockBase, available for everybody -Clock = ClockBase() +if 'KIVY_DOC_INCLUDE' in environ: + #: Instance of the ClockBase, available for everybody + Clock = None +else: + Clock = ClockBase() diff --git a/kivy/core/gl/__init__.py b/kivy/core/gl/__init__.py index 682d3de9f..e0d4c5bf1 100644 --- a/kivy/core/gl/__init__.py +++ b/kivy/core/gl/__init__.py @@ -3,22 +3,24 @@ GL: Select which library will be used for providing OpenGL support ''' # Right now, only PyOpenGL +from os import environ + from kivy.config import Config from kivy.logger import Logger import OpenGL from OpenGL.GL import * from OpenGL.GLU import * -# Disable pyOpenGL auto GL Error Check? -gl_check = Config.get('kivy', 'gl_error_check') -if gl_check.lower() in ['0', 'false', 'no']: - import OpenGL - OpenGL.ERROR_CHECKING = False +if 'KIVY_DOC_INCLUDE' not in environ: + # Disable pyOpenGL auto GL Error Check? + gl_check = Config.get('kivy', 'gl_error_check') + if gl_check.lower() in ['0', 'false', 'no']: + OpenGL.ERROR_CHECKING = False -# To be able to use our GL provider, we must have a window -# Automaticly import window auto to ensure the default window creation -import kivy.core.window + # To be able to use our GL provider, we must have a window + # Automaticly import window auto to ensure the default window creation + import kivy.core.window -def print_gl_version(): - version = glGetString(GL_VERSION) - Logger.info('GL: OpenGL version <%s>' % str(version)) + def print_gl_version(): + version = glGetString(GL_VERSION) + Logger.info('GL: OpenGL version <%s>' % str(version))