parameters: (self)
return_statement: return rv
docstring: Return a list of prerequisites for this package.
  
          The list contains 2-tuples, of which the first item is either
          a PimpPackage object or None, and the second is a descriptive
          string. The first item can be None if this package depends on
          something that isn't pimp-installable, in which case the descriptive
          string should tell the user what to do.
docstring_summary: Return a list of prerequisites for this package.
docstring_tokens: Return a list of prerequisites for this package .
function: def prerequisites(self):
          """Return a list of prerequisites for this package.
  
          The list contains 2-tuples, of which the first item is either
          a PimpPackage object or None, and the second is a descriptive
          string. The first item can be None if this package depends on
          something that isn't pimp-installable, in which case the descriptive
          string should tell the user what to do."""
  
          rv = []
          if not self._dict.get('Download-URL'):
              # For pseudo-packages that are already installed we don't
              # return an error message
              status, _  = self.installed()
              if status == "yes":
                  return []
              return [(None,
                  "Package %s cannot be installed automatically, see the description" %
                      self.fullname())]
          if self.systemwideOnly() and self._db.preferences.isUserInstall():
              return [(None,
                  "Package %s can only be installed system-wide" %
                      self.fullname())]
          if not self._dict.get('Prerequisites'):
              return []
          for item in self._dict['Prerequisites']:
              if type(item) == str:
                  pkg = None
                  descr = str(item)
              else:
                  name = item['Name']
                  if 'Version' in item:
                      name = name + '-' + item['Version']
                  if 'Flavor' in item:
                      name = name + '-' + item['Flavor']
                  pkg = self._db.find(name)
                  if not pkg:
                      descr = "Requires unknown %s"%name
                  else:
                      descr = pkg.shortdescription()
              rv.append((pkg, descr))
          return rv
function_tokens: def prerequisites ( self ) : rv = [ ] if not self . _dict . get ( 'Download-URL' ) : # For pseudo-packages that are already installed we don't # return an error message status , _ = self . installed ( ) if status == "yes" : return [ ] return [ ( None , "Package %s cannot be installed automatically, see the description" % self . fullname ( ) ) ] if self . systemwideOnly ( ) and self . _db . preferences . isUserInstall ( ) : return [ ( None , "Package %s can only be installed system-wide" % self . fullname ( ) ) ] if not self . _dict . get ( 'Prerequisites' ) : return [ ] for item in self . _dict [ 'Prerequisites' ] : if type ( item ) == str : pkg = None descr = str ( item ) else : name = item [ 'Name' ] if 'Version' in item : name = name + '-' + item [ 'Version' ] if 'Flavor' in item : name = name + '-' + item [ 'Flavor' ] pkg = self . _db . find ( name ) if not pkg : descr = "Requires unknown %s" % name else : descr = pkg . shortdescription ( ) rv . append ( ( pkg , descr ) ) return rv