parameters: (self, app_list)
return_statement: return apps
docstring: Implementes the package retrieval for apt based environments
docstring_summary: Implementes the package retrieval for apt based environments
docstring_tokens: Implementes the package retrieval for apt based environments
function: def apt_list_packages(self, app_list):
          """ Implementes the package retrieval for apt based environments """
          INSTALLED_STATE = self.apt_pkg.CURSTATE_INSTALLED
          apps = set()
          cache = self.apt_pkg.Cache()
          for app in app_list.split():
              if app in cache:
                  pkg = cache[app]
                  # Normal package
                  if pkg.current_state == INSTALLED_STATE:
                      detail = (app, pkg.current_ver.ver_str)
                      apps.add("%s-%s" % (detail))
                  # virtual package
                  elif len(pkg.provides_list) > 0:
                      for _, _, pkg in pkg.provides_list:
                          if pkg.parent_pkg.current_state == INSTALLED_STATE:
                              detail = (app, pkg.parent_pkg.current_ver.ver_str)
                              apps.add("%s-%s" % (detail))
          return apps
function_tokens: def apt_list_packages ( self , app_list ) : INSTALLED_STATE = self . apt_pkg . CURSTATE_INSTALLED apps = set ( ) cache = self . apt_pkg . Cache ( ) for app in app_list . split ( ) : if app in cache : pkg = cache [ app ] # Normal package if pkg . current_state == INSTALLED_STATE : detail = ( app , pkg . current_ver . ver_str ) apps . add ( "%s-%s" % ( detail ) ) # virtual package elif len ( pkg . provides_list ) > 0 : for _ , _ , pkg in pkg . provides_list : if pkg . parent_pkg . current_state == INSTALLED_STATE : detail = ( app , pkg . parent_pkg . current_ver . ver_str ) apps . add ( "%s-%s" % ( detail ) ) return apps