*
8;c       s     d  Z    h  d d <d d <d d <d d <d	 d
 <d d <d d <Z - y . e d i d  d Z Wn / 0 d Z n X5 d k Z 6 d k Z 7 d k Z < d k Z C d e i i	 f d     YZ
 d S(   s6   A base class for file-based formatters for HappyDoc.

s"   $RCSfile: fileformatterbase.py,v $s   module_names    Doug Hellmann <doug@hellfly.net>s   creators   HappyDocs   projects   Sat, 03-Jun-2000 17:56:22 EDTs   createds   $Author: doughellmann $s   authors   $Revision: 1.4 $s   versions   $Date: 2001/11/11 18:53:44 $s   dates    i   s   0.0Ns   FileBasedFormatterc      s   C d  Z  E G d d  Z c e d  Z k d   Z p d   Z ~ d   Z  d   Z  d   Z  d	   Z	  d
   Z
 d   Z d   Z RS(   s9   A base class for file-based formatters for HappyDoc.
    s    c    sE   G V Z | |  _ ^ t t i i i _ |  | f ` |  a d Sd S(   s  Initialize a FileBasedFormatter.

        Parameters

          docSet -- The documentation set controlling the formatter.
          
          filenamePrefix -- A prefix to append to the base names of
          files and directories being created.  This is useful for
          situations where the names which would be automatically
          generated might cause a name clash or conflict.

          extraNamedParameters -- Parameters specified by name which
          were not supported by a subclass initialization.
          
        N(
   s   filenamePrefixs   selfs   _filename_prefixs   applys   happydoclibs   happyformatters   HappyFormatterBases   __init__s   docSets   extraNamedParameters(   s   selfs   docSets   filenamePrefixs   extraNamedParameters(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   __init__G s   
c    sf   c d e t  i i t  i i |   f t | d  } g t |  d  o h | |  _	 n i | Sd S(   s5   Open the named output destination and give the title.s   wts   open_root_fileN(
   s   happydoclibs   paths   rmkdirs   dirnames   names   opens   fs   hasattrs   selfs   open_root_file(   s   selfs   names   title1s   title2s   f(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys
   openOutputc s   c    s   k l m | i   n d Sd S(   s   Close the output handle.N(   s   outputs   close(   s   selfs   output(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   closeOutputk s   c    s[   p q u t  i i |  } y |  i   o% z t  i i | { |  i    } n | | Sd S(   sI   Tweak the filename to remove relative references and add the safe prefix.N(   s   happydoclibs   paths   removeRelativePrefixs   filenames   selfs   getFilenamePrefixs   applyPrefixToPath(   s   selfs   filename(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   fixUpOutputFilenamep s   c    sw   ~   t  i i d d  d |  |  i |  }  |  i   }  d | | f }  t  i i	 |   | Sd S(   s   
        Return the base name of the thing to which output should be
        written for a file.  This is usually a file name, but could be
        anything understood by the formatter as a name.  If infoObject
        is None, return the name for a root node for this formatter.
        s   FileBasedFormatters   getOutputNameForFiles   filenames   %s.%sN(
   s   happydoclibs   TRACEs   intos   filenames   selfs   fixUpOutputFilenames   getFilenameExtensions	   extensions   names   outof(   s   selfs   filenames   names	   extension(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getOutputNameForFile~ s   c    s:     t  i i d d  d |  t |  t i j o   t  i i d   | } n  t |  t i	 j o#  t  i i d   | i } n  | t
 j	 oc  t  i i d   |  i | i    }  t  i i d | i     t  i i d |  n  |  i   }  t  i i |   | Sd S(	   s0  
        Return the base name of the thing to which output should be written
        for an info source.  This is usually a file name, but could
        be anything understood by the formatter as a name.  If
        infoObject is None, return the name for a root node for this
        formatter.
        s   FileBasedFormatters   getOutputNameForObjects
   infoObjects   strings   files   file for %ss   is %sN(   s   happydoclibs   TRACEs   intos
   infoObjects   types   typess
   StringTypes   writes   names   FileTypes   Nones   selfs   getOutputNameForFiles   getFullyQualifiedNames   getNames   getRootNodeNames   outof(   s   selfs
   infoObjects   name(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getOutputNameForObject s"   c    se      |  i   }  | t j	 o&  d | i |  i    | f } n  |  i   }  | Sd S(   sA  
        Return a local reference to base name of the thing to which
        output should be written for an info source.  This is usually
        a file name, but could be anything understood by the formatter
        as a name.  If infoObject is None, return the name for a root
        node for this formatter.
        s   %s.%sN(	   s   selfs   getFilenameExtensions	   extensions
   infoObjects   Nones   getQualifiedNames   getFilenamePrefixs   names   getRootNodeName(   s   selfs
   infoObjects	   extensions   name(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getLocalOutputNameForObject s   &c 	   st     t  i i d d  d |  |  i |  }  |  i i   }  |  i i
   }  t  i i d |   t  i i d |   t  i i d |   | o | o! t  i i d   t i t  i i | |  }  t  i i d |   | | j o  | d	 d
 j o'  | d }  t  i i d |  n  t  i i | |  }  t  i i d |   |  i |  }  t  i i d |   t  i i | |  } n  t  i i | |  } n  | oW  t  i i d   |  i |  }  t  i i d |   t  i i | |  } n&  t  i i d   |  i |  }  t  i i |   | Sd S(   s>   Get the full name, including path, to the object being output.s   FileBasedFormatters   getFullOutputNameForObjects
   infoObjects   obj_output_names   docset_base_directorys   output_bases   root node for docsets   output_subdiri    s   /i   s   obj_output_sub_paths   subnode of docsets	   file_names   otherN(   s   happydoclibs   TRACEs   intos
   infoObjects   selfs   getOutputNameForObjects   obj_output_names   _docsets   getDocsetBaseDirectorys   docset_base_directorys   getOutputBaseDirectorys   output_bases   writeVars   writes   oss   seps   paths   removePrefixs   output_subdirs   joins   obj_output_sub_paths   fixUpOutputFilenames   names	   file_names   outof(	   s   selfs
   infoObjects   docset_base_directorys   obj_output_names   output_subdirs   output_bases   obj_output_sub_paths	   file_names   name(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getFullOutputNameForObject s@   
c    sg      |  i i   o1  t i i |  i i    |  i |   } n  |  i |  } | Sd S(   s>   Get the full name, including path, to the filename to convert.N(	   s   selfs   _docsets   getOutputBaseDirectorys   happydoclibs   paths   joins   getOutputNameForFiles   filenames   name(   s   selfs   filenames   name(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getFullOutputNameForFile s   c    s!   |  i d  d Sd S(   s<   Return the name of the root node for the documentation tree.s   getRootNodeNameN(   s   selfs   _requiredOfSubclass(   s   self(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getRootNodeNames   c    s   	
|  i Sd S(   s=   Return the filename prefix value for this formatter instance.N(   s   selfs   _filename_prefix(   s   self(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   getFilenamePrefixs   (   s   __doc__s   __init__s   Nones
   openOutputs   closeOutputs   fixUpOutputFilenames   getOutputNameForFiles   getOutputNameForObjects   getLocalOutputNameForObjects   getFullOutputNameForObjects   getFullOutputNameForFiles   getRootNodeNames   getFilenamePrefix(    (    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   FileBasedFormatterC s   	9(   s   __doc__s   __rcs_info__s   splits   __version__s   oss   strings   typess   happydoclibs   happyformatters   HappyFormatterBases   FileBasedFormatter(   s   __rcs_info__s   typess   happydoclibs   oss   __version__s   FileBasedFormatters   string(    (    se   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/formatter/fileformatterbase.pys   ? s   H