[Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.9, 1.10

Mark Hammond mhammond at users.sourceforge.net
Tue Aug 26 01:23:09 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources
In directory sc8-pr-cvs1:/tmp/cvs-serv27313

Modified Files:
	rcparser.py 
Log Message:
Cleanup exception handling, and only print a warning about duplicate IDs
that don't look like internal AppStudio ones.


Index: rcparser.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rcparser.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rcparser.py	25 Aug 2003 17:28:09 -0000	1.9
--- rcparser.py	26 Aug 2003 07:23:04 -0000	1.10
***************
*** 131,135 ****
              self.parseH(h)
              h.close()
!         except:
              print "No .h file. ignoring."
          f = open(rcFileName)
--- 131,135 ----
              self.parseH(h)
              h.close()
!         except OSError:
              print "No .h file. ignoring."
          f = open(rcFileName)
***************
*** 158,162 ****
                      self.ids[n] = i
                      if self.names.has_key(i):
!                         print "Duplicate id",i,"for",n,"is", self.names[i]
                      else:
                          self.names[i] = n
--- 158,164 ----
                      self.ids[n] = i
                      if self.names.has_key(i):
!                         # ignore AppStudio special ones.
!                         if not n.startswith("_APS_"):
!                             print "Duplicate id",i,"for",n,"is", self.names[i]
                      else:
                          self.names[i] = n
***************
*** 355,363 ****
          rcp.loadDialogs(rc_file)
      except:
!         print "ERROR parsing dialogs at line", rcp.lex.lineno
!         print "Next 10 tokens are:"
!         for i in range(10):
!             print rcp.lex.get_token(),
!         print
          raise
  
--- 357,367 ----
          rcp.loadDialogs(rc_file)
      except:
!         lex = getattr(rcp, "lex", None)
!         if lex:
!             print "ERROR parsing dialogs at line", lex.lineno
!             print "Next 10 tokens are:"
!             for i in range(10):
!                 print lex.get_token(),
!             print
          raise
  





More information about the Spambayes-checkins mailing list