Ñò Ã#xPc @s”dZddklZddklZddklZlZddkl Z defd„ƒYZ de fd „ƒYZ d Z d e fd „ƒYZ e d de dƒƒZe deefe dƒƒZe dee dƒddgƒZeefZee d ƒefZee d ƒe dee dƒƒe dee dƒƒfZee d ee dƒƒefZee d ee dƒƒefZeZdS(s& Simple description of return values. iÿÿÿÿ(tgetdoc(tNoneType(tReadOnlytlock(t_tOutputcBsAeZdZdZdZdZgZddgd„Zd„Z RS(s Simple description of a member in the return value ``dict``. This class controls both the type of object being returned by a command as well as how the output will be displayed. For example, this class defines two return results: an entry and a value. >>> from ipalib import crud, output >>> class user(crud.Update): ... ... has_output = ( ... output.Entry('result'), ... output.value, ... ) The order of the values in has_output controls the order of output. If you have values that you don't want to be printed then add ``'no_display'`` to flags. The difference between ``'no_display'`` and ``'no_output'`` is that ``'no_output'`` will prevent a Param value from being returned at all. ``'no_display'`` will cause the API to return a value, it simply won't be displayed to the user. This is so some things may be returned that while not interesting to us, but may be to others. >>> from ipalib import crud, output >>> myvalue = output.Output('myvalue', unicode, ... 'Do not print this value', flags=['no_display'], ... ) >>> class user(crud.Update): ... ... has_output = ( ... output.Entry('result'), ... myvalue, ... ) cCsT||_|dj o ||_n|dj o ||_n||_t|ƒdS(N(tnametNonettypetdoctflagsR(tselfRRR R ((s1/usr/lib/python2.6/site-packages/ipalib/output.pyt__init__Ks      cCs#d|ii|i|i|ifS(Ns%s(%r, %r, %r)(t __class__t__name__RRR (R ((s1/usr/lib/python2.6/site-packages/ipalib/output.pyt__repr__TsN( Rt __module__t__doc__RRtvalidateR R R R(((s1/usr/lib/python2.6/site-packages/ipalib/output.pyRs& tEntrycBseZeZedƒZRS(s'A dictionary representing an LDAP entry(RRtdictRRR (((s1/usr/lib/python2.6/site-packages/ipalib/output.pyRZssP%s.validate_output() => %s.validate(): output[%r][%d]: need a %r; got a %r: %rt ListOfEntriescBs)eZeefZedƒZd„ZRS(sA list of LDAP entriesc Cslxet|ƒD]W\}}t|tƒp;tt|i|ii|i|tt|ƒ|fƒ‚q q WdS(N( t enumeratet isinstanceRt TypeErrortemsgRR RR(R tcmdtentriestitentry((s1/usr/lib/python2.6/site-packages/ipalib/output.pyRfs  (RRtlistttupleRRR R(((s1/usr/lib/python2.6/site-packages/ipalib/output.pyRbs  tresultR s*All commands should at least have a resulttsummarys-User-friendly description of action performedtvalues:The primary_key value of the entry, e.g. 'jdoe' for a userR t no_displaytcountsNumber of entries returnedt truncateds%True if not all results were returnedsList of deletions that faileds'True means the operation was successfulN(RtinspectRttypesRtplugableRRttextRRRRRR tunicodeR!R"tstandardtstandard_entrytinttbooltstandard_list_of_entriesRtstandard_deletetstandard_booleantstandard_value(((s1/usr/lib/python2.6/site-packages/ipalib/output.pyts:<