<s> import abc <EOL> import os , logging <EOL> class PyFiler ( object ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = abc . ABCMeta <EOL> @ abc . abstractmethod <EOL> def move_to_matching_folder ( self , filename ) : <EOL> """<STR_LIT>""" <EOL> @ abc . abstractmethod <EOL> def file_original ( self , original_filename ) : <EOL> """<STR_LIT>""" <EOL> @ abc . abstractmethod <EOL> def add_folder_target ( self , folder , keywords ) : <EOL> """<STR_LIT>""" <EOL> def _get_unique_filename_by_appending_version_integer ( self , tgtfilename ) : <EOL> if os . path . exists ( tgtfilename ) : <EOL> logging . info ( "<STR_LIT>" % ( os . path . basename ( tgtfilename ) , os . path . dirname ( tgtfilename ) ) ) <EOL> num = <NUM_LIT:1> <EOL> dr , fn , ext = self . _split_filename_dir_filename_ext ( tgtfilename ) <EOL> tgtfilename = os . path . join ( dr , "<STR_LIT>" % ( fn , num , ext ) ) <EOL> while os . path . exists ( tgtfilename ) : <EOL> num += <NUM_LIT:1> <EOL> tgtfilename = os . path . join ( dr , "<STR_LIT>" % ( fn , num , ext ) ) <EOL> logging . info ( "<STR_LIT>" % tgtfilename ) <EOL> logging . info ( "<STR_LIT>" % ( os . path . basename ( tgtfilename ) , os . path . dirname ( tgtfilename ) ) ) <EOL> return tgtfilename <EOL> def _split_filename_dir_filename_ext ( self , filename ) : <EOL> dr , fn = os . path . split ( filename ) <EOL> fn_no_ext , ext = os . path . splitext ( fn ) <EOL> return dr , fn_no_ext , ext <EOL> def get_target_folder ( self ) : <EOL> return self . _target_folder <EOL> def set_target_folder ( self , target_folder ) : <EOL> self . _target_folder = target_folder <EOL> def get_default_folder ( self ) : <EOL> return self . _default_folder <EOL> def set_default_folder ( self , default_folder ) : <EOL> self . _default_folder = default_folder <EOL> def get_original_move_folder ( self ) : <EOL> return self . _original_move_folder <EOL> def set_original_move_folder ( self , original_move_folder ) : <EOL> self . _original_move_folder = original_move_folder <EOL> def get_folder_targets ( self ) : <EOL> return self . _folder_targets <EOL> def set_folder_targets ( self , folder_targets ) : <EOL> self . _folder_targets = folder_targets <EOL> target_folder = property ( get_target_folder , set_target_folder ) <EOL> default_folder = property ( get_default_folder , set_default_folder ) <EOL> original_move_folder = property ( get_original_move_folder , set_original_move_folder ) <EOL> folder_targets = property ( get_folder_targets , set_folder_targets ) <EOL> """<STR_LIT>""" </s>
