Your IP : 172.28.240.42


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

ó
[³XMc@s?dZdgZdefd„ƒYZdefd„ƒYZdS(sM
L{twisted.python.fakepwd} provides a fake implementation of the L{pwd} API.
tUserDatabaset_UserRecordcBs)eZdZd„Zd„Zd„ZRS(s¯
    L{_UserRecord} holds the user data for a single user in L{UserDatabase}.
    It corresponds to L{pwd.struct_passwd}.  See that class for attribute
    documentation.
    cCsC||_||_||_||_||_||_||_dS(N(tpw_namet	pw_passwdtpw_uidtpw_gidtpw_gecostpw_dirtpw_shell(tselftnametpasswordtuidtgidtgecosthometshell((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyt__init__s						cCsdS(Ni((R	((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyt__len__scCs2|j|j|j|j|j|j|jf|S(N(RRRRRRR(R	tindex((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyt__getitem__!s(t__name__t
__module__t__doc__RRR(((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyR
s	
	cBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sí
    L{UserDatabase} holds a traditional POSIX user data in memory and makes it
    available via the same API as L{pwd}.

    @ivar _users: A C{list} of L{_UserRecord} instances holding all user data
        added to this database.
    cCs
g|_dS(N(t_users(R	((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyR0sc	Cs,|jjt|||||||ƒƒdS(s§
        Add a new user record to this database.

        @param username: The value for the C{pw_name} field of the user
            record to add.
        @type username: C{str}

        @param password: The value for the C{pw_passwd} field of the user
            record to add.
        @type password: C{str}

        @param uid: The value for the C{pw_uid} field of the user record to
            add.
        @type uid: C{int}

        @param gid: The value for the C{pw_gid} field of the user record to
            add.
        @type gid: C{int}

        @param gecos: The value for the C{pw_gecos} field of the user record
            to add.
        @type gecos: C{str}

        @param home: The value for the C{pw_dir} field of the user record to
            add.
        @type home: C{str}

        @param shell: The value for the C{pw_shell} field of the user record to
            add.
        @type shell: C{str}
        N(RtappendR(R	tusernameRRR
RRR((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pytaddUser4s cCs4x$|jD]}|j|kr
|Sq
Wtƒ‚dS(sH
        Return the user record corresponding to the given uid.
        N(RRtKeyError(R	Rtentry((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pytgetpwuidXscCs4x$|jD]}|j|kr
|Sq
Wtƒ‚dS(sM
        Return the user record corresponding to the given username.
        N(RRR(R	R
R((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pytgetpwnambscCs|jS(s4
        Return a list of all user records.
        (R(R	((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pytgetpwallls(RRRRRRRR (((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyR(s		$	
	
N(Rt__all__tobjectRR(((s:/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyt<module>s