main.py (8126:5138d1e453f1) main.py (8219:0e2333b86562)
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 114 unchanged lines hidden (view full) ---

123# default options
124options_file = config.get('options.py')
125if options_file:
126 scope = { 'options' : options }
127 execfile(options_file, scope)
128
129arguments = options.parse_args()
130
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 114 unchanged lines hidden (view full) ---

123# default options
124options_file = config.get('options.py')
125if options_file:
126 scope = { 'options' : options }
127 execfile(options_file, scope)
128
129arguments = options.parse_args()
130
131def interact(scope):
132 banner = "M5 Interactive Console"
133 sys.argv = []
134 try:
135 from IPython.Shell import IPShellEmbed
136 ipshell = IPShellEmbed(banner=banner,user_ns=scope)
137 ipshell()
138 except ImportError:
139 code.InteractiveConsole(scope).interact(banner)
140
131def main():
132 import core
133 import debug
134 import defines
135 import event
136 import info
137 import stats
138 import trace

--- 205 unchanged lines hidden (view full) ---

344 while t.tb_next is not None:
345 t = t.tb_next
346 pdb.interaction(t.tb_frame,t)
347 else:
348 exec filecode in scope
349
350 # once the script is done
351 if options.interactive:
141def main():
142 import core
143 import debug
144 import defines
145 import event
146 import info
147 import stats
148 import trace

--- 205 unchanged lines hidden (view full) ---

354 while t.tb_next is not None:
355 t = t.tb_next
356 pdb.interaction(t.tb_frame,t)
357 else:
358 exec filecode in scope
359
360 # once the script is done
361 if options.interactive:
352 banner = "M5 Interactive Console"
353 try:
354 from IPython.Shell import IPShellEmbed
355 ipshell = IPShellEmbed(banner=banner,user_ns=scope)
356 ipshell()
357 except ImportError:
358 code.InteractiveConsole(scope).interact(banner)
362 interact(scope)
359
360if __name__ == '__main__':
361 from pprint import pprint
362
363 print 'opts:'
364 pprint(options, indent=4)
365 print
366
367 print 'args:'
368 pprint(arguments, indent=4)
363
364if __name__ == '__main__':
365 from pprint import pprint
366
367 print 'opts:'
368 pprint(options, indent=4)
369 print
370
371 print 'args:'
372 pprint(arguments, indent=4)