<s> import os <EOL> import shutil <EOL> class FilesException ( Exception ) : <EOL> pass <EOL> class FilesAlreadyRegistered ( FilesException ) : <EOL> pass <EOL> class FileRepo ( object ) : <EOL> def add_dud ( self , path , dud , mode ) : <EOL> if os . path . isdir ( path ) : <EOL> raise FilesAlreadyRegistered ( ) <EOL> os . makedirs ( path ) <EOL> for fp in [ dud . get_dud_file ( ) ] + dud . get_files ( ) : <EOL> shutil . copy2 ( fp , path ) <EOL> os . chmod ( "<STR_LIT>" % ( path , os . path . basename ( fp ) ) , mode ) </s>
