(self, filename)
return audio
extract the code from the filename
extract the code from the filename
extract the code from the filename
def get_sobject_by_filename(self, filename):
        '''extract the code from the filename'''
        naming = Naming.get_by_search_type('prod/shot_audio')
        if not naming:  
            return None

        shot_code = NamingUtil.extract_sobject_code(naming, filename, 'shot_code')
        # verify the code
        from pyasm.prod.biz import Shot
        shot = Shot.get_by_code(shot_code)
        if not shot:
            return None

        from pyasm.prod.biz import ShotAudio
        audio = ShotAudio.get_by_shot_code(shot_code)
        
        if not audio:
            audio = ShotAudio.create(shot_code)

        return audio
def get_sobject_by_filename ( self , filename ) : naming = Naming . get_by_search_type ( 'prod/shot_audio' ) if not naming : return None shot_code = NamingUtil . extract_sobject_code ( naming , filename , 'shot_code' ) # verify the code from pyasm . prod . biz import Shot shot = Shot . get_by_code ( shot_code ) if not shot : return None from pyasm . prod . biz import ShotAudio audio = ShotAudio . get_by_shot_code ( shot_code ) if not audio : audio = ShotAudio . create ( shot_code ) return audio