Ζ
νή?:c       so   d  Z  d k Z e Z e Z d   Z e Z d   Z d Z d d  Z	 d f  d     YZ
 d
 d d d	  Z d S(   s   Temporary files and filenames.Nc     sΌ  t  t j	 o t  Sn y t i   }  Wn% t t i f j
 o t i }  n Xd d d |  g } t i	 d j o$ | i
 d d  | i
 d d  n t i	 d j o d	 k } d	 k } yS | i | i | i d
  \ } } | i | | d f  i   } | i
 d |  Wn | i j
 o n Xn xG d d d f d r4 } t i i |  o | i
 d t i |  n q7Wt   d } x| d r}	 yκ t i i |	 |  }
 t i	 d j o y* t i |
 t i t i  Bt i! Bd  } Wn t# j
 o nE Xt i$ | d  } | i& d  | i'   t i( |
  ~ ~ |	 a  Pn; t |
 d  } | i& d  | i'   t i( |
  |	 a  PWn t) j
 o n XqWt  t j o d | } t) |  n t  Sd	 S(   s+   Function to calculate the directory to use.s   /var/tmps   /usr/tmps   /tmps   nti    s   C:\TEMPs   \TEMPs   macNi   s    s   TMPDIRs   TEMPs   TMPs   tests   posixiΐ  s   ws   blats0   Can't find a usable temporary directory amongst (+   s   tempdirs   Nones   oss   getcwds   pwds   AttributeErrors   errors   curdirs
   attempdirss   names   inserts   macfss   MACFSs
   FindFolders   kOnSystemDisks   kTemporaryFolderTypes   refnums   dirids   FSSpecs   as_pathnames   dirnames   envnames   environs   has_keys   gettempprefixs   testfiles   dirs   paths   joins   filenames   opens   O_RDWRs   O_CREATs   O_EXCLs   fds   OSErrors   fdopens   fps   writes   closes   unlinks   IOErrors   msg(   s   pwds
   attempdirss   macfss   MACFSs   refnums   dirids   dirnames   envnames   testfiles   dirs   filenames   fds   fps   msgs7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys
   gettempdir sl      	 	 *

	c      sΕ   t  i d j o t o t t  i   j o
 t a n t t j o| t  i d j o t  i   a d t d a nJ t  i d j o d t  i   d a n! t  i d j o
 d a n d	 a n t Sd
 S(   s6   Function to calculate a prefix of the filename to use.s   posixs   @s   .s   nts   ~s   -s   macs   Python-Tmp-s   tmpN(   s   oss   names   _pids   getpids   Nones   template(    s7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   gettempprefixL s      *


i    c    si   t    } t   } xP d oH t d a t i i | | t |   } t i i
 |  o | Sn q Wd S(   s>   User-callable function to return a unique temporary file name.i   N(   s
   gettempdirs   dirs   gettempprefixs   pres   counters   oss   paths   joins   suffixs   files   exists(   s   suffixs   dirs   pres   files7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   mktempd s      		 
s    s   TemporaryFileWrapperc      s,   d  Z  d   Z d   Z d   Z d   Z RS(   sΓ   Temporary file wrapper

    This class provides a wrapper around files opened for temporary use.
    In particular, it seeks to automatically remove the file when it is
    no longer needed.
    c    s   | |  _  | |  _ d  S(   N(   s   files   selfs   path(   s   selfs   files   paths7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   __init__w s    	c    s!   |  i i   t i |  i  d  S(   N(   s   selfs   files   closes   oss   unlinks   path(   s   selfs7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   close{ s    c    s   y |  i   Wn n Xd  S(   N(   s   selfs   close(   s   selfs7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   __del__ s      c    sQ   |  i d } t | |  } t |  t d  j o t |  | |  n | Sd  S(   Ns   filei    (   s   selfs   __dict__s   files   getattrs   names   as   types   setattr(   s   selfs   names   files   as7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   __getattr__ s
    (   s   __doc__s   __init__s   closes   __del__s   __getattr__(    s7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   TemporaryFileWrapperp s
    			c    s§   t  |  } t i d j oh t i | t i t i Bt i Bd  } y$ t i	 |  t i
 | |  |  SWn t i |    n Xn  t | |  |  } t | |  Sd S(   sB   Create and return a temporary file (opened read-write by default).s   posixiΐ  N(   s   mktemps   suffixs   names   oss   opens   O_RDWRs   O_CREATs   O_EXCLs   fds   unlinks   fdopens   modes   bufsizes   closes   files   TemporaryFileWrapper(   s   modes   bufsizes   suffixs   names   fds   files7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   TemporaryFile s     &s   w+bi   (   s   __doc__s   oss   Nones   tempdirs   templates
   gettempdirs   _pids   gettempprefixs   counters   mktemps   TemporaryFileWrappers   TemporaryFile(    s7   /home/guest/edwardam/cmp2/py2/lib/python2.0/tempfile.pys   ? s   		9	