parameters: (self, package)
docstring: Check apt package versions
  
          :param package: package to check
          :type package: str
          :return: installed version, candidate version
          :rtype: str, str / False, False
docstring_summary: Check apt package versions
docstring_tokens: Check apt package versions
function: def _check_versions(self, package):
          """ Check apt package versions
  
          :param package: package to check
          :type package: str
          :return: installed version, candidate version
          :rtype: str, str / False, False
          """
          if self.update and not self._update_cache():
              return False, False
          try:
              trans = self.apt_client.upgrade_packages([package])
              # trans = self.apt_client.upgrade_packages('bla')
              trans.simulate(reply_handler=self._apt_trans_started,
                             error_handler=self._apt_error_handler)
              pkg = trans.packages[4][0]
              if pkg == package:
                  cache = apt.Cache()
                  cache.open(None)
                  cache.upgrade()
                  if cache[pkg].installed:
                      return cache[pkg].installed.version, cache[pkg].candidate.version
  
              return False, False
  
          except Exception as error:  # pylint: disable=broad-except
              log('Exception while checking versions: %s' % error)
              return False, False
function_tokens: def _check_versions ( self , package ) : if self . update and not self . _update_cache ( ) : return False , False try : trans = self . apt_client . upgrade_packages ( [ package ] ) # trans = self.apt_client.upgrade_packages('bla') trans . simulate ( reply_handler = self . _apt_trans_started , error_handler = self . _apt_error_handler ) pkg = trans . packages [ 4 ] [ 0 ] if pkg == package : cache = apt . Cache ( ) cache . open ( None ) cache . upgrade ( ) if cache [ pkg ] . installed : return cache [ pkg ] . installed . version , cache [ pkg ] . candidate . version return False , False except Exception as error : # pylint: disable=broad-except log ( 'Exception while checking versions: %s' % error ) return False , False