Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/enterprise/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyc


[XMc@sddlZddlZddlmZmZddlmZddlmZeddddZ	ee	Z
ejdee	fd	ed
Z
dZie
d6ed
6ed6ed6ed6e
d6e
d6e
d6e
d6e
d6e
d6e
d6e
d6e
d6e
d6ed6ed6ed6ed6ed6Zd efd!YZd"Ze
eZed#Ze
eZd$Ze
eZd%Ze
eZd&Ze
eZd'd1d(YZd)d2d*YZd+d,d-d d.d/d0gZdS(3iN(tVersiontgetVersionString(t
deprecated(t_safetTwistediis/twisted.enterprise.util is deprecated since %s.tcategoryiitbiginttbooltbooleantbyteatdatetint2tint4tint8tinttintegertfloat4tfloat8tnumerictrealtsmallinttcharttextttimet	timestamptvarchartDBErrorcBseZRS((t__name__t
__module__(((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyR/scCs@|j}x-|jD]"\}}||jkr|SqWdS(N(tlowert
rowKeyColumnstNone(trowClasstnametlcnamet	keyColumnttype((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pytgetKeyColumn6s
cCstj|d}|dkr1td|n|dkrAdS|tkrWt|S|tkr|jdr|rd}qd}n|dkrOdg}x|D]}t|}|dkr|j	d	q|d
kr|j	|dqd|kod
knr |j	|q|j	d|qW|j	ddj
|St|tj
rt|tjrt|}nd||SdS(seAdd quotes for text types and no quotes for integer types.
    NOTE: uses Postgresql type codes.
    sType %s not knowntnullRt1t0R	t'is\\000i\ii i~s\%03ots'%s'N(t	dbTypeMaptgetRRtNOQUOTEtstrtUSEQUOTEt
startswithtordtappendtjoint
isinstancettypest
StringTypetUnicodeType(tvaluettypeCodetstring_escapertqtltcti((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pytquote@s:
			


cCs
t|S(s<
    Make a string safe to include in an SQL statement.
    (R(R((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pytsafefscCsyi}xltdt|D]U}|j|dj}x5|jD]*}|j|krC||||<PqCqCWqW|S(sUtility method to construct a dictionary for the attributes
    of an object from set of args. This also fixes the case of column names.
    i(trangetlent	dbColumnsRt
rowColumns(R targstkwR>t
columnNametattr((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pytmakeKWoscCs|}|jj||S(s7Used by loadObjects to create rowObject instances.
    (t__dict__tupdate(R tdataRFt	newObject((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pytdefaultFactoryMethod~s	t
_TableInfocBs)eZdZdZdZdZRS(sw(internal)

    Info about a table/class and it's relationships. Also serves as a container for
    generated SQL.
    cCs||_|j|_|j|_|j|_t|drK|j|_n	g|_t|dr|jr{|j|_qtg|_ntg|_d|_	d|_
d|_g|_g|_
dS(NtrowForeignKeystrowFactoryMethod(R trowTableNameRRDthasattrRPRQRNRt	updateSQLt	deleteSQLt	insertSQLt
relationshipsRC(tselftrc((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyt__init__s"							cCs&|jjt|||||dS(sThis information is attached to the "parent" table
                childColumns - columns of the "child" table
                parentColumns - columns of the "parent" table, the one being joined to... the "foreign" table
        N(RWR2t_TableRelationship(RXtchildColumnst
parentColumnst
childRowClasstcontainerMethodtautoLoad((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyt
addForeignKeyscCs.x'|jD]}|jj|kr
|Sq
WdS(N(RWR^RRR(RXt	tableNametrelationship((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pytgetRelationshipFors(RRt__doc__RZRaRd(((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyROs		R[cBseZdZdZRS(sC(Internal)

    A foreign key relationship between two tables.
    cCs1||_||_||_||_||_dS(N(R\R]R^R_R`(RXR\R]R^R_R`((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyRZs
				(RRReRZ(((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyR[sR-R/R+R%R@R?(((twarningsR5ttwisted.python.versionsRRttwisted.python.deprecateRttwisted.enterprise.adbapiRt_deprecatedVersiont_releasedDeprecationtwarntDeprecationWarningR-R/R+t	ExceptionRR%R?R@RIRNROR[t__all__(((s;/usr/lib/python2.7/dist-packages/twisted/enterprise/util.pyt<module>s^
	#			-