<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __revision__ = "<STR_LIT>" [ <NUM_LIT:11> : - <NUM_LIT:2> ] <EOL> import os <EOL> import types <EOL> import sys <EOL> def die ( reason ) : <EOL> sys . stderr . write ( reason + '<STR_LIT:\n>' ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def useOrRaise ( thing , errmsg = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> if type ( thing ) == types . ClassType and issubclass ( thing , Exception ) : <EOL> raise thing ( errmsg ) <EOL> return thing <EOL> def checkKeywords ( dic , legalKeywords , what = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> for k in dic . keys ( ) : <EOL> if k not in legalKeywords : <EOL> raise TypeError ( "<STR_LIT>" % ( k , what ) ) <EOL> def removeFromList ( list_ , * elements ) : <EOL> """<STR_LIT>""" <EOL> for elm in elements : <EOL> try : <EOL> list_ . remove ( elm ) <EOL> except ValueError : <EOL> pass <EOL> def mkdirsWithPyInitFiles ( path ) : <EOL> """<STR_LIT>""" <EOL> dir , fil = os . path . split ( path ) <EOL> if dir and not os . path . exists ( dir ) : <EOL> mkdirsWithPyInitFiles ( dir ) <EOL> if not os . path . exists ( path ) : <EOL> os . mkdir ( path ) <EOL> init = os . path . join ( path , "<STR_LIT>" ) <EOL> f = open ( init , '<STR_LIT:w>' ) <EOL> f . close ( ) </s>
