ó LzñWc@s„dZddlZddlTddlmZmZddlZdefd„ƒYZdefd„ƒYZd efd „ƒYZ dS( s‡ Mechanisms to dynamically load extra modules to help the LaTeX compilation. All the modules must be derived from the TexModule class. iÿÿÿÿN(t*(t_tmsgt TexModulecBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(sÌ This is the base class for modules. Each module should define a class named 'Module' that derives from this one. The default implementation provides all required methods with no effects. cCsdS(s¿ The constructor receives two arguments: 'env' is the compiling environment, 'dict' is a dictionary that describes the command that caused the module to load. N((tselftenvtdict((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyt__init__scCsdS(sà This method is called before the first LaTeX compilation. It is supposed to build any file that LaTeX would require to compile the document correctly. The method must return true on failure. i((R((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyt pre_compilescCsdS(s× This method is called after each LaTeX compilation. It is supposed to process the compilation results and possibly request a new compilation. The method must return true on failure. i((R((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyt post_compile#scCsdS(sÅ This method is called after the last LaTeX compilation. It is supposed to terminate the compilation for its specific needs. The method must return true on failure. i((R((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyt last_compile+scCsdS(s• This method is called when cleaning the compiled files. It is supposed to remove all the files that this modules generates. N((R((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pytclean3scCst|d|ƒ|ŒdS(sT This is called when a directive for the module is found in the source. The method can raise 'AttributeError' when the directive does not exist and 'TypeError' if the syntax is wrong. By default, when called with argument "foo" it calls the method "do_foo" if it exists, and fails otherwise. tdo_N(tgetattr(Rtcmdtargs((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pytcommand9sccsdrdVndS(sÌ This is called if something has failed during an operation performed by this module. The method returns a generator with items of the same form as in LaTeXDep.get_errors. N(tNone(R((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyt get_errorsCs( t__name__t __module__t__doc__RRR R R RR(((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyRs      tPluginscBs5eZdZdd„Zd„Zd„Zd„ZRS(s This class gathers operations related to the management of external Python modules. Modules are requested through the `register' method, and they are searched for first in the current directory, then in the (possibly) specified Python package (using Python's path). cCsHi|_|s;ttƒg|_tjj|jdƒn ||_dS(sx Initialize the module set, possibly setting a path name in which modules will be searched for. iN(tmodulestdirnamet__file__tpathtsystappend(RR((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyRTs  cCs |j|S(s= Return the module object of the given name. (R(Rtname((sC/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/plugins.pyt __getitem__`scCsÃ|jj|ƒrdSy"tj|dgƒ\}}}WnUtk r|jsUdSy"tj||jƒ\}}}Wqtk r‹dSXnXtj||||ƒ}|jƒ||j|s   ?9