File: depcheck.py

package info (click to toggle)
scribes 0.3.3.3-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,512 kB
  • ctags: 4,045
  • sloc: python: 24,125; sh: 3,358; xml: 2,224; makefile: 255
file content (84 lines) | stat: -rw-r--r-- 2,209 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
#! /usr/bin/env python
# -*- coding: utf8 -*-

def check_dependencies():
	"""
	Perform dependency checks for Scribes.
	"""
	try:
		# Check for D-Bus Python Bindings.
		try:
			import dbus
			if dbus.version < (0, 70, 0):
				raise AssertionError
			print "Checking for D-Bus (Python Bindings)... yes"
		except ImportError:
			print "Error: Python bindings for D-Bus was not found."
			raise SystemExit
		except AssertionError:
			print "Error: Version 0.70 or better of dbus-python needed."
			raise SystemExit
		# Check for Pygobject.
		try:
			import gobject
			print "Checking for Pygobject... yes"
		except ImportError:
			print "Error: pygobject was not found."
			raise SystemExit
		# Check for GTK.
		try:
			import gtk
			if gtk.gtk_version < (2, 10, 0):
				raise AssertionError
			print "Checking for GTK... yes"
		except ImportError:
			print "Error: GTK was not found."
			raise SystemExit
		except AssertionError:
			print "Error: Version 2.10.0 or better of GTK needed."
			raise SystemExit
		# Check for PyGTK.
		try:
			import gtk
			if gtk.pygtk_version < (2, 10, 0):
				raise AssertionError
			print "Checking for PyGTK... yes"
		except ImportError:
			print "Error: PyGTK was not found."
			raise SystemExit
		except AssertionError:
			print "Error: Version 2.10.0 or better of PyGTK needed."
			raise SystemExit
			
		# Check for GNOME Python.
		try:
			import gnome
			if gnome.gnome_python_version < (2, 12, 0):
				raise AssertionError
			print "Checking for GNOME Python... yes"
		except ImportError:
			print "Error: gnome-python was not found."
			raise SystemExit
		except AssertionError:
			print "Error: Version 2.12.0 or better of gnome-python needed."
			raise SystemExit
		# Check for GNOME Python Desktop.
		try:
			import gtksourceview
			print "Checking for GNOME Python Desktop... yes"
		except ImportError:
			print "Error: gnome-python-desktop was not found."
			raise SystemExit
		# Check for GNOME Python Extras.
		try:
			import gtkspell
			print "Checking for GNOME Python Extras... yes"
		except ImportError:
			print "Error: gnome-python-extras was not found."
			raise SystemExit
	except SystemExit:
		from sys import exit
		exit(1)
	return

check_dependencies()