Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

CDLibrary - a driver to Dacal CD Library 2 devices

Copyright: 2009 by Florian Boesch
license:GNU GPL3

This Driver allows you to access CD Library 2 devices connected on the USB ports either via http or the filesystem

Copyright (C) 2009 Florian Boesch <pyalot@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Features

  • plug&play recognizes connected devices
  • list unique device ids
  • open specified slots
  • retract slots

Install

cdlibrary console is a python package installable by any of the following commands: command line:

cd cdlibrary; python setup.py install
easy_install cdlibrary
easy_install http://hg.codeflow.org/cdlibrary/archive/tip.tar.gz

Once you have the package installed (as root) you need to add a daemon script: command line:

sudo su -
wget http://hg.codeflow.org/cdlibrary/archive/tip.tar.gz
tar xzvf tip.tar.gz
cp cdlibrary-*/cdlibd /etc/init.d
update-rc.d -f cdlibd defaults

you can also use the code below as a start script: code:

import sys
from cdlibrary import http, filesystem

daemon = filesystem.daemon
#daemon = http.daemon

if __name__ == '__main__':
    command = sys.argv[1]
    if command == 'start':
        daemon.start()
    elif command == 'stop':
        daemon.stop()
    elif command ==  'restart':
        daemon.stop()
        daemon.start()
    elif command == 'debug':
        daemon.debug()

Usage

command line:

/etc/init.d/cdlibd start|stop|restart|debug

HTTP interface

File System Interface

  • ls /mnt/cdlibrary --> lists the device IDs as directory listing
  • echo 123 > /mnt/cdlibrary/<device-id> --> opens slot 123
  • echo close > /mnt/cdlibrary/<device-id> --> closes the slot of this device

Recent activity

Nothing to see here, move along.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.