gavo.helpers.copying module

Helpers for pulling data from CDs, DVDs and similar media.

class gavo.helpers.copying.CDHandler(devPath, mountPath)[source]

Bases: object

A wrapper for mounting and ejecting CDs.

This assumes that you let users mount CDs, e.g. via a line like

/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0

in /etc/fstab. In this example, devPath would be /dev/scd0 and mountPath /media/cdrom0.

ejectMedium()[source]

ejects the current CD.

isMounted()[source]
mediumChanged()[source]

returns True if there’s a new medium available.

mount()[source]
unmount()[source]
gavo.helpers.copying.changeCD(cdHandler)[source]
gavo.helpers.copying.readCDs(destBase, cdHandler)[source]

runs a crude UI to read CDs in batch.

The idea is that you get a copy-in script by writing something like

import os from gavo import api

rd = api.getRD(“foo/bar”) cd = CDHandler(“/dev/cdrom”, “mnt/cd”) copying.readCDs(os.path.join(rd.resdir, “raw”), cd)