@@ -1499,7 +1499,8 @@ def curses_wrapper(func, *args, **kwargs):
14991499 curses .endwin ()
15001500
15011501
1502- def main_curses (scr , args , config , interactive = True , locals_ = None ):
1502+ def main_curses (scr , args , config , interactive = True , locals_ = None ,
1503+ banner = None ):
15031504 """main function for the curses convenience wrapper
15041505
15051506 Initialise the two main objects: the interpreter
@@ -1553,6 +1554,9 @@ def main_curses(scr, args, config, interactive=True, locals_=None):
15531554 curses .raw (False )
15541555 return repl .getstdout ()
15551556
1557+ if banner is not None :
1558+ repl .write (banner )
1559+ repl .write ('\n ' )
15561560 repl .repl ()
15571561 if config .hist_length :
15581562 histfilename = os .path .expanduser (config .hist_file )
@@ -1570,7 +1574,7 @@ def main_curses(scr, args, config, interactive=True, locals_=None):
15701574 return repl .getstdout ()
15711575
15721576
1573- def main (args = None , locals_ = None ):
1577+ def main (args = None , locals_ = None , banner = None ):
15741578 global stdscr
15751579
15761580 setlocale (LC_ALL , '' )
@@ -1584,7 +1588,8 @@ def main(args=None, locals_=None):
15841588
15851589 try :
15861590 o = curses_wrapper (main_curses , exec_args , config ,
1587- options .interactive , locals_ )
1591+ options .interactive , locals_ ,
1592+ banner = banner )
15881593 finally :
15891594 sys .stdin = orig_stdin
15901595 sys .stderr = orig_stderr
0 commit comments