Changeset 438


Ignore:
Timestamp:
19-05-11 02:28:36 (2 years ago)
Author:
thomas
Message:
  • morituri/program/cdparanoia.py:
  • morituri/common/encode.py:
  • morituri/common/program.py:
  • morituri/rip/cd.py: Add action and what args to describe task better.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r437 r438  
     12011-05-19  Thomas Vander Stichele  <thomas at apestaart dot org> 
     2 
     3        * morituri/program/cdparanoia.py: 
     4        * morituri/common/encode.py: 
     5        * morituri/common/program.py: 
     6        * morituri/rip/cd.py: 
     7          Add action and what args to describe task better. 
     8 
    192011-05-19  Thomas Vander Stichele  <thomas at apestaart dot org> 
    210 
  • trunk/morituri/common/encode.py

    r434 r438  
    138138    peak = None 
    139139 
    140     def __init__(self, inpath, outpath, profile, taglist=None): 
     140    def __init__(self, inpath, outpath, profile, taglist=None, what="track"): 
    141141        """ 
    142142        @param profile: encoding profile 
     
    155155        self._profile = profile 
    156156 
     157        self.description = "Encoding %s" % what 
    157158        self._profile.test() 
    158159 
     
    163164        import gst 
    164165 
    165         self._pipeline = gst.parse_launch(''' 
     166        desc = ''' 
    166167            filesrc location="%s" ! 
    167168            decodebin name=decoder ! 
     
    172173                common.quoteParse(self._inpath).encode('utf-8'), 
    173174                self._profile.pipeline, 
    174                 common.quoteParse(self._outpath).encode('utf-8'))) 
     175                common.quoteParse(self._outpath).encode('utf-8')) 
     176 
     177        self.debug('creating pipeline: %r', desc) 
     178        self._pipeline = gst.parse_launch(desc) 
    175179 
    176180        tagger = self._pipeline.get_by_name('tagger') 
     
    273277        self._pipeline.set_state(gst.STATE_NULL) 
    274278        self.debug('set state to NULL') 
     279        # FIXME: maybe this should move lower ? If used by BaseMultiTask, 
     280        # this starts the next task without showing us the peakdB 
    275281        task.Task.stop(self) 
    276282 
  • trunk/morituri/common/program.py

    r431 r438  
    462462        return trackResult.testcrc == t.checksum 
    463463 
    464     def ripTrack(self, runner, trackResult, offset, device, profile, taglist): 
     464    def ripTrack(self, runner, trackResult, offset, device, profile, taglist, 
     465        what=None): 
    465466        """ 
    466467        @param trackResult: the object to store information in. 
     
    479480            os.makedirs(dirname) 
    480481 
     482        if not what: 
     483            what='track %d' % (trackResult.number, ) 
     484 
    481485        t = cdparanoia.ReadVerifyTrackTask(trackResult.filename, 
    482486            self.result.table, start, stop, 
     
    484488            device=device, 
    485489            profile=profile, 
    486             taglist=taglist) 
    487         t.description = 'Reading Track %d' % trackResult.number  
     490            taglist=taglist, 
     491            what=what) 
    488492 
    489493        runner.run(t) 
  • trunk/morituri/program/cdparanoia.py

    r432 r438  
    188188    """ 
    189189 
    190     description = "Reading Track" 
     190    description = "Reading track" 
    191191    quality = None # set at end of reading 
    192192 
    193193    _MAXERROR = 100 # number of errors detected by parser 
    194194 
    195     def __init__(self, path, table, start, stop, offset=0, device=None): 
     195    def __init__(self, path, table, start, stop, offset=0, device=None, 
     196        action="Reading", what="track"): 
    196197        """ 
    197198        Read the given track. 
     
    209210        @param device: the device to rip from 
    210211        @type  device: str 
     212        @param action: a string representing the action; e.g. Read/Verify 
     213        @type  action: str 
     214        @param what:   a string representing what's being read; e.g. Track 
     215        @type  what:   str 
    211216        """ 
    212217        assert type(path) is unicode, "%r is not unicode" % path 
     
    222227        self._buffer = "" # accumulate characters 
    223228        self._errors = [] 
     229        self.description = "%s %s" % (action, what) 
    224230 
    225231    def start(self, runner): 
     
    372378 
    373379    def __init__(self, path, table, start, stop, offset=0, device=None, 
    374                  profile=None, taglist=None): 
     380                 profile=None, taglist=None, what="track"): 
    375381        """ 
    376382        @param path:    where to store the ripped track 
     
    393399        task.MultiSeparateTask.__init__(self) 
    394400 
     401        self.debug('Creating read and verify task on %r', path) 
    395402        self.path = path 
    396403 
     
    409416        self.tasks.append( 
    410417            ReadTrackTask(tmppath, table, start, stop, 
    411                 offset=offset, device=device)) 
     418                offset=offset, device=device, what=what)) 
    412419        self.tasks.append(checksum.CRC32Task(tmppath)) 
    413420        t = ReadTrackTask(tmppath, table, start, stop, 
    414             offset=offset, device=device) 
    415         t.description = 'Verifying track...' 
     421            offset=offset, device=device, action="Verifying", what=what) 
    416422        self.tasks.append(t) 
    417423        self.tasks.append(checksum.CRC32Task(tmppath)) 
     
    427433 
    428434        self.tasks.append(encode.EncodeTask(tmppath, tmpoutpath, profile, 
    429             taglist=taglist)) 
     435            taglist=taglist, what=what)) 
    430436        # make sure our encoding is accurate 
    431437        self.tasks.append(checksum.CRC32Task(tmpoutpath)) 
  • trunk/morituri/rip/cd.py

    r420 r438  
    216216                    device=self.parentCommand.options.device, 
    217217                    profile=profile, 
    218                     taglist=prog.getTagList(number)) 
     218                    taglist=prog.getTagList(number), 
     219                    what='track %d of %d' % (number, len(itable.tracks))) 
    219220 
    220221                if trackResult.testcrc == trackResult.copycrc: 
Note: See TracChangeset for help on using the changeset viewer.