ravenc package

Submodules

ravenc.command module

class ravenc.command.Command(path, *args, **kwds)

Bases: builtins.object

add_options(*args)
gen_command()

Returns a list of strings which represent a subprocess command suitable for feeding into subprocess.Popen as the args parameter.

Returns:list of strings
Return type:list
exception ravenc.command.CommandError(command, errstr='')

Bases: builtins.Exception

exception ravenc.command.CommandMissingError(command, errstr='Missing')

Bases: ravenc.command.CommandError

class ravenc.command.Commands(*command_list)

Bases: builtins.object

add_command(command, comclass=<class 'ravenc.command.Command'>)
make_command(command, *args, **kwargs)
register_command_class(com, comclass)
class ravenc.command.Options(*args, sep=' ')

Bases: builtins.list

gen_options()

ravenc.dvd module

dvd.py - Basic DVD routines.

Routines to detect DVD changes, to read the DVD contents and to hold the DVD data.

class ravenc.dvd.DVDTreeModel(parent=None)

Bases: PyQt4.QtCore.QAbstractItemModel

A tree model for a Qt Tree widget. Represents a list of DVD nodes with title nodes underneath each DVD showing the length of the title.

Parameters:parent (PyQt4.QtCore.QObject) – parent object
canFetchMore(parent)
columnCount(parent)

Necessary override. Returns the number of columns for the children of the given parent.

Parameters:parent (PyQt4.QtCore.QModelIndex) – parent row
Returns:Number of columns
Return type:int
data(index, role)

Necessary override. Returns the data stored under the given role for the item referred to by the index.

Parameters:
  • index (PyQt4.QtCore.QModelIndex) – Row index
  • role (PyQt4.QtCore.Qt.DisplayRole) – Display role
Returns:

Data for the given index and role

Return type:

PyQt4.QtCore.QVariant

fetchMore(parent)
findDVD(devpath)

Find the DVD position in the data tree from its device path, e.g. /dev/sr0.

Parameters:devpath (str) – The device path of the DVD to find
Returns:The row of the DVD in the data tree
Return type:int
flags(index)

Necessary override. Returns the item flags for the given index.

Parameters:index (PyQt4.QtCore.QModelIndex) – Row index
Returns:Returns the item flags
Return type:PyQt4.QtCore.Qt.QItemFlags
getNode(index)

Returns the underlying node from an index. If the index is invalid then return the root node.

Parameters:index (PyQt4.QtCore.QModelIndex) – Row index
Returns:The node at index
Return type:ravenc.utils.Node
hasChildren(parent)
headerData(section, orientation, role)

Necessary override. Returns the data for the given role and section in the header with the specified orientation.

Parameters:
  • section (int) – Column Number
  • orientation (PyQt4.QtCore.Qt.Orientation) – Orientation
  • role (PyQt4.QtCore.Qt.DisplayRole) – Display Role
index(row, column, parent)

Necessary override. Return a QModelIndex that corresponds to the given row, column and parent node.

Parameters:
  • row (int) – Row number
  • column (int) – Coloumn number
Returns:

Returns the index of the item

Return type:

PyQt4.QtCore.QModelIndex

insertDVD(device)

Actions to take when a DVD is inserted:

  1. Start lsdvd
  2. Insert the DVD node into the model tree
Parameters:device (pyudev.Device) – The device in which the DVD is inserted
Returns:If inserting into the tree was successful
Return type:bool
insertDirs(parent, dirs)
insertFiles(parent, files)
insertTracks(tracklist, parent)

Insert a list of titles into the data tree under a DVD node.

Parameters:
  • tracklist (list) – A list of dicts as returned by lsdvd represstr(track[‘ix’])enting each title
  • parent (ravenc.utils.Node) – The parent DVD node under which these titles will be added
Returns:

Success of insert

Return type:

bool

lsdvddata

Signal emitted when lsdvd returns data.

on_device_changed(dev)

Slot method. Actions to take when udev signals a device change.

Parameters:dev (pyudev.Device) – The device which has changed
on_lsdvd_data(lsdvd)

Slot method. Receive data from lsdvd. Add the data to the associated DVD node.

Parameters:
  • device (pyudev.Device) – The device from which the data was read
  • lsdvd (dict) – The output from lsdvd
parent(index)

Necessary override. Returns the parent of the node with the given QModelIndex.

Parameters:index (PyQt4.QtCore.QModelIndex) – Row index
Returns:Returns parent of the node
Return type:PyQt4.QtCore.QObject
removeDVD(position)

Remove a DVD node from the data tree.

Parameters:position (int) – The DVD to remove
Returns:Success of removal
Return type:bool
rowCount(parent)

Necessary override. Returns the number of rows under the given parent.

Parameters:parent (PyQt4.QtCore.QModelIndex) – parent row
Returns:Number of rows
Return type:int
class ravenc.dvd.DVD_Drive(device, lsdvd=None, parent=None)

Bases: ravenc.utils.Node

DVD node for the Qt abstract data model. For use in the Tree Widget.

Parameters:
class ravenc.dvd.Directory(name, path, parent=None)

Bases: ravenc.utils.Node

class ravenc.dvd.DvdTimeDelta

Bases: datetime.timedelta

class ravenc.dvd.File(name, path, parent=None)

Bases: ravenc.utils.Node

stream_data()
streams
class ravenc.dvd.LsDvd(device, datasig)

Bases: threading.Thread

Thread class to run the lsdvd command. Data is returned via a signal.

Parameters:
  • device (str) – device node of DVD e.g. /dev/sr0
  • datasig (unbound_signal) – signal to use for return data
run()

Start the lsdvd thread. Emits datasig on completion.

class ravenc.dvd.Track(track, parent=None)

Bases: ravenc.utils.Node

Title node for the Qt abstract data model. For use in the Tree Widget.

Parameters:
  • name (str) – the name of the title
  • length (str) – time length of the title
  • parent (ravenc.utils.Node) – parent node
stream_data()
unique_id

ravenc.encoders module

class ravenc.encoders.Avconv(path, *args, **kwds)

Bases: ravenc.encoders.CommandWithOutfile

gen_command()
class ravenc.encoders.CommandWithOutfile(path, *args, **kwds)

Bases: ravenc.command.Command

gen_command()
class ravenc.encoders.Mplayer(path, *args, **kwds)

Bases: ravenc.encoders.CommandWithOutfile

ravenc.forms module

class ravenc.forms.AudioCombo(parent=None)

Bases: PyQt4.QtGui.QComboBox

class ravenc.forms.AudioGroup(title, stream, parent, checked=False)

Bases: ravenc.forms.CodecGroup

make_audio_opts(stream_num)
make_map_opt()
class ravenc.forms.AverageDeque

Bases: collections.deque

BUFLEN = 64
average
pop()
push(value)
class ravenc.forms.BitrateLineEdit(contents='', parent=None)

Bases: PyQt4.QtGui.QLineEdit

class ravenc.forms.BitrateValidator(parent=None)

Bases: PyQt4.QtGui.QRegExpValidator

class ravenc.forms.CodecGroup(title, ctype, stream, parent, checked=False)

Bases: PyQt4.QtGui.QGroupBox

make_map_opt()
class ravenc.forms.CropDetect(datasig, stream)

Bases: threading.Thread

run()
samples = 5
class ravenc.forms.H264Dialog(parent=None, retval=None)

Bases: PyQt4.QtGui.QDialog

accept()
reject()
class ravenc.forms.QualityBar(parent=None)

Bases: PyQt4.QtGui.QProgressBar

MAX = 310
MID = 150
setValue(value)
class ravenc.forms.SourceTreeView

Bases: PyQt4.QtGui.QTreeView

rowsInserted(index, start, end)
class ravenc.forms.SpinBox(value=0, parent=None)

Bases: PyQt4.QtGui.QSpinBox

class ravenc.forms.SubtitleCombo(parent=None)

Bases: PyQt4.QtGui.QComboBox

codecs = {'XSUB': 'xsub', 'Copy': 'copy', 'DVB subtitles': 'dvbsub', 'SSA (SubStation Alpha)': 'ssa', 'DVD subtitles': 'dvdsub'}
class ravenc.forms.SubtitleGroup(title, stream, parent, checked=False)

Bases: ravenc.forms.CodecGroup

make_map_opt()
make_subt_opts(stream_num)
class ravenc.forms.VideoCombo(parent=None)

Bases: PyQt4.QtGui.QComboBox

class ravenc.forms.VideoGroup(title, stream, parent, checked=False)

Bases: ravenc.forms.CodecGroup

codec_dialog()
cropdata
make_map_opt()
make_scale_opts(codecgroup)
make_video_opts(stream_num)
on_crop_data(croplist)
on_cropdetect_clicked()
ravenc.forms._generate_codecs()

ravenc.ravenc module

ravenc.ravenc.run()

ravenc.utils module

class ravenc.utils.FileAdaptor(source, filedata)

Bases: builtins.object

class ravenc.utils.FileSource(node)

Bases: ravenc.utils.SourceBase

length
path
stream_data
title
track_number
unique_id
class ravenc.utils.Node(name=None, parent=None)

Bases: builtins.object

addChild(child)
child(row)
childCount()
insertChild(position, child)
name
parent
removeChild(position)
row()
typeinfo
class ravenc.utils.Singleton

Bases: builtins.type

class ravenc.utils.SourceBase(source)

Bases: builtins.object

length
path
title
unique_id
class ravenc.utils.TrackAdaptor(source, device=None)

Bases: builtins.object

class ravenc.utils.TrackSource(node)

Bases: ravenc.utils.SourceBase

length
path
stream_data
title
track_number
unique_id

Module contents

This is the Baserip package.

The alkali version of acidrip, a desktop utility to make ripping DVDs easy.