parameters: (self)
docstring: Processing of the source file -- only for TranslatorXxxx classes.
docstring_summary: Processing of the source file -- only for TranslatorXxxx classes.
docstring_tokens: Processing of the source file -- only for TranslatorXxxx classes .
function: def processing(self):
          """Processing of the source file -- only for TranslatorXxxx classes."""
  
          # Start the token generator which parses the class source file.
          tokenIterator = self.__tokenGenerator()
  
          # Collect the class and the base class identifiers.
          self.__collectClassInfo(tokenIterator)
          assert(self.classId != 'Translator')
          assert(self.classId[:17] != 'TranslatorAdapter')
  
          # Collect the prototypes of implemented public methods.
          self.__collectPublicMethodPrototypes(tokenIterator)
  
          # Eat the rest of the source to cause closing the file.
          while True:
              try:
                  t = next(tokenIterator)
              except StopIteration:
                  break
  
          # Shorthands for the used dictionaries.
          reqDic = self.manager.requiredMethodsDic
          adaptDic = self.manager.adaptMethodsDic
          myDic = self.prototypeDic
  
          # Build the list of obsolete methods.
          self.obsoleteMethods = []
          for p in myDic:
              if p not in reqDic:
                  self.obsoleteMethods.append(p)
          self.obsoleteMethods.sort()
  
          # Build the list of missing methods and the list of implemented
          # required methods.
          self.missingMethods = []
          self.implementedMethods = []
          for p in reqDic:
              if p in myDic:
                  self.implementedMethods.append(p)
              else:
                  self.missingMethods.append(p)
          self.missingMethods.sort()
          self.implementedMethods.sort()
  
          # Check whether adapter must be used or suggest the newest one.
          # Change the status and set the note accordingly.
          if self.baseClassId != 'Translator':
              if not self.missingMethods:
                  self.note = 'Change the base class to Translator.'
                  self.status = ''
                  self.readableStatus = 'almost up-to-date'
              elif self.baseClassId != 'TranslatorEnglish':
                  # The translator uses some of the adapters.
                  # Look at the missing methods and check what adapter
                  # implements them. Remember the one with the lowest version.
                  adaptMinVersion = '9.9.99'
                  adaptMinClass = 'TranslatorAdapter_9_9_99'
                  for uniProto in self.missingMethods:
                      if uniProto in adaptDic:
                          version, cls = adaptDic[uniProto]
                          if version < adaptMinVersion:
                              adaptMinVersion = version
                              adaptMinClass = cls
  
                  # Test against the current status -- preserve the self.status.
                  # Possibly, the translator implements enough methods to
                  # use some newer adapter.
                  status = self.status
  
                  # If the version of the used adapter is smaller than
                  # the required, set the note and update the status as if
                  # the newer adapter was used.
                  if adaptMinVersion > status:
                      self.note = 'Change the base class to %s.' % adaptMinClass
                      self.status = adaptMinVersion
                      self.adaptMinClass = adaptMinClass
                      self.readableStatus = adaptMinVersion # simplified
  
          # If everything seems OK, some explicit warning flags still could
          # be set.
          if not self.note and self.status == '' and \
             (self.translateMeFlag or self.txtMAX_DOT_GRAPH_HEIGHT_flag):
             self.note = ''
             if self.translateMeFlag:
                 self.note += 'The "%s" found in a comment.' % self.translateMeText
             if self.note != '':
                 self.note += '\n\t\t'
             if self.txtMAX_DOT_GRAPH_HEIGHT_flag:
                 self.note += 'The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs()'
  
          # If everything seems OK, but there are obsolete methods, set
          # the note to clean-up source. This note will be used only when
          # the previous code did not set another note (priority).
          if not self.note and self.status == '' and self.obsoleteMethods:
              self.note = 'Remove the obsolete methods (never used).'
  
          # If there is at least some note but the status suggests it is
          # otherwise up-to-date, mark is as ALMOST up-to-date.
          if self.note and self.status == '':
              self.readableStatus = 'almost up-to-date'
function_tokens: def processing ( self ) : # Start the token generator which parses the class source file. tokenIterator = self . __tokenGenerator ( ) # Collect the class and the base class identifiers. self . __collectClassInfo ( tokenIterator ) assert ( self . classId != 'Translator' ) assert ( self . classId [ : 17 ] != 'TranslatorAdapter' ) # Collect the prototypes of implemented public methods. self . __collectPublicMethodPrototypes ( tokenIterator ) # Eat the rest of the source to cause closing the file. while True : try : t = next ( tokenIterator ) except StopIteration : break # Shorthands for the used dictionaries. reqDic = self . manager . requiredMethodsDic adaptDic = self . manager . adaptMethodsDic myDic = self . prototypeDic # Build the list of obsolete methods. self . obsoleteMethods = [ ] for p in myDic : if p not in reqDic : self . obsoleteMethods . append ( p ) self . obsoleteMethods . sort ( ) # Build the list of missing methods and the list of implemented # required methods. self . missingMethods = [ ] self . implementedMethods = [ ] for p in reqDic : if p in myDic : self . implementedMethods . append ( p ) else : self . missingMethods . append ( p ) self . missingMethods . sort ( ) self . implementedMethods . sort ( ) # Check whether adapter must be used or suggest the newest one. # Change the status and set the note accordingly. if self . baseClassId != 'Translator' : if not self . missingMethods : self . note = 'Change the base class to Translator.' self . status = '' self . readableStatus = 'almost up-to-date' elif self . baseClassId != 'TranslatorEnglish' : # The translator uses some of the adapters. # Look at the missing methods and check what adapter # implements them. Remember the one with the lowest version. adaptMinVersion = '9.9.99' adaptMinClass = 'TranslatorAdapter_9_9_99' for uniProto in self . missingMethods : if uniProto in adaptDic : version , cls = adaptDic [ uniProto ] if version < adaptMinVersion : adaptMinVersion = version adaptMinClass = cls # Test against the current status -- preserve the self.status. # Possibly, the translator implements enough methods to # use some newer adapter. status = self . status # If the version of the used adapter is smaller than # the required, set the note and update the status as if # the newer adapter was used. if adaptMinVersion > status : self . note = 'Change the base class to %s.' % adaptMinClass self . status = adaptMinVersion self . adaptMinClass = adaptMinClass self . readableStatus = adaptMinVersion # simplified # If everything seems OK, some explicit warning flags still could # be set. if not self . note and self . status == '' and ( self . translateMeFlag or self . txtMAX_DOT_GRAPH_HEIGHT_flag ) : self . note = '' if self . translateMeFlag : self . note += 'The "%s" found in a comment.' % self . translateMeText if self . note != '' : self . note += '\n\t\t' if self . txtMAX_DOT_GRAPH_HEIGHT_flag : self . note += 'The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs()' # If everything seems OK, but there are obsolete methods, set # the note to clean-up source. This note will be used only when # the previous code did not set another note (priority). if not self . note and self . status == '' and self . obsoleteMethods : self . note = 'Remove the obsolete methods (never used).' # If there is at least some note but the status suggests it is # otherwise up-to-date, mark is as ALMOST up-to-date. if self . note and self . status == '' : self . readableStatus = 'almost up-to-date'