From 4b8b7a5e0241269c0946f34df75f024d40179d41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Thu, 19 Dec 2013 18:59:37 +0000 Subject: [PATCH] use autodoc for pyxinfo and add a note about it to the CHANGES git-svn-id: http://svn.code.sf.net/p/pyx/code/trunk/pyx@3566 a4f5e268-e194-4f32-bce1-d30804cbbcc5 --- CHANGES | 2 ++ manual/text.rst | 12 ++++++++---- pyx/__init__.py | 7 +++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 93a8632c..716c9f32 100644 --- a/CHANGES +++ b/CHANGES @@ -46,6 +46,8 @@ - pyxrc: - use APPDATA environment variable to locate the pyxrc on windows - tex, latex, kpsewhich, and locate executables are now customizable in the pyxrc + - on the package level: + - add pyxinfo to enable output of some useful information - manual: - PyX theme and various sphinx tweaks diff --git a/manual/text.rst b/manual/text.rst index ce17a963..cd14fc49 100644 --- a/manual/text.rst +++ b/manual/text.rst @@ -604,6 +604,9 @@ restore feature is needless, but does not harm). PyX takes care of the proper ``\jobname``, hence you can choose the filename arbitrarily with the exception of the suffix, as the suffix is kept during the save and restore. +.. module:: pyx + :synopsis: The PyX package + Still, all this might not help to fully understand the problem you're facing. For example there might be situations, where it is not clear which TeX interpreter is actually used (when several executables are available and the @@ -613,10 +616,11 @@ output created by PyX. PyX uses the logging module from the standard library and logs to a logger named ``"pyx"``. By default, various information about executing external programms and locating files will not be echoed, as it is written at info level, but PyX provides a simple convenience function to enable -the output of this logging level. Just call the pyxinfo() function defined on -the package level. This function also adds some general information about the -Python interpreter, the PyX installation, and the PyX configuration being -used. +the output of this logging level. Just call the :func:`pyxinfo` function +defined on the PyX package before actually start using the package in your +Python program: + +.. autofunction:: pyxinfo .. rubric:: Footnotes diff --git a/pyx/__init__.py b/pyx/__init__.py index 320dd786..7cbeb53c 100644 --- a/pyx/__init__.py +++ b/pyx/__init__.py @@ -48,6 +48,13 @@ for module in __all__: importlib.import_module('.' + module, package='pyx') def pyxinfo(): + """Make PyX a little verbose (for information or debugging) + + This function enables info level on the ``"pyx"`` logger. It also adds some + general information about the Python interpreter, the PyX installation, and + the PyX configuration to the logger. + + """ import logging, os, sys from . import config logging.lastResort.setLevel(logging.INFO) -- 2.11.4.GIT