File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 41
41
shell : bash -l {0}
42
42
run : |
43
43
python setup.py install
44
+ which yeadon
44
45
yeadon -h
Original file line number Diff line number Diff line change 23
23
tests_require = ['nose>=1.3.7' ],
24
24
test_suite = 'nose.collector' ,
25
25
include_package_data = True ,
26
- entry_points = {'console_scripts' : ['yeadon = yeadon.app' ]},
26
+ entry_points = {'console_scripts' : ['yeadon= yeadon.app:run ' ]},
27
27
classifiers = [
28
28
'Development Status :: 5 - Production/Stable' ,
29
29
'Intended Audience :: Science/Research' ,
Original file line number Diff line number Diff line change 2
2
3
3
"""Runs the GUI or the UI. The UI is a fallback if MayaVi is not installed."""
4
4
5
- if __name__ == '__main__' :
5
+ import argparse
6
+
6
7
7
- import argparse
8
+ def run ():
8
9
9
- parser = argparse .ArgumentParser (description = 'Yeadon command line options.' )
10
+ parser = argparse .ArgumentParser (
11
+ description = 'Yeadon command line options.' )
10
12
11
13
parser .add_argument ('-g' , '--gui' , action = "store_true" ,
12
- help = 'Runs the graphical user interface.' )
14
+ help = 'Runs the graphical user interface.' )
13
15
14
16
parser .add_argument ('-u' , '--ui' , action = "store_true" ,
15
- help = 'Runs the text based user interface.' )
17
+ help = 'Runs the text based user interface.' )
16
18
17
19
args = parser .parse_args ()
18
20
19
21
try :
20
22
import mayavi
21
23
except ImportError :
22
- print ("MayaVi is not installed, resorting to text based user interface." )
24
+ print ("MayaVi is not installed, resorting to text based user "
25
+ "interface." )
23
26
has_mayavi = False
24
27
else :
25
28
del mayavi
26
29
has_mayavi = True
27
30
28
- if args .ui == True or has_mayavi == False :
31
+ if args .ui or not has_mayavi :
29
32
from yeadon .ui import start_ui
30
33
start_ui ()
31
34
else :
32
35
from yeadon .gui import start_gui
33
36
start_gui ()
37
+
38
+
39
+ if __name__ == '__main__' :
40
+ run ()
You can’t perform that action at this time.
0 commit comments