Show More
@@ -22,27 +22,32 b' def main():' | |||||
22 | """ |
|
22 | """ | |
23 | # Parse command line arguments. |
|
23 | # Parse command line arguments. | |
24 | parser = ArgumentParser() |
|
24 | parser = ArgumentParser() | |
25 | parser.add_argument('-r', '--rich', action='store_true', |
|
25 | kgroup = parser.add_argument_group('kernel options') | |
26 | help='use a rich text frontend') |
|
26 | kgroup.add_argument('-e', '--existing', action='store_true', | |
27 | parser.add_argument('-t', '--tab-simple', action='store_true', |
|
|||
28 | help='do tab completion ala a Unix terminal') |
|
|||
29 |
|
||||
30 | parser.add_argument('--existing', action='store_true', |
|
|||
31 | help='connect to an existing kernel') |
|
27 | help='connect to an existing kernel') | |
32 |
|
|
28 | kgroup.add_argument('--ip', type=str, default=LOCALHOST, | |
33 | help='set the kernel\'s IP address [default localhost]') |
|
29 | help='set the kernel\'s IP address [default localhost]') | |
34 |
|
|
30 | kgroup.add_argument('--xreq', type=int, metavar='PORT', default=0, | |
35 | help='set the XREQ channel port [default random]') |
|
31 | help='set the XREQ channel port [default random]') | |
36 |
|
|
32 | kgroup.add_argument('--sub', type=int, metavar='PORT', default=0, | |
37 | help='set the SUB channel port [default random]') |
|
33 | help='set the SUB channel port [default random]') | |
38 |
|
|
34 | kgroup.add_argument('--rep', type=int, metavar='PORT', default=0, | |
39 | help='set the REP channel port [default random]') |
|
35 | help='set the REP channel port [default random]') | |
40 |
|
36 | |||
41 |
group = |
|
37 | egroup = kgroup.add_mutually_exclusive_group() | |
42 | group.add_argument('--pure', action='store_true', help = \ |
|
38 | egroup.add_argument('--pure', action='store_true', help = \ | |
43 | 'use a pure Python kernel instead of an IPython kernel') |
|
39 | 'use a pure Python kernel instead of an IPython kernel') | |
44 | group.add_argument('--pylab', action='store_true', |
|
40 | egroup.add_argument('--pylab', action='store_true', | |
45 | help='use a kernel with PyLab enabled') |
|
41 | help='use a kernel with PyLab enabled') | |
|
42 | ||||
|
43 | wgroup = parser.add_argument_group('widget options') | |||
|
44 | wgroup.add_argument('--paging', type=str, default='inside', | |||
|
45 | choices = ['inside', 'hsplit', 'vsplit', 'none'], | |||
|
46 | help='set the paging style [default inside]') | |||
|
47 | wgroup.add_argument('--rich', action='store_true', | |||
|
48 | help='enable rich text support') | |||
|
49 | wgroup.add_argument('--tab-simple', action='store_true', | |||
|
50 | help='do tab completion ala a Unix terminal') | |||
46 |
|
51 | |||
47 | args = parser.parse_args() |
|
52 | args = parser.parse_args() | |
48 |
|
53 | |||
@@ -70,11 +75,11 b' def main():' | |||||
70 | app = QtGui.QApplication([]) |
|
75 | app = QtGui.QApplication([]) | |
71 | if args.pure: |
|
76 | if args.pure: | |
72 | kind = 'rich' if args.rich else 'plain' |
|
77 | kind = 'rich' if args.rich else 'plain' | |
73 | widget = FrontendWidget(kind=kind) |
|
78 | widget = FrontendWidget(kind=kind, paging=args.paging) | |
74 | elif args.rich: |
|
79 | elif args.rich: | |
75 | widget = RichIPythonWidget() |
|
80 | widget = RichIPythonWidget(paging=args.paging) | |
76 | else: |
|
81 | else: | |
77 | widget = IPythonWidget() |
|
82 | widget = IPythonWidget(paging=args.paging) | |
78 | widget.gui_completion = not args.tab_simple |
|
83 | widget.gui_completion = not args.tab_simple | |
79 | widget.kernel_manager = kernel_manager |
|
84 | widget.kernel_manager = kernel_manager | |
80 | widget.setWindowTitle('Python' if args.pure else 'IPython') |
|
85 | widget.setWindowTitle('Python' if args.pure else 'IPython') |
General Comments 0
You need to be logged in to leave comments.
Login now