From 69f8f39c496066aa50aa67803550ae7167fda536 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Fri, 22 Mar 2019 12:43:27 +0000 Subject: [PATCH] Change documentation from epydoc to reStructuredText Thanks to Freso for all the useful comments! Signed-off-by: JoeLametta --- whipper/common/cache.py | 4 +- whipper/common/common.py | 36 ++++++------- whipper/common/mbngs.py | 24 ++++----- whipper/common/path.py | 8 +-- whipper/common/program.py | 35 ++++++------- whipper/common/renamer.py | 14 ++--- whipper/extern/task/task.py | 24 ++++----- whipper/image/cue.py | 12 ++--- whipper/image/image.py | 10 ++-- whipper/image/table.py | 99 ++++++++++++++++++----------------- whipper/image/toc.py | 20 +++---- whipper/program/cdparanoia.py | 87 +++++++++++++++--------------- whipper/program/cdrdao.py | 12 ++--- whipper/program/soxi.py | 4 +- whipper/result/result.py | 40 +++++++------- 15 files changed, 213 insertions(+), 216 deletions(-) diff --git a/whipper/common/cache.py b/whipper/common/cache.py index cf311a69..19ed0325 100644 --- a/whipper/common/cache.py +++ b/whipper/common/cache.py @@ -39,7 +39,7 @@ class Persister: Call persist to store the object to disk; it will get stored if it changed from the on-disk object. - @ivar object: the persistent object + :ivar object: the persistent object """ def __init__(self, path=None, default=None): @@ -162,7 +162,7 @@ def getRipResult(self, cddbdiscid, create=True): Retrieve the persistable RipResult either from our cache (from a previous, possibly aborted rip), or return a new one. - @rtype: L{Persistable} for L{result.RipResult} + :rtype: :any:`Persistable` for :any:`result.RipResult` """ presult = self._pcache.get(cddbdiscid) diff --git a/whipper/common/common.py b/whipper/common/common.py index b81395bf..b12b1686 100644 --- a/whipper/common/common.py +++ b/whipper/common/common.py @@ -56,11 +56,11 @@ def msfToFrames(msf): """ Converts a string value in MM:SS:FF to frames. - @param msf: the MM:SS:FF value to convert - @type msf: str + :param msf: the MM:SS:FF value to convert + :type msf: str - @rtype: int - @returns: number of frames + :rtype: int + :returns: number of frames """ if ':' not in msf: return int(msf) @@ -104,14 +104,14 @@ def formatTime(seconds, fractional=3): If it is greater than 0, we will show seconds and fractions of seconds. As a side consequence, there is no way to show seconds without fractions. - @param seconds: the time in seconds to format. - @type seconds: int or float - @param fractional: how many digits to show for the fractional part of + :param seconds: the time in seconds to format. + :type seconds: int or float + :param fractional: how many digits to show for the fractional part of seconds. - @type fractional: int + :type fractional: int - @rtype: string - @returns: a nicely formatted time string. + :rtype: string + :returns: a nicely formatted time string. """ chunks = [] @@ -207,11 +207,11 @@ def getRealPath(refPath, filePath): Does Windows path translation. Will look for the given file name, but with .flac and .wav as extensions. - @param refPath: path to the file from which the track is referenced; + :param refPath: path to the file from which the track is referenced; for example, path to the .cue file in the same directory - @type refPath: unicode + :type refPath: unicode - @type filePath: unicode + :type filePath: unicode """ assert isinstance(filePath, unicode), "%r is not unicode" % filePath @@ -300,11 +300,11 @@ class VersionGetter(object): def __init__(self, dependency, args, regexp, expander): """ - @param dependency: name of the dependency providing the program - @param args: the arguments to invoke to show the version - @type args: list of str - @param regexp: the regular expression to get the version - @param expander: the expansion string for the version using the + :param dependency: name of the dependency providing the program + :param args: the arguments to invoke to show the version + :type args: list of str + :param regexp: the regular expression to get the version + :param expander: the expansion string for the version using the regexp group dict """ diff --git a/whipper/common/mbngs.py b/whipper/common/mbngs.py index 661c735c..4bd23d11 100644 --- a/whipper/common/mbngs.py +++ b/whipper/common/mbngs.py @@ -58,13 +58,13 @@ class TrackMetadata(object): class DiscMetadata(object): """ - @param artist: artist(s) name - @param sortName: release artist sort name - @param release: earliest release date, in YYYY-MM-DD - @type release: unicode - @param title: title of the disc (with disambiguation) - @param releaseTitle: title of the release (without disambiguation) - @type tracks: C{list} of L{TrackMetadata} + :param artist: artist(s) name + :param sortName: release artist sort name + :param release: earliest release date, in YYYY-MM-DD + :type release: unicode + :param title: title of the disc (with disambiguation) + :param releaseTitle: title of the release (without disambiguation) + :type tracks: list of :any:`TrackMetadata` """ artist = None sortName = None @@ -163,11 +163,11 @@ def _getWorks(recording): def _getMetadata(release, discid, country=None): """ - @type release: C{dict} - @param release: a release dict as returned in the value for key release + :type release: dict + :param release: a release dict as returned in the value for key release from get_release_by_id - @rtype: L{DiscMetadata} or None + :rtype: DiscMetadata or None """ logger.debug('getMetadata for release id %r', release['id']) if not release['id']: @@ -281,9 +281,9 @@ def musicbrainz(discid, country=None, record=False): Example disc id: Mj48G109whzEmAbPBoGvd4KyCS4- - @type discid: str + :type discid: str - @rtype: list of L{DiscMetadata} + :rtype: list of :any:`DiscMetadata` """ logger.debug('looking up results for discid %r', discid) import musicbrainzngs diff --git a/whipper/common/path.py b/whipper/common/path.py index 268b3379..8d628fbe 100644 --- a/whipper/common/path.py +++ b/whipper/common/path.py @@ -28,10 +28,10 @@ class PathFilter(object): def __init__(self, slashes=True, quotes=True, fat=True, special=False): """ - @param slashes: whether to convert slashes to dashes - @param quotes: whether to normalize quotes - @param fat: whether to strip characters illegal on FAT filesystems - @param special: whether to strip special characters + :param slashes: whether to convert slashes to dashes + :param quotes: whether to normalize quotes + :param fat: whether to strip characters illegal on FAT filesystems + :param special: whether to strip special characters """ self._slashes = slashes self._quotes = quotes diff --git a/whipper/common/program.py b/whipper/common/program.py index 35509a69..e618a051 100644 --- a/whipper/common/program.py +++ b/whipper/common/program.py @@ -44,12 +44,11 @@ class Program: """ I maintain program state and functionality. - @ivar metadata: - @type metadata: L{mbngs.DiscMetadata} - @ivar result: the rip's result - @type result: L{result.RipResult} - @type outdir: unicode - @type config: L{whipper.common.config.Config} + :vartype metadata: mbngs.DiscMetadata + :cvar result: the rip's result + :vartype result: result.RipResult + :vartype outdir: unicode + :vartype config: whipper.common.config.Config """ cuePath = None @@ -60,7 +59,7 @@ class Program: def __init__(self, config, record=False): """ - @param record: whether to record results of API calls for playback. + :param record: whether to record results of API calls for playback. """ self._record = record self._cache = cache.ResultCache() @@ -109,7 +108,7 @@ def getTable(self, runner, cddbdiscid, mbdiscid, device, offset, """ Retrieve the Table either from the cache or the drive. - @rtype: L{table.Table} + :rtype: table.Table """ tcache = cache.TableCache() ptable = tcache.get(cddbdiscid, mbdiscid) @@ -153,7 +152,7 @@ def getRipResult(self, cddbdiscid): Retrieve the persistable RipResult either from our cache (from a previous, possibly aborted rip), or return a new one. - @rtype: L{result.RipResult} + :rtype: result.RipResult """ assert self.result is None @@ -247,9 +246,9 @@ def getPath(self, outdir, template, mbdiscid, metadata, track_number=None): @staticmethod def getCDDB(cddbdiscid): """ - @param cddbdiscid: list of id, tracks, offsets, seconds + :param cddbdiscid: list of id, tracks, offsets, seconds - @rtype: str + :rtype: str """ # FIXME: convert to nonblocking? try: @@ -272,7 +271,7 @@ def getCDDB(cddbdiscid): def getMusicBrainz(self, ittoc, mbdiscid, release=None, country=None, prompt=False): """ - @type ittoc: L{whipper.image.table.Table} + :type ittoc: whipper.image.table.Table """ # look up disc on MusicBrainz print('Disc duration: %s, %d audio tracks' % ( @@ -392,10 +391,10 @@ def getTagList(self, number, mbdiscid): """ Based on the metadata, get a dict of tags for the given track. - @param number: track number (0 for HTOA) - @type number: int + :param number: track number (0 for HTOA) + :type number: int - @rtype: dict + :rtype: dict """ trackArtist = u'Unknown Artist' releaseArtist = u'Unknown Artist' @@ -461,7 +460,7 @@ def getHTOA(self): """ Check if we have hidden track one audio. - @returns: tuple of (start, stop), or None + :returns: tuple of (start, stop), or None """ track = self.result.table.tracks[0] try: @@ -498,8 +497,8 @@ def ripTrack(self, runner, trackResult, offset, device, taglist, Ripping the track may change the track's filename as stored in trackResult. - @param trackResult: the object to store information in. - @type trackResult: L{result.TrackResult} + :param trackResult: the object to store information in. + :type trackResult: result.TrackResult """ if trackResult.number == 0: start, stop = self.getHTOA() diff --git a/whipper/common/renamer.py b/whipper/common/renamer.py index 0f24c364..22be22ad 100644 --- a/whipper/common/renamer.py +++ b/whipper/common/renamer.py @@ -109,10 +109,10 @@ def addRename(self, source, destination): """ Add a rename operation. - @param source: source filename - @type source: str - @param destination: destination filename - @type destination: str + :param source: source filename + :type source: str + :param destination: destination filename + :type destination: str """ @@ -142,16 +142,16 @@ def redo(self): def serialize(self): """ Serialize the operation. - The return value should bu usable with L{deserialize} + The return value should bu usable with :any:`deserialize` - @rtype: str + :rtype: str """ def deserialize(cls, data): """ Deserialize the operation with the given operation data. - @type data: str + :type data: str """ raise NotImplementedError deserialize = classmethod(deserialize) diff --git a/whipper/extern/task/task.py b/whipper/extern/task/task.py index b7e8d6ff..a996d27f 100644 --- a/whipper/extern/task/task.py +++ b/whipper/extern/task/task.py @@ -97,8 +97,8 @@ class Task(LogStub): stopping myself from running. The listener can then handle the Task.exception. - @ivar description: what am I doing - @ivar exception: set if an exception happened during the task + :cvar description: what am I doing + :cvar exception: set if an exception happened during the task execution. Will be raised through run() at the end. """ logCategory = 'Task' @@ -254,16 +254,16 @@ def progressed(self, task, value): """ Implement me to be informed about progress. - @type value: float - @param value: progress, from 0.0 to 1.0 + :type value: float + :param value: progress, from 0.0 to 1.0 """ def described(self, task, description): """ Implement me to be informed about description changes. - @type description: str - @param description: description + :type description: str + :param description: description """ def started(self, task): @@ -298,8 +298,8 @@ class BaseMultiTask(Task, ITaskListener): """ I perform multiple tasks. - @ivar tasks: the tasks to run - @type tasks: list of L{Task} + :ivar tasks: the tasks to run + :type tasks: list of :any:`Task` """ description = 'Doing various tasks' @@ -313,7 +313,7 @@ def addTask(self, task): """ Add a task. - @type task: L{Task} + :type task: Task """ if self.tasks is None: self.tasks = [] @@ -446,7 +446,7 @@ def run(self, task): """ Run the given task. - @type task: Task + :type task: Task """ raise NotImplementedError @@ -457,8 +457,8 @@ def schedule(self, delta, callable_task, *args, **kwargs): Subclasses should implement this. - @type delta: float - @param delta: time in the future to schedule call for, in seconds. + :type delta: float + :param delta: time in the future to schedule call for, in seconds. """ raise NotImplementedError diff --git a/whipper/image/cue.py b/whipper/image/cue.py index b7aa268b..1a49ca9d 100644 --- a/whipper/image/cue.py +++ b/whipper/image/cue.py @@ -62,14 +62,14 @@ class CueFile(object): """ I represent a .cue file as an object. - @type table: L{table.Table} - @ivar table: the index table. + :vartype table: table.Table + :ivar table: the index table. """ logCategory = 'CueFile' def __init__(self, path): """ - @type path: unicode + :type path: unicode """ assert isinstance(path, unicode), "%r is not unicode" % path @@ -154,7 +154,7 @@ def message(self, number, message): """ Add a message about a given line in the cue file. - @param number: line number, counting from 0. + :param number: line number, counting from 0. """ self._messages.append((number + 1, message)) @@ -182,7 +182,7 @@ def getRealPath(self, path): """ Translate the .cue's FILE to an existing path. - @type path: unicode + :type path: unicode """ return common.getRealPath(self._path, path) @@ -194,7 +194,7 @@ class File: def __init__(self, path, file_format): """ - @type path: unicode + :type path: unicode """ assert isinstance(path, unicode), "%r is not unicode" % path diff --git a/whipper/image/image.py b/whipper/image/image.py index e57ad3cd..83eb4b34 100644 --- a/whipper/image/image.py +++ b/whipper/image/image.py @@ -36,15 +36,15 @@ class Image(object): """ - @ivar table: The Table of Contents for this image. - @type table: L{table.Table} + :ivar table: The Table of Contents for this image. + :vartype table: table.Table """ logCategory = 'Image' def __init__(self, path): """ - @type path: unicode - @param path: .cue path + :type path: unicode + :param path: .cue path """ assert isinstance(path, unicode), "%r is not unicode" % path @@ -60,7 +60,7 @@ def getRealPath(self, path): """ Translate the .cue's FILE to an existing path. - @param path: .cue path + :param path: .cue path """ assert isinstance(path, unicode), "%r is not unicode" % path diff --git a/whipper/image/table.py b/whipper/image/table.py index 0b32d4dc..57377a93 100644 --- a/whipper/image/table.py +++ b/whipper/image/table.py @@ -57,17 +57,18 @@ class Track: """ I represent a track entry in an Table. - @ivar number: track number (1-based) - @type number: int - @ivar audio: whether the track is audio - @type audio: bool - @type indexes: dict of number -> L{Index} - @ivar isrc: ISRC code (12 alphanumeric characters) - @type isrc: str - @ivar cdtext: dictionary of CD Text information; see L{CDTEXT_KEYS}. - @type cdtext: str -> unicode - @ivar pre_emphasis: whether track is pre-emphasised - @type pre_emphasis: bool + :cvar number: track number (1-based) + :vartype number: int + :cvar audio: whether the track is audio + :vartype audio: bool + :vartype indexes: dict of number -> :any:`Index` + :cvar isrc: ISRC code (12 alphanumeric characters) + :vartype isrc: str + :cvar cdtext: dictionary of CD Text information; + :any:`see CDTEXT_KEYS` + :vartype cdtext: str -> unicode + :cvar pre_emphasis: whether track is pre-emphasised + :vartype pre_emphasis: bool """ number = None @@ -90,7 +91,7 @@ def __init__(self, number, audio=True, session=None): def index(self, number, absolute=None, path=None, relative=None, counter=None): """ - @type path: unicode or None + :type path: unicode or None """ if path is not None: assert isinstance(path, unicode), "%r is not unicode" % path @@ -130,9 +131,9 @@ def getPregap(self): class Index: """ - @ivar counter: counter for the index source; distinguishes between + :cvar counter: counter for the index source; distinguishes between the matching FILE lines in .cue files for example - @type path: unicode or None + :vartype path: unicode or None """ number = None absolute = None @@ -161,11 +162,11 @@ class Table(object): """ I represent a table of indexes on a CD. - @ivar tracks: tracks on this CD - @type tracks: list of L{Track} - @ivar catalog: catalog number - @type catalog: str - @type cdtext: dict of str -> str + :cvar tracks: tracks on this CD + :vartype tracks: list of :any:`Track` + :cvar catalog: catalog number + :vartype catalog: str + :vartype cdtext: dict of str -> str """ tracks = None # list of Track @@ -193,22 +194,22 @@ def unpickled(self): def getTrackStart(self, number): """ - @param number: the track number, 1-based - @type number: int + :param number: the track number, 1-based + :type number: int - @returns: the start of the given track number's index 1, in CD frames - @rtype: int + :returns: the start of the given track number's index 1, in CD frames + :rtype: int """ track = self.tracks[number - 1] return track.getIndex(1).absolute def getTrackEnd(self, number): """ - @param number: the track number, 1-based - @type number: int + :param number: the track number, 1-based + :type number: int - @returns: the end of the given track number (ie index 1 of next track) - @rtype: int + :returns: the end of the given track number (ie index 1 of next track) + :rtype: int """ # default to end of disc end = self.leadout - 1 @@ -228,24 +229,24 @@ def getTrackEnd(self, number): def getTrackLength(self, number): """ - @param number: the track number, 1-based - @type number: int + :param number: the track number, 1-based + :type number: int - @returns: the length of the given track number, in CD frames - @rtype: int + :returns: the length of the given track number, in CD frames + :rtype: int """ return self.getTrackEnd(number) - self.getTrackStart(number) + 1 def getAudioTracks(self): """ - @returns: the number of audio tracks on the CD - @rtype: int + :returns: the number of audio tracks on the CD + :rtype: int """ return len([t for t in self.tracks if t.audio]) def hasDataTracks(self): """ - @returns: whether this disc contains data tracks + :returns: whether this disc contains data tracks """ return len([t for t in self.tracks if not t.audio]) > 0 @@ -268,7 +269,7 @@ def getCDDBValues(self): - offset of index 1 of each track - length of disc in seconds (including data track) - @rtype: list of int + :rtype: list of int """ offsets = [] @@ -320,8 +321,8 @@ def getCDDBDiscId(self): """ Calculate the CDDB disc ID. - @rtype: str - @returns: the 8-character hexadecimal disc ID + :rtype: str + :returns: the 8-character hexadecimal disc ID """ values = self.getCDDBValues() return "%08x" % int(values) @@ -330,8 +331,8 @@ def getMusicBrainzDiscId(self): """ Calculate the MusicBrainz disc ID. - @rtype: str - @returns: the 28-character base64-encoded disc ID + :rtype: str + :returns: the 28-character base64-encoded disc ID """ if self.mbdiscid: logger.debug('getMusicBrainzDiscId: returning cached %r', @@ -401,7 +402,7 @@ def getFrameLength(self, data=False): """ Get the length in frames (excluding HTOA) - @param data: whether to include the data tracks in the length + :param data: whether to include the data tracks in the length """ # the 'real' leadout, not offset by 150 frames if data: @@ -431,7 +432,7 @@ def _getMusicBrainzValues(self): - leadout of disc - offset of index 1 of each track - @rtype: list of int + :rtype: list of int """ # MusicBrainz disc id does not take into account data tracks @@ -470,13 +471,13 @@ def _getMusicBrainzValues(self): def cue(self, cuePath='', program='whipper'): """ - @param cuePath: path to the cue file to be written. If empty, + :param cuePath: path to the cue file to be written. If empty, will treat paths as if in current directory. Dump our internal representation to a .cue file content. - @rtype: C{unicode} + :rtype: unicode """ logger.debug('generating .cue for cuePath %r', cuePath) @@ -633,8 +634,8 @@ def setFile(self, track, index, path, length, counter=None): Assumes all indexes have an absolute offset and will raise if not. - @type track: C{int} - @type index: C{int} + :type track: int + :type index: int """ logger.debug('setFile: track %d, index %d, path %r, length %r, ' 'counter %r', track, index, path, length, counter) @@ -704,7 +705,7 @@ def merge(self, other, session=2): The other table is assumed to be from an additional session, - @type other: L{Table} + :type other: Table """ gap = self._getSessionGap(session) @@ -751,11 +752,11 @@ def getNextTrackIndex(self, track, index): """ Return the next track and index. - @param track: track number, 1-based + :param track: track number, 1-based - @raises IndexError: on last index + :raises IndexError: on last index - @rtype: tuple of (int, int) + :rtype: tuple of (int, int) """ t = self.tracks[track - 1] indexes = list(t.indexes) diff --git a/whipper/image/toc.py b/whipper/image/toc.py index 3d03d137..da175c16 100644 --- a/whipper/image/toc.py +++ b/whipper/image/toc.py @@ -104,10 +104,10 @@ def __init__(self): def append(self, counter, offset, source): """ - @param counter: the source counter; updates for each different + :param counter: the source counter; updates for each different data source (silence or different file path) - @type counter: int - @param offset: the absolute disc offset where this source starts + :type counter: int + :param offset: the absolute disc offset where this source starts """ logger.debug('appending source, counter %d, abs offset %d, ' 'source %r', counter, offset, source) @@ -138,7 +138,7 @@ class TocFile(object): def __init__(self, path): """ - @type path: unicode + :type path: unicode """ assert isinstance(path, unicode), "%r is not unicode" % path self._path = path @@ -380,7 +380,7 @@ def message(self, number, message): """ Add a message about a given line in the cue file. - @param number: line number, counting from 0. + :param number: line number, counting from 0. """ self._messages.append((number + 1, message)) @@ -412,7 +412,7 @@ def getRealPath(self, path): """ Translate the .toc's FILE to an existing path. - @type path: unicode + :type path: unicode """ return common.getRealPath(self._path, path) @@ -424,10 +424,10 @@ class File: def __init__(self, path, start, length): """ - @type path: C{unicode} - @type start: C{int} - @param start: starting point for the track in this file, in frames - @param length: length for the track in this file, in frames + :type path: unicode + :type start: int + :param start: starting point for the track in this file, in frames + :param length: length for the track in this file, in frames """ assert isinstance(path, unicode), "%r is not unicode" % path diff --git a/whipper/program/cdparanoia.py b/whipper/program/cdparanoia.py index 29d21760..6bc579d2 100644 --- a/whipper/program/cdparanoia.py +++ b/whipper/program/cdparanoia.py @@ -88,10 +88,10 @@ class ProgressParser: def __init__(self, start, stop): """ - @param start: first frame to rip - @type start: int - @param stop: last frame to rip (inclusive) - @type stop: int + :param start: first frame to rip + :type start: int + :param stop: last frame to rip (inclusive) + :type stop: int """ self.start = start self.stop = stop @@ -205,8 +205,6 @@ def getTrackQuality(self): class ReadTrackTask(task.Task): """ I am a task that reads a track using cdparanoia. - - @ivar reads: how many reads were done to rip the track """ description = "Reading track" @@ -221,22 +219,22 @@ def __init__(self, path, table, start, stop, overread, offset=0, """ Read the given track. - @param path: where to store the ripped track - @type path: unicode - @param table: table of contents of CD - @type table: L{table.Table} - @param start: first frame to rip - @type start: int - @param stop: last frame to rip (inclusive); >= start - @type stop: int - @param offset: read offset, in samples - @type offset: int - @param device: the device to rip from - @type device: str - @param action: a string representing the action; e.g. Read/Verify - @type action: str - @param what: a string representing what's being read; e.g. Track - @type what: str + :param path: where to store the ripped track + :type path: unicode + :param table: table of contents of CD + :type table: table.Table + :param start: first frame to rip + :type start: int + :param stop: last frame to rip (inclusive); >= start + :type stop: int + :param offset: read offset, in samples + :type offset: int + :param device: the device to rip from + :type device: str + :param action: a string representing the action; e.g. Read/Verify + :type action: str + :param what: a string representing what's being read; e.g. Track + :type what: str """ assert isinstance(path, unicode), "%r is not unicode" % path @@ -403,17 +401,16 @@ class ReadVerifyTrackTask(task.MultiSeparateTask): The path where the file is stored can be changed if necessary, for example if the file name is too long. - @ivar path: the path where the file is to be stored. - @ivar checksum: the checksum of the track; set if they match. - @ivar testchecksum: the test checksum of the track. - @ivar copychecksum: the copy checksum of the track. - @ivar testspeed: the test speed of the track, as a multiple of + :cvar checksum: the checksum of the track; set if they match. + :cvar testchecksum: the test checksum of the track. + :cvar copychecksum: the copy checksum of the track. + :cvar testspeed: the test speed of the track, as a multiple of track duration. - @ivar copyspeed: the copy speed of the track, as a multiple of + :cvar copyspeed: the copy speed of the track, as a multiple of track duration. - @ivar testduration: the test duration of the track, in seconds. - @ivar copyduration: the copy duration of the track, in seconds. - @ivar peak: the peak level of the track + :cvar testduration: the test duration of the track, in seconds. + :cvar copyduration: the copy duration of the track, in seconds. + :cvar peak: the peak level of the track """ checksum = None @@ -432,20 +429,20 @@ class ReadVerifyTrackTask(task.MultiSeparateTask): def __init__(self, path, table, start, stop, overread, offset=0, device=None, taglist=None, what="track"): """ - @param path: where to store the ripped track - @type path: str - @param table: table of contents of CD - @type table: L{table.Table} - @param start: first frame to rip - @type start: int - @param stop: last frame to rip (inclusive) - @type stop: int - @param offset: read offset, in samples - @type offset: int - @param device: the device to rip from - @type device: str - @param taglist: a dict of tags - @type taglist: dict + :param path: where to store the ripped track + :type path: str + :param table: table of contents of CD + :type table: table.Table + :param start: first frame to rip + :type start: int + :param stop: last frame to rip (inclusive) + :type stop: int + :param offset: read offset, in samples + :type offset: int + :param device: the device to rip from + :type device: str + :param taglist: a dict of tags + :type taglist: dict """ task.MultiSeparateTask.__init__(self) diff --git a/whipper/program/cdrdao.py b/whipper/program/cdrdao.py index b9b36874..f59ed383 100644 --- a/whipper/program/cdrdao.py +++ b/whipper/program/cdrdao.py @@ -69,12 +69,12 @@ def __init__(self, device, fast_toc=False, toc_path=None): """ Read the TOC for 'device'. - @param device: block device to read TOC from - @type device: str - @param fast_toc: If to use fast-toc cdrdao mode - @type fast_toc: bool - @param toc_path: Where to save TOC if wanted. - @type toc_path: str + :param device: block device to read TOC from + :type device: str + :param fast_toc: If to use fast-toc cdrdao mode + :type fast_toc: bool + :param toc_path: Where to save TOC if wanted. + :type toc_path: str """ self.device = device diff --git a/whipper/program/soxi.py b/whipper/program/soxi.py index 07b8f9a5..86a18235 100644 --- a/whipper/program/soxi.py +++ b/whipper/program/soxi.py @@ -13,7 +13,7 @@ class AudioLengthTask(ctask.PopenTask): """ I calculate the length of a track in audio samples. - @ivar length: length of the decoded audio file, in audio samples. + :cvar length: length of the decoded audio file, in audio samples. """ logCategory = 'AudioLengthTask' description = 'Getting length of audio track' @@ -21,7 +21,7 @@ class AudioLengthTask(ctask.PopenTask): def __init__(self, path): """ - @type path: unicode + :type path: unicode """ assert isinstance(path, unicode), "%r is not unicode" % path diff --git a/whipper/result/result.py b/whipper/result/result.py index 35af5804..7947730f 100644 --- a/whipper/result/result.py +++ b/whipper/result/result.py @@ -69,18 +69,18 @@ class RipResult: I hold information about the result for rips. I can be used to write log files. - @ivar offset: sample read offset - @ivar table: the full index table - @type table: L{whipper.image.table.Table} - @ivar metadata: disc metadata from MusicBrainz (if available) - @type metadata: L{whipper.common.mbngs.DiscMetadata} - - @ivar vendor: vendor of the CD drive - @ivar model: model of the CD drive - @ivar release: release of the CD drive - - @ivar cdrdaoVersion: version of cdrdao used for the rip - @ivar cdparanoiaVersion: version of cdparanoia used for the rip + :cvar offset: sample read offset + :cvar table: the full index table + :vartype table: whipper.image.table.Table + :cvar metadata: disc metadata from MusicBrainz (if available) + :vartype metadata: whipper.common.mbngs.DiscMetadata + + :cvar vendor: vendor of the CD drive + :cvar model: model of the CD drive + :cvar release: release of the CD drive + + :cvar cdrdaoVersion: version of cdrdao used for the rip + :cvar cdparanoiaVersion: version of cdparanoia used for the rip """ offset = 0 @@ -107,10 +107,10 @@ def __init__(self): def getTrackResult(self, number): """ - @param number: the track number (0 for HTOA) + :param number: the track number (0 for HTOA) - @type number: int - @rtype: L{TrackResult} + :type number: int + :rtype: TrackResult """ for t in self.tracks: if t.number == number: @@ -128,11 +128,11 @@ def log(self, ripResult, epoch=time.time()): """ Create a log from the given ripresult. - @param epoch: when the log file gets generated - @type epoch: float - @type ripResult: L{RipResult} + :param epoch: when the log file gets generated + :type epoch: float + :type ripResult: RipResult - @rtype: str + :rtype: str """ raise NotImplementedError @@ -153,7 +153,7 @@ def getLoggers(): """ Get all logger plugins with entry point 'whipper.logger'. - @rtype: dict of C{str} -> C{Logger} + :rtype: dict of :class:`str` -> :any:`Logger` """ d = {}