<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import SCons . Action <EOL> import SCons . Defaults <EOL> import SCons . Tool . pdf <EOL> import SCons . Tool . tex <EOL> import SCons . Util <EOL> _null = SCons . Scanner . LaTeX . _null <EOL> def DviPdfPsFunction ( XXXDviAction , target = None , source = None , env = None ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> abspath = source [ <NUM_LIT:0> ] . attributes . path <EOL> except AttributeError : <EOL> abspath = '<STR_LIT>' <EOL> saved_env = SCons . Scanner . LaTeX . modify_env_var ( env , '<STR_LIT>' , abspath ) <EOL> result = XXXDviAction ( target , source , env ) <EOL> if saved_env is _null : <EOL> try : <EOL> del env [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> else : <EOL> env [ '<STR_LIT>' ] [ '<STR_LIT>' ] = saved_env <EOL> return result <EOL> def DviPdfFunction ( target = None , source = None , env = None ) : <EOL> result = DviPdfPsFunction ( PDFAction , target , source , env ) <EOL> return result <EOL> def DviPdfStrFunction ( target = None , source = None , env = None ) : <EOL> """<STR_LIT>""" <EOL> if env . GetOption ( "<STR_LIT>" ) : <EOL> result = env . subst ( '<STR_LIT>' , <NUM_LIT:0> , target , source ) <EOL> else : <EOL> result = '<STR_LIT>' <EOL> return result <EOL> PDFAction = None <EOL> DVIPDFAction = None <EOL> def PDFEmitter ( target , source , env ) : <EOL> """<STR_LIT>""" <EOL> def strip_suffixes ( n ) : <EOL> return not SCons . Util . splitext ( str ( n ) ) [ <NUM_LIT:1> ] in [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> source = list ( filter ( strip_suffixes , source ) ) <EOL> return ( target , source ) <EOL> def generate ( env ) : <EOL> """<STR_LIT>""" <EOL> global PDFAction <EOL> if PDFAction is None : <EOL> PDFAction = SCons . Action . Action ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> global DVIPDFAction <EOL> if DVIPDFAction is None : <EOL> DVIPDFAction = SCons . Action . Action ( DviPdfFunction , strfunction = DviPdfStrFunction ) <EOL> import pdf <EOL> pdf . generate ( env ) <EOL> bld = env [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> bld . add_action ( '<STR_LIT>' , DVIPDFAction ) <EOL> bld . add_emitter ( '<STR_LIT>' , PDFEmitter ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = SCons . Util . CLVar ( '<STR_LIT>' ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = [ '<STR_LIT>' ] <EOL> def exists ( env ) : <EOL> SCons . Tool . tex . generate_darwin ( env ) <EOL> return env . Detect ( '<STR_LIT>' ) </s>
