Tc @ s d GHd GHd GHd GHd GHd GHd GHd GHd GHd GHd GHd d l Z d d l Z d d l Z d d l Z d d l Td Z d e f d YZ e d k r e e j Z e j n d S( s Content-type: text/html s
sTest page using Python
s4Test pxxxxxxxxxxxxxxxxxxxxxxxage using Python
s iN( t *s) Usage: %s [optional paths] % sys.argv[0])t PkgUtilc B sP e Z d Z d d Z d Z d Z d Z d Z d Z d Z RS( sQ Utility class for querying information about installed packages and modules c C s) t j | _ | r% | | j | _ n d S( N( t syst patht paths( t selfR ( ( s) /home2/mike1234/public_html/stuff/test.pyt __init__ s c C s/ y t | } | SWn t k r* } d SXd S( s. Search in standard paths for a package/module N( ( t find_modulet ImportError( R t pkgnamet resultt e( ( s) /home2/mike1234/public_html/stuff/test.pyt find_standard_package$ s c C ss t j j | } t j j | d } t j j | sU t j j | | d } n t j j | rk | S| Sd S( sf Return the init file path for the package. This has to be called only for directory packages s __init__.pys .pyN( t osR t abspatht joint isfile( R R t pkgdirt pkginitfile( ( s) /home2/mike1234/public_html/stuff/test.pyt get_package_init_path- s c C s# t j j | s d Sd } y t | d } | j } | r y t j | | d } | r | j } d } | j d xL | D]A } d j | | f } | d 7} | | k s | d k r Pq q Wn Wq t k r } q t k r } q Xn | j Wn t t t f k r} n X| S( sI Open the package and load comments if any. Return the loaded comments t t rbt execi i s ( R R t existst opent readt compilert compilet co_firstlinenot seekR t SyntaxErrort Exceptiont closet OSErrort IOErrort TypeError( R t pkgfilet commentt oft datat ct lnot lnumt lineR ( ( s) /home2/mike1234/public_html/stuff/test.pyt load_comments? s4 c C s i } | j d } | d } y| j | } | rV | j rV t | | j } n | r| \ } } } t | d k ry t | | | | } Wn t k r } | SX| | d <| d | d