##// END OF EJS Templates
make InteractiveShell.banner a property
MinRK -
Show More
@@ -10,12 +10,7 b''
10 # the file COPYING, distributed as part of this software.
10 # the file COPYING, distributed as part of this software.
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12
12
13 #-----------------------------------------------------------------------------
13 from __future__ import absolute_import, print_function
14 # Imports
15 #-----------------------------------------------------------------------------
16
17 from __future__ import absolute_import
18 from __future__ import print_function
19
14
20 import __future__
15 import __future__
21 import abc
16 import abc
@@ -453,7 +448,6 b' class InteractiveShell(SingletonConfigurable):'
453 self.init_profile_dir(profile_dir)
448 self.init_profile_dir(profile_dir)
454 self.init_instance_attrs()
449 self.init_instance_attrs()
455 self.init_environment()
450 self.init_environment()
456 self.compute_banner()
457
451
458 # Check if we're in a virtualenv, and set up sys.path.
452 # Check if we're in a virtualenv, and set up sys.path.
459 self.init_virtualenv()
453 self.init_virtualenv()
@@ -788,18 +782,14 b' class InteractiveShell(SingletonConfigurable):'
788 # Things related to the banner
782 # Things related to the banner
789 #-------------------------------------------------------------------------
783 #-------------------------------------------------------------------------
790
784
791 def _banner1_changed(self):
785 @property
792 self.compute_banner()
786 def banner(self):
793
787 banner = self.banner1
794 def _banner2_changed(self):
795 self.compute_banner()
796
797 def compute_banner(self):
798 self.banner = self.banner1
799 if self.profile and self.profile != 'default':
788 if self.profile and self.profile != 'default':
800 self.banner += '\nIPython profile: %s\n' % self.profile
789 banner += '\nIPython profile: %s\n' % self.profile
801 if self.banner2:
790 if self.banner2:
802 self.banner += '\n' + self.banner2
791 banner += '\n' + self.banner2
792 return banner
803
793
804 def show_banner(self, banner=None):
794 def show_banner(self, banner=None):
805 if banner is None:
795 if banner is None:
General Comments 0
You need to be logged in to leave comments. Login now