File: jack_init.py

package info (click to toggle)
jack 3.1.1+cvs20050801-31
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,316 kB
  • sloc: python: 6,358; ansic: 1,910; makefile: 6; sh: 5
file content (66 lines) | stat: -rw-r--r-- 1,976 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
### jack_init sanity check and initialization of various modules for
### jack - extract audio from a CD and encode it using 3rd party software
### Copyright (C) 2002-2003  Arne Zellentin <zarne@users.sf.net>

### 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 2 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, write to the Free Software
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

import os
import string
import sys

from jack_generic import *
from jack_globals import *

try:
    from fcntl import F_SETFL
except:
    from FCNTL import F_SETFL

try:
    from os import O_NONBLOCK
except:
    from FCNTL import O_NONBLOCK

try:
    import eyed3.id3
except:
    print "Please install the eyeD3 module available from http://eyed3.nicfit.net/"
    sys.exit(1)

try:
    import cdrom
except:
    print "Please install the CDDB module available at http://cddb-py.sourceforge.net"
    print "Without it, you'll not be able to rip from CDs."

    # want to see my favorite ugly hack of the day?
    class dummy_cdrom:
        def __init__(self):
            pass
        def open(self, dummy=None):
            print "Cannot access cdrom device while the CDDB module is not installed. See above."
            sys.exit(1)
    cdrom = dummy_cdrom()

try:
    import ogg.vorbis
except:
    warning("ogg module not installed, ogg support disabled")
    ogg = None

try:
    import mutagen.flac as flac
except ImportError:
    flac = None