File: check.py

package info (click to toggle)
listen 0.4.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,520 kB
  • ctags: 1,629
  • sloc: python: 12,303; ansic: 224; makefile: 87; sh: 10
file content (112 lines) | stat: -rwxr-xr-x 3,352 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env python
# check.py -- check for system requirements
# public domain
NAME = "Listen"

import sys

if __name__ == "__main__":

    print "Checking Python version:",
    print ".".join(map(str, sys.version_info[:2]))
    if sys.version_info <= (2, 4):
        raise SystemExit("%s requires at least Python 2.4."
                         "(http://www.python.org)" % NAME)

    print "Checking for PyGTK >= 2.6:",
    try:
        import pygtk
        pygtk.require('2.0')
        import gtk
        if gtk.pygtk_version < (2, 6) or gtk.gtk_version < (2, 6):
            raise ImportError
    except ImportError:
        raise SystemExit("not found\n%s requires PyGTK 2.6. "
                         "(http://www.pygtk.org)" % NAME)
    else: print "found"

    print "Checking for pyGTK-devel >= 2.6",
    try:
        import os
        s = "pygtk-codegen-2.0"
        for p in os.environ["PATH"].split(os.path.pathsep):
            p2 = os.path.join(p, s)
            if os.path.exists(p2):
                break
        else: raise ImportError
    except ImportError:
        raise SystemExit("not found\n%s requires pyGTK-devel" % NAME)
    else: print "found"

    print "Checking for gnome.ui;",
    try:
        import gnome,gnome.ui
    except ImportError:
        raise SystemExit("not found\n%s require python-gnome (http://www.gnome.org)" % NAME)
    else: print "found"

    print "Checking for egg.trayicon:",
    try: import egg.trayicon
    except ImportError:
        raise SystemExit("not found\n%s require gnome-python-extras.\n"
				                   "\t(http://ftp.gnome.org/pub/GNOME/sources/gnome-python-extras)" % NAME)
    else: print "found"
    print "Checking for ogg.vorbis:",
    try: import ogg.vorbis
    except ImportError:
        raise SystemExit ("not found\n%s recommends libvorbis/pyvorbis. "
               "(http://www.andrewchatham.com/pyogg/)" % NAME)
    else: print "found"

    print "Checking for MAD:",
    try: import mad
    except ImportError:
        raise SystemExit ("not found\n%s require MAD/pymad. "
               "(http://www.mars.org/home/rob/proj/mpeg/)" % NAME)
    else: print "found"


    print "Checking for ctypes:",
    try: import ctypes
    except ImportError:
           print ("not found\n%s recommends python ctypes for mp4 & m4a support. " % NAME)
    else: print "found"


    print "Checking for DBUS:",
    try: import dbus
    except ImportError:
        print ("not found\n%s dbus recommanded. " % NAME)
    else: print "found"

    print "Checking for PySqlite2:",# >= 2.3.0
    try:
        import pysqlite2
    except:
        raise SystemExit("not found\n%s requires PySqlite2 . "
                         "(http://initd.org/tracker/pysqlite)" % NAME)
    else: print "found"

    print "Checking for PyGSt >= 0.10:",
    try:
        import pygst
        pygst.require("0.10")
        import gst
        if gst.pygst_version < (0, 10, 1):
            raise ImportError
    except ImportError:
        raise SystemExit("not found\n%s requires PyGst 0.10 "
                         "(http://gstreamer.freedesktop.org)" % NAME)
    else: print "found"

    print "Checking for python-libgpod:",
    try:
        import gpod
    except ImportError:
        print ("not found\n%s recommends python-gpod (http://www.gtkpod.org)" % NAME)
    else: print "found"