[Idle-dev] CVS: idle Bindings.py,1.14,1.15 EditorWindow.py,1.45,1.46 NEWS.txt,1.7,1.8 config-main.def,1.12,1.13 configDialog.py,1.50,1.51 configHandler.py,1.28,1.29 configHelpSourceEdit.py,1.4,1.5 configSectionNameDialog.py,1.3,1.4

Kurt B. Kaiser kbk@users.sourceforge.net
Tue, 14 Jan 2003 14:03:34 -0800


Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv19696

Modified Files:
	Bindings.py EditorWindow.py NEWS.txt config-main.def 
	configDialog.py configHandler.py configHelpSourceEdit.py 
	configSectionNameDialog.py 
Log Message:
M Bindings.py
M EditorWindow.py
M NEWS.txt
M config-main.def
M configDialog.py
M configHandler.py
M configHelpSourceEdit.py
M configSectionNameDialog.py

- Change default: IDLE now starts with Python Shell.

- Removed the File Path from the Additional Help Sources scrolled list.

- Add capability to access Additional Help Sources on the web if the
  Help File Path begins with //http or www.  (Otherwise local path is
  validated, as before.)

- Additional Help Sources were not being posted on the Help menu in the
  order entered.  Implement sorting the list by [HelpFiles] 'option'
  number.

- Add Browse button to New Help Source dialog.  Arrange to start in
  Python/Doc if platform is Windows, otherwise start in current directory.

- Put the Additional Help Sources directly on the Help menu instead of in
  an Extra Help cascade menu.  Rearrange the Help menu so the Additional
  Help Sources come last.  Update help.txt appropriately.

- Fix Tk root pop-ups in configSectionNameDialog.py  and configDialog.py


Index: Bindings.py
===================================================================
RCS file: /cvsroot/idlefork/idle/Bindings.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Bindings.py	4 Jan 2003 01:43:53 -0000	1.14
--- Bindings.py	14 Jan 2003 22:03:31 -0000	1.15
***************
*** 66,79 ****
    ]),
   ('options', [
!    ('_Configure Idle...', '<<open-config-dialog>>'),
     None,
     ('Revert to _Default Settings', '<<revert-all-settings>>'),
    ]),
   ('help', [
!    ('_IDLE Help...', '<<help>>'),
!    ('Python _Documentation...', '<<python-docs>>'),
!    ('View IDLE _Readme...', '<<view-readme>>'),
     None,
!    ('_About IDLE...', '<<about-idle>>'),
    ]),
  ]
--- 66,79 ----
    ]),
   ('options', [
!    ('_Configure IDLE...', '<<open-config-dialog>>'),
     None,
     ('Revert to _Default Settings', '<<revert-all-settings>>'),
    ]),
   ('help', [
!    ('_About IDLE', '<<about-idle>>'),
!    ('IDLE _Readme', '<<view-readme>>'),   
     None,
!    ('_IDLE Help', '<<help>>'),
!    ('Python _Docs', '<<python-docs>>'),
    ]),
  ]

Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** EditorWindow.py	10 Jan 2003 21:25:20 -0000	1.45
--- EditorWindow.py	14 Jan 2003 22:03:31 -0000	1.46
***************
*** 248,253 ****
              mbar.add_cascade(label=label, menu=menu, underline=underline)
          self.fill_menus()
!         #create the ExtraHelp menu, if required
!         self.ResetExtraHelpMenu()
  
      def postwindowsmenu(self):
--- 248,253 ----
              mbar.add_cascade(label=label, menu=menu, underline=underline)
          self.fill_menus()
!         self.base_helpmenu_length = self.menudict['help'].index(END)
!         self.reset_help_menu_entries()
  
      def postwindowsmenu(self):
***************
*** 316,320 ****
  
      def display_docs(self, url):
!         url = os.path.normpath(url)
          if sys.platform.count('win') or sys.platform.count('nt'):
              os.startfile(url)
--- 316,321 ----
  
      def display_docs(self, url):
!         if not (url.startswith('www') or url.startswith('http')):
!             url = os.path.normpath(url)
          if sys.platform.count('win') or sys.platform.count('nt'):
              os.startfile(url)
***************
*** 531,557 ****
                              #print 'accel now:',accel,'\n'
  
!     def ResetExtraHelpMenu(self):
!         "Load or update the Extra Help menu if required"
!         menuList=idleConf.GetAllExtraHelpSourcesList()
!         helpMenu=self.menudict['help']
!         cascadeIndex=helpMenu.index(END)-1
!         if menuList:
!             if not hasattr(self,'menuExtraHelp'):
!                 self.menuExtraHelp=Menu(self.menubar)
!                 helpMenu.insert_cascade(cascadeIndex,label='Extra Help',
!                         underline=1,menu=self.menuExtraHelp)
!             self.menuExtraHelp.delete(1,END)
!             for menuItem in menuList:
!                 self.menuExtraHelp.add_command(label=menuItem[0],
!                         command=self.__DisplayExtraHelpCallback(menuItem[1]))
!         else: #no extra help items
!             if hasattr(self,'menuExtraHelp'):
!                 helpMenu.delete(cascadeIndex-1)
!                 del(self.menuExtraHelp)
! 
!     def __DisplayExtraHelpCallback(self,helpFile):
!         def DisplayExtraHelp(helpFile=helpFile):
!             self.display_docs(helpFile)
!         return DisplayExtraHelp
  
      def UpdateRecentFilesList(self,newFile=None):
--- 532,557 ----
                              #print 'accel now:',accel,'\n'
  
!     def reset_help_menu_entries(self):
!         "Update the additional help entries on the Help menu"
!         help_list = idleConf.GetAllExtraHelpSourcesList()
!         helpmenu = self.menudict['help']
!         # first delete the extra help entries, if any
!         helpmenu_length = helpmenu.index(END)
!         if helpmenu_length > self.base_helpmenu_length:
!             helpmenu.delete((self.base_helpmenu_length + 1), helpmenu_length)
!         # then rebuild them
!         if help_list:
!             helpmenu.add_separator()
!             for entry in help_list:
!                 cmd = self.__extra_help_callback(entry[1])
!                 helpmenu.add_command(label=entry[0], command=cmd)
!         # and update the menu dictionary
!         self.menudict['help'] = helpmenu
! 
!     def __extra_help_callback(self, helpfile):
!         "Create a callback with the helpfile value frozen at definition time"
!         def display_extra_help(helpfile=helpfile):
!             self.display_docs(helpfile)
!         return display_extra_help
  
      def UpdateRecentFilesList(self,newFile=None):

Index: NEWS.txt
===================================================================
RCS file: /cvsroot/idlefork/idle/NEWS.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** NEWS.txt	10 Jan 2003 21:27:22 -0000	1.7
--- NEWS.txt	14 Jan 2003 22:03:31 -0000	1.8
***************
*** 8,11 ****
--- 8,32 ----
  *Release date: XX-XXX-2003*
  
+ - Change default: IDLE now starts with Python Shell.
+ 
+ - Removed the File Path from the Additional Help Sources scrolled list.
+ 
+ - Add capability to access Additional Help Sources on the web if the 
+   Help File Path begins with //http or www.  (Otherwise local path is
+   validated, as before.)
+ 
+ - Additional Help Sources were not being posted on the Help menu in the
+   order entered.  Implement sorting the list by [HelpFiles] 'option' 
+   number.
+ 
+ - Add Browse button to New Help Source dialog.  Arrange to start in 
+   Python/Doc if platform is Windows, otherwise start in current directory.
+ 
+ - Put the Additional Help Sources directly on the Help menu instead of in
+   an Extra Help cascade menu.  Rearrange the Help menu so the Additional
+   Help Sources come last.  Update help.txt appropriately.
+ 
+ - Fix Tk root pop-ups in configSectionNameDialog.py  and configDialog.py
+ 
  - Uniform capitalization in General tab of ConfigDialog, update the doc string.
  

Index: config-main.def
===================================================================
RCS file: /cvsroot/idlefork/idle/config-main.def,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** config-main.def	11 Jun 2002 04:45:33 -0000	1.12
--- config-main.def	14 Jan 2003 22:03:31 -0000	1.13
***************
*** 26,32 ****
  # one of the default themes or keysets just applies the relevant settings 
  # from the default file. 
  
  [General]
! editor-on-startup= 1
  print-command-posix=lpr %s
  print-command-win=start /min notepad /p %s
--- 26,44 ----
  # one of the default themes or keysets just applies the relevant settings 
  # from the default file. 
+ #
+ # Additional help sources are listed in the [HelpFiles] section and must be
+ # viewable by a web browser (or the Windows Help viewer in the case of .chm
+ # files). These sources will be listed on the Help menu.  The pattern is 
+ # <sequence_number = menu item;/path/to/help/source> 
+ # You can't use a semi-colon in a menu item or path.  The path will be platform
+ # specific because of path separators, drive specs etc.
+ #
+ # It is best to use the Configuration GUI to set up additional help sources!
+ # Example:
+ #1 = My Extra Help Source;/usr/share/doc/foo/index.html
+ #2 = Another Help Source;/path/to/another.pdf
  
  [General]
! editor-on-startup= 0
  print-command-posix=lpr %s
  print-command-win=start /min notepad /p %s
***************
*** 52,72 ****
  
  [HelpFiles]
- #additional help sources, must be viewable by an html browser
- #will be listed on the Help/Other Help menu
- #option names are the sequence number of the option
- #values take the form: menu item;/path/to/help/source
- #obviously you can't use a semi-colon in a menu item or path and the path will 
- #be platform specific because of path separators, drive specs etc. 
- #eg.:
- #1= My Extra Help Source;/usr/share/doc/foo/index.html
- #2= Another Help Source;/path/to/another.html
- 
- #[RecentFiles]
- #this section will only be present in the user config file idle-main.cfg
- #where it will record the most recently openned files in the form
- #IndexNum= /full/path/of/file  , for display on the File/Recent Files menu
- #it is present here for reference only
- #eg.:
- #1=/most/recently/openned/file
- #2=/next/most/recently/openned/file
- #etc.
--- 64,65 ----

Index: configDialog.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configDialog.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** configDialog.py	10 Jan 2003 20:13:57 -0000	1.50
--- configDialog.py	14 Jan 2003 22:03:31 -0000	1.51
***************
*** 678,682 ****
          keySetName=self.customKeys.get()
          if not tkMessageBox.askyesno('Delete Key Set','Are you sure you wish '+
!                 'to delete the key set '+`keySetName`+' ?'):
              return
          #remove key set from config
--- 678,683 ----
          keySetName=self.customKeys.get()
          if not tkMessageBox.askyesno('Delete Key Set','Are you sure you wish '+
!                                      'to delete the key set '+`keySetName`+' ?',
!                                      parent=self):
              return
          #remove key set from config
***************
*** 704,708 ****
          themeName=self.customTheme.get()
          if not tkMessageBox.askyesno('Delete Theme','Are you sure you wish '+
!                 'to delete the theme '+`themeName`+' ?'):
              return
          #remove theme from config
--- 705,710 ----
          themeName=self.customTheme.get()
          if not tkMessageBox.askyesno('Delete Theme','Are you sure you wish '+
!                                      'to delete the theme '+`themeName`+' ?',
!                                      parent=self):
              return
          #remove theme from config
***************
*** 875,879 ****
          if helpSource:
              self.userHelpList.append( (helpSource[0],helpSource[1]) )
!             self.listHelp.insert(END,helpSource[0]+'  '+helpSource[1])
              self.UpdateUserHelpChangedItems()
          self.SetHelpListButtonStates()
--- 877,881 ----
          if helpSource:
              self.userHelpList.append( (helpSource[0],helpSource[1]) )
!             self.listHelp.insert(END,helpSource[0])
              self.UpdateUserHelpChangedItems()
          self.SetHelpListButtonStates()
***************
*** 888,892 ****
          self.userHelpList[itemIndex]=newHelpSource
          self.listHelp.delete(itemIndex)
!         self.listHelp.insert(itemIndex,newHelpSource[0]+'  '+newHelpSource[1])
          self.UpdateUserHelpChangedItems()
          self.SetHelpListButtonStates()
--- 890,894 ----
          self.userHelpList[itemIndex]=newHelpSource
          self.listHelp.delete(itemIndex)
!         self.listHelp.insert(itemIndex,newHelpSource[0])
          self.UpdateUserHelpChangedItems()
          self.SetHelpListButtonStates()
***************
*** 900,909 ****
  
      def UpdateUserHelpChangedItems(self):
!         #clear and rebuild the HelpFiles section in self.changedItems
!         if self.changedItems['main'].has_key('HelpFiles'):
!             del(self.changedItems['main']['HelpFiles'])
          for num in range(1,len(self.userHelpList)+1):
              self.AddChangedItem('main','HelpFiles',str(num),
!                     string.join(self.userHelpList[num-1],';'))
  
      def LoadFontCfg(self):
--- 902,910 ----
  
      def UpdateUserHelpChangedItems(self):
!         "Clear and rebuild the HelpFiles section in self.changedItems"
!         self.changedItems['main']['HelpFiles'] = {}
          for num in range(1,len(self.userHelpList)+1):
              self.AddChangedItem('main','HelpFiles',str(num),
!                     string.join(self.userHelpList[num-1][:2],';'))
  
      def LoadFontCfg(self):
***************
*** 1020,1027 ****
          self.winWidth.set(idleConf.GetOption('main','EditorWindow','width'))
          self.winHeight.set(idleConf.GetOption('main','EditorWindow','height'))
!         #help browsing
!         self.userHelpList=idleConf.GetExtraHelpSourceList('user')
          for helpItem in self.userHelpList:
!             self.listHelp.insert(END,helpItem[0]+'  '+helpItem[1])
          self.SetHelpListButtonStates()
          #self.userHelpBrowser.set(idleConf.GetOption('main','General',
--- 1021,1028 ----
          self.winWidth.set(idleConf.GetOption('main','EditorWindow','width'))
          self.winHeight.set(idleConf.GetOption('main','EditorWindow','height'))
!         # additional help sources
!         self.userHelpList = idleConf.GetAllExtraHelpSourcesList()
          for helpItem in self.userHelpList:
!             self.listHelp.insert(END,helpItem[0])
          self.SetHelpListButtonStates()
          #self.userHelpBrowser.set(idleConf.GetOption('main','General',
***************
*** 1087,1090 ****
--- 1088,1092 ----
                      #this section gets completely replaced
                      idleConf.userCfg['main'].remove_section('HelpFiles')
+                     cfgTypeHasChanges = True
                  for item in self.changedItems[configType][section].keys():
                      value = self.changedItems[configType][section][item]
***************
*** 1108,1112 ****
              instance.ResetFont()
              instance.ResetKeybindings()
!             instance.ResetExtraHelpMenu()
  
      def Cancel(self):
--- 1110,1114 ----
              instance.ResetFont()
              instance.ResetKeybindings()
!             instance.reset_help_menu_entries()
  
      def Cancel(self):

Index: configHandler.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configHandler.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** configHandler.py	4 Jan 2003 01:43:53 -0000	1.28
--- configHandler.py	14 Jan 2003 22:03:31 -0000	1.29
***************
*** 1,13 ****
! """
! Provides access to stored idle configuration information.
! """
! # Throughout this module there is an emphasis on returning useable defaults
! # when a problem occurs in returning a requested configuration value back to
! # idle. This is to allow idle to continue to function in spite of errors in
! # the retrieval of config information. When a default is returned instead of
! # a requested config value, a message is printed to stderr to aid in
! # configuration problem notification and resolution.
  
! import os, sys, string
  from ConfigParser import ConfigParser, NoOptionError, NoSectionError
  
--- 1,24 ----
! """Provides access to stored IDLE configuration information.
  
! Refer to the comments at the beginning of config-main.def for a description of
! the available configuration files and the design implemented to update user
! configuration information.  In particular, user configuration choices which
! duplicate the defaults will be removed from the user's configuration files,
! and if a file becomes empty, it will be deleted.  
! 
! The contents of the user files may be altered using the Options/Configure IDLE
! menu to access the configuration GUI (configDialog.py), or manually.
! 
! Throughout this module there is an emphasis on returning useable defaults
! when a problem occurs in returning a requested configuration value back to
! idle. This is to allow IDLE to continue to function in spite of errors in
! the retrieval of config information. When a default is returned instead of
! a requested config value, a message is printed to stderr to aid in
! configuration problem notification and resolution.
! 
! """
! import os
! import sys
! import string
  from ConfigParser import ConfigParser, NoOptionError, NoSectionError
  
***************
*** 124,130 ****
  
      def Save(self):
!         """
!         If config isn't empty, write file to disk. If config is empty,
!         remove the file from disk if it exists.
          """
          if not self.IsEmpty():
--- 135,143 ----
  
      def Save(self):
!         """Update user configuration file.
! 
!         Remove empty sections. If resulting config isn't empty, write the file
!         to disk. If config is empty, remove the file from disk if it exists.
! 
          """
          if not self.IsEmpty():
***************
*** 556,564 ****
  
      def GetExtraHelpSourceList(self,configSet):
!         """
!         Returns a list of tuples containing the details of any additional
!         help sources configured in the requested configSet ('user' or 'default')
!         , or an empty list if there are none. Returned tuples are of the form
!         form (menu_item , path_to_help_file , option).
          """
          helpSources=[]
--- 569,580 ----
  
      def GetExtraHelpSourceList(self,configSet):
!         """Fetch list of extra help sources from a given configSet.
!         
!         Valid configSets are 'user' or 'default'.  Return a list of tuples of
!         the form (menu_item , path_to_help_file , option), or return the empty
!         list.  'option' is the sequence number of the help resource.  'option'
!         values determine the position of the menu items on the Help menu,
!         therefore the returned list must be sorted by 'option'.
! 
          """
          helpSources=[]
***************
*** 581,585 ****
--- 597,610 ----
              if menuItem and helpPath: #neither are empty strings
                  helpSources.append( (menuItem,helpPath,option) )
+         helpSources.sort(self.__helpsort)
          return helpSources
+ 
+     def __helpsort(self, h1, h2):
+         if int(h1[2]) < int(h2[2]):
+             return -1
+         elif int(h1[2]) > int(h2[2]):
+             return 1
+         else:
+             return 0
  
      def GetAllExtraHelpSourcesList(self):

Index: configHelpSourceEdit.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configHelpSourceEdit.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** configHelpSourceEdit.py	10 Jan 2003 20:13:57 -0000	1.4
--- configHelpSourceEdit.py	14 Jan 2003 22:03:31 -0000	1.5
***************
*** 1,13 ****
  "Dialog to specify or edit the parameters for a user configured help source."
  
  from Tkinter import *
  import tkMessageBox
! import os
  
  class GetHelpSourceDialog(Toplevel):
      def __init__(self, parent, title, menuItem='', filePath=''):
!         """
!         menuItem - string, the menu item to edit, if any
!         filePath - string, the help file path to edit, if any
          """
          Toplevel.__init__(self, parent)
--- 1,18 ----
  "Dialog to specify or edit the parameters for a user configured help source."
  
+ import os
+ 
  from Tkinter import *
  import tkMessageBox
! import tkFileDialog
  
  class GetHelpSourceDialog(Toplevel):
      def __init__(self, parent, title, menuItem='', filePath=''):
!         """Get menu entry and url/ local file location for Additional Help
! 
!         User selects a name for the Help resource and provides a web url
!         or a local file as its source.  The user can enter a url or browse
!         for the file.
! 
          """
          Toplevel.__init__(self, parent)
***************
*** 40,44 ****
          self.path = StringVar(self)
          self.fontSize = StringVar(self)
!         self.frameMain = Frame(self, borderwidth=2, relief=SUNKEN)
          self.frameMain.pack(side=TOP, expand=TRUE, fill=BOTH)
          labelMenu = Label(self.frameMain, anchor=W, justify=LEFT,
--- 45,49 ----
          self.path = StringVar(self)
          self.fontSize = StringVar(self)
!         self.frameMain = Frame(self, borderwidth=2, relief=GROOVE)
          self.frameMain.pack(side=TOP, expand=TRUE, fill=BOTH)
          labelMenu = Label(self.frameMain, anchor=W, justify=LEFT,
***************
*** 48,52 ****
          self.entryMenu.focus_set()
          labelPath = Label(self.frameMain, anchor=W, justify=LEFT,
!                           text='Help File Path:')
          self.entryPath = Entry(self.frameMain, textvariable=self.path,
                                 width=40)
--- 53,57 ----
          self.entryMenu.focus_set()
          labelPath = Label(self.frameMain, anchor=W, justify=LEFT,
!                           text='Help File Path: Enter URL or browse for file')
          self.entryPath = Entry(self.frameMain, textvariable=self.path,
                                 width=40)
***************
*** 56,59 ****
--- 61,67 ----
          labelPath.pack(anchor=W, padx=5, pady=3)
          self.entryPath.pack(anchor=W, padx=5, pady=3)
+         browseButton = Button(self.frameMain, text='Browse', width=8,
+                               command=self.browseFile)
+         browseButton.pack(pady=3)
          frameButtons = Frame(self)
          frameButtons.pack(side=BOTTOM, fill=X)
***************
*** 61,70 ****
                                 width=8, default=ACTIVE,  command=self.Ok)
          self.buttonOk.grid(row=0, column=0, padx=5,pady=5)
-         self.buttonOk.bind('<Return>', self.Ok)
-         #self.buttonOk.focus()
          self.buttonCancel = Button(frameButtons, text='Cancel',
                                     width=8, command=self.Cancel)
          self.buttonCancel.grid(row=0, column=1, padx=5, pady=5)
  
      def MenuOk(self):
          "Simple validity check for a sensible menu item name"
--- 69,99 ----
                                 width=8, default=ACTIVE,  command=self.Ok)
          self.buttonOk.grid(row=0, column=0, padx=5,pady=5)
          self.buttonCancel = Button(frameButtons, text='Cancel',
                                     width=8, command=self.Cancel)
          self.buttonCancel.grid(row=0, column=1, padx=5, pady=5)
  
+     def browseFile(self):
+         filetypes = [
+             ("HTML Files", "*.htm *.html", "TEXT"),
+             ("PDF Files", "*.pdf", "TEXT"),
+             ("Windows Help Files", "*.chm"),
+             ("Text Files", "*.txt", "TEXT"),
+             ("All Files", "*")]
+         path = self.path.get()
+         if path:
+             dir, base = os.path.split(path)
+         else:
+             base = None
+             if sys.platform.count('win') or sys.platform.count('nt'):
+                 dir = os.path.join(os.path.dirname(sys.executable), 'Doc')
+                 if not os.path.isdir(dir):
+                     dir = os.getcwd()
+             else:
+                 dir = os.getcwd()
+         opendialog = tkFileDialog.Open(parent=self, filetypes=filetypes)
+         file = opendialog.show(initialdir=dir, initialfile=base)
+         if file:
+             self.path.set(file)
+         
      def MenuOk(self):
          "Simple validity check for a sensible menu item name"
***************
*** 98,101 ****
--- 127,132 ----
              self.entryPath.focus_set()
              pathOk = False
+         elif path.startswith('www.') or path.startswith('http'):
+             pathOk = True
          elif not os.path.exists(path):
              tkMessageBox.showerror(title='File Path Error',

Index: configSectionNameDialog.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configSectionNameDialog.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** configSectionNameDialog.py	31 Dec 2002 16:03:23 -0000	1.3
--- configSectionNameDialog.py	14 Jan 2003 22:03:31 -0000	1.4
***************
*** 64,77 ****
          if not name: #no name specified
              tkMessageBox.showerror(title='Name Error',
!                     message='No name specified.')
              nameOk=0
          elif len(name)>30: #name too long
              tkMessageBox.showerror(title='Name Error',
                      message='Name too long. It should be no more than '+
!                     '30 characters.')
              nameOk=0
          elif name in self.usedNames:
              tkMessageBox.showerror(title='Name Error',
!                     message='This name is already in use.')
              nameOk=0
          return nameOk
--- 64,77 ----
          if not name: #no name specified
              tkMessageBox.showerror(title='Name Error',
!                     message='No name specified.', parent=self)
              nameOk=0
          elif len(name)>30: #name too long
              tkMessageBox.showerror(title='Name Error',
                      message='Name too long. It should be no more than '+
!                     '30 characters.', parent=self)
              nameOk=0
          elif name in self.usedNames:
              tkMessageBox.showerror(title='Name Error',
!                     message='This name is already in use.', parent=self)
              nameOk=0
          return nameOk