~ubuntu-branches/debian/wheezy/quodlibet/wheezy

« back to all changes in this revision

Viewing changes to check.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2009-01-30 23:55:34 UTC
  • mto: (18.1.1 squeeze) (2.1.9 sid)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090130235534-45857nfsgobw4apc
Tags: upstream-2.0
ImportĀ upstreamĀ versionĀ 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# check.py -- check for system requirements
3
 
# public domain
4
 
 
5
 
import os
6
 
import sys
7
 
 
8
 
NAME = "Quod Libet"
9
 
 
10
 
if __name__ == "__main__":
11
 
    print "Checking Python version:",
12
 
    print ".".join(map(str, sys.version_info[:2]))
13
 
    if sys.version_info < (2, 4):
14
 
        raise SystemExit("%s requires at least Python 2.4. "
15
 
                         "(http://www.python.org)" % NAME)
16
 
 
17
 
    print "Checking for PyGTK >= 2.8:",
18
 
    try:
19
 
        import pygtk
20
 
        pygtk.require('2.0')
21
 
        import gtk
22
 
        if gtk.pygtk_version < (2, 8) or gtk.gtk_version < (2, 8):
23
 
            raise ImportError
24
 
    except ImportError:
25
 
        raise SystemExit("not found\n%s requires PyGTK 2.8. "
26
 
                         "(http://www.pygtk.org)" % NAME)
27
 
    else: print "found"
28
 
 
29
 
    print "Checking for PyGSt >= 0.10.1:",
30
 
    try:
31
 
        import pygst
32
 
        pygst.require("0.10")
33
 
        import gst
34
 
        if gst.pygst_version < (0, 10, 1):
35
 
            raise ImportError
36
 
    except ImportError:
37
 
        raise SystemExit("not found\n%s requires gst-python 0.10.1. "
38
 
                         "(http://gstreamer.freedesktop.org)" % NAME)
39
 
    else: print "found"
40
 
 
41
 
    print "Checking for Mutagen >= 1.9:",
42
 
    try:
43
 
        import mutagen
44
 
        if mutagen.version < (1, 9):
45
 
            raise ImportError
46
 
    except ImportError:
47
 
        raise SystemExit("not found\n%s requires Mutagen 1.9.\n"
48
 
                         "(http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen)" % NAME)
49
 
    else: print "found"
50
 
 
51
 
    print "Checking for ctypes:",
52
 
    try: import ctypes
53
 
    except ImportError:
54
 
        print ("not found\n%s recommends ctypes.\n"
55
 
               "\t(http://starship.python.net/crew/theller/ctypes/)" % NAME)
56
 
    else: print "found"
57
 
 
58
 
    print "\nYour system meets the requirements to install %s." % NAME
59
 
    print "Type 'make install' (as root) to install it."
60
 
    print "You may want to make some extensions first; see the README file."
61
 
 
62
 
    if sys.argv[1:] and os.path.isdir(sys.argv[1]):
63
 
        print "\nIt looks like you might have Quod Libet installed already."
64
 
        print "Installing directly over an old version is not supported."
65
 
        print "Please remove %s before continuing." % sys.argv[1]