ó ɼjWc@sòdZddlZddlZddlZddlZddlZde_de_e ddƒZ yej ddd e ƒjZ WnejjZ nXd „Zd efd „ƒYZd „Zd„ZddlZdejfd„ƒYZdS(sZThis module provides utility functions for ZFS. zfs.util.dev -- a file object of /dev/zfs iÿÿÿÿNi/i0s/dev/zfstwtSUNW_OST_OSLIBs/usr/lib/localetfallbackcCss|jrRd|jj}x.|jD]#}|d|t||ƒf7}q#W|dSd|jjt|jƒfSdS(sA simple __repr__ function.ts<%s %s>N(t __slots__t __class__t__name__tgetattrtreprt__dict__(tselftstrtv((s../../common/util.pyt default_repr/s !tZFSErrorcBsWeZdZdZeZddd„Zd„Zi e dƒe j 6e dƒe j 6e dƒe j 6e d ƒe j6e d ƒe j6e d ƒe j6e d ƒe j6e d ƒe j6e dƒe j6e dƒe j6e dƒe j6e dƒe j6Zee j ee j|f}t|ƒd krŠ|SqŠWd S(s3Return a nice string (eg "1.23M") for this integer.iiis KMGTPEs%uids%u%cis%.*f%ci iN(iii(tfloattlen(tnumtindextntutiR((s../../common/util.pytnicenumus   $ %cCs&t|j|jƒj||fƒdS(s?A function for OptionParser which appends a tuple (opt, value).N(Rtvaluestdesttappend(toptiontopttvaluetparser((s../../common/util.pytappend_with_optstZFSOptionParsercBs&eZdZdd„Zdd„ZRS(s]This option parser class raises errors as exception strings rather than exiting immediately.cCs+|rtd|ƒ‚ntddƒ‚dS(NiR(R(R tmsg((s../../common/util.pyterror—scCs)|rtd|ƒ‚ntjdƒdS(Ni(Rtsystexit(R RC((s../../common/util.pyRFœsN(RRRRRDRF(((s../../common/util.pyRB“s (RtgettextRRt solaris.misctsolarisRER"R+topentdevt translationtTrueR tmiscRt StandardErrorRR9RAtoptparset OptionParserRB(((s../../common/util.pyts&        ;