chiark / gitweb /
Make the power module an optional dependency
[cura.git] / scripts / linux / cura.py
1 #!/usr/bin/python
2
3 import os, sys
4
5 sys.path.insert(1, os.path.dirname(__file__))
6
7 try:
8         import OpenGL
9         import wx
10         import serial
11         import numpy
12         import power
13 except ImportError as e:
14         if e.message[0:16] == 'No module named ':
15                 module = e.message[16:]
16
17                 if module == 'OpenGL':
18                         module = 'PyOpenGL'
19                 elif module == 'serial':
20                         module = 'pyserial'
21                 print 'Requires ' + module
22
23                 if module == 'power':
24                         print "Install from: https://github.com/GreatFruitOmsk/Power"
25                 else:
26                         print "Try sudo easy_install " + module
27                 print e.message
28     
29         exit(1)
30
31
32 import Cura.cura as cura
33
34 cura.main()