예제 #1
0
파일: Addon.cpp 프로젝트: snikhil0/xbmc
CStdString GetXbmcApiVersionDependency(ADDON::AddonPtr addon)
{
  CStdString version("1.0");
  if (addon.get() != NULL)
  {
    const ADDON::ADDONDEPS &deps = addon->GetDeps();
    ADDON::ADDONDEPS::const_iterator it;
    CStdString key("xbmc.python");
    it = deps.find(key);
    if (!(it == deps.end()))
    {
      const ADDON::AddonVersion * xbmcApiVersion = &(it->second.first);
      version = xbmcApiVersion->c_str();
    }
  }

  return version;
}
예제 #2
0
void CPythonInvoker::getAddonModuleDeps(const ADDON::AddonPtr& addon, std::set<std::string>& paths)
{
  ADDON::ADDONDEPS deps = addon->GetDeps();
  for (ADDON::ADDONDEPS::const_iterator it = deps.begin(); it != deps.end(); ++it)
  {
    //Check if dependency is a module addon
    ADDON::AddonPtr dependency;
    if (ADDON::CAddonMgr::Get().GetAddon(it->first, dependency, ADDON::ADDON_SCRIPT_MODULE))
    {
      std::string path = CSpecialProtocol::TranslatePath(dependency->LibPath());
      if (paths.find(path) == paths.end())
      {
        // add it and its dependencies
        paths.insert(path);
        getAddonModuleDeps(dependency, paths);
      }
    }
  }
}