Return the celerio template packs found on the classpath.
437475
protected List<TemplatePackInfo> getBootstrapPacksInfo() {
        if (bootstrapPacksInfo == null) {
            bootstrapPacksInfo = getCelerioApplicationContext().getBean(ClasspathTemplatePackInfoLoader.class).resolveTopLevelPacks();
        }
        return bootstrapPacksInfo;
    }
293448
def templates(self):
        
        if self._template_manager is None:
            self._template_manager = TemplateManager(session=self._session)
        return self._template_manager
1056372
def get_templates(self):
        
        use = getattr(self, 'use', '')
        if isinstance(use, list):
            return [n.strip() for n in use if n.strip()]

        return [n.strip() for n in use.split(',') if n.strip()]
76191
protected URL[] getCompileClasspathElementURLs() throws DependencyResolutionRequiredException {
    // build class loader to get classes to generate resources for
    return project.getCompileClasspathElements().stream()
        .map(path -> {
          try {
            return new File(path).toURI().toURL();
          }
          catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
          }
        })
        .toArray(size -> new URL[size]);
  }
153658
def load_default_templates(self):
        """"""
        for importer, modname, is_pkg in pkgutil.iter_modules(templates.__path__):
            self.register_template('.'.join((templates.__name__, modname)))
53616
def list_templates(self) -> List[str]:
        
        result = set()
        for loader in self._loaders():
            for template in loader.list_templates():
                result.add(str(template))
        return list(result)
323944
def get_template(self, template_name, **parameters):
        """"""
        template_path = pathlib.Path(self.template_dir).joinpath(template_name)
        return get_template(template_path, **parameters)
1207267
static String[] computeTemplates(String[] templates, String classpathRoot) {
        if (templates == null || templates.length == 0) {
            if (logger.isDebugEnabled()) {
                logger.debug("Automatic discovery is activated. Looking for template files in classpath under [{}].",
                        classpathRoot);
            }

            ArrayList<String> autoTemplates = new ArrayList<>();

            try {
                // Let's scan our resources
                List<String> scannedTemplates = TemplateFinder.findTemplates(classpathRoot);
                for (String template : scannedTemplates) {
                    autoTemplates.add(template);
                }

                return autoTemplates.toArray(new String[autoTemplates.size()]);
            } catch (IOException|URISyntaxException e) {
                logger.debug("Automatic discovery does not succeed for finding json files in classpath under " + classpathRoot + ".");
                logger.trace("", e);
            }
        }
        return templates;
    }
585221
def GenerateDPKGFiles(self, template_path):
    """"""

    # Rename the generated binaries to the correct name.
    template_binary_dir = os.path.join(template_path, "dist/debian/grr-client")
    package_name = config.CONFIG.Get(
        "ClientBuilder.package_name", context=self.context)
    target_binary_dir = os.path.join(
        template_path, "dist/debian/%s%s" %
        (package_name,
         config.CONFIG.Get("ClientBuilder.target_dir", context=self.context)))
    if package_name == "grr-client":
      # Need to rename the template path or the move will fail.
      shutil.move(template_binary_dir, "%s-template" % template_binary_dir)
      template_binary_dir = "%s-template" % template_binary_dir

    utils.EnsureDirExists(os.path.dirname(target_binary_dir))
    shutil.move(template_binary_dir, target_binary_dir)

    shutil.move(
        os.path.join(target_binary_dir, "grr-client"),
        os.path.join(
            target_binary_dir,
            config.CONFIG.Get("Client.binary_name", context=self.context)))

    deb_in_dir = os.path.join(template_path, "dist/debian/debian.in/")

    self.GenerateDirectory(deb_in_dir, os.path.join(
        template_path, "dist/debian"), [("grr-client", package_name)])

    # Generate directories for the /usr/sbin link.
    utils.EnsureDirExists(
        os.path.join(template_path, "dist/debian/%s/usr/sbin" % package_name))

    if config.CONFIG.Get("Client.fleetspeak_enabled", context=self.context):
      self._GenerateFleetspeakConfig(template_path)
      shutil.rmtree(deb_in_dir)
      shutil.rmtree(os.path.join(template_path, "dist", "fleetspeak"))
      return

    # Generate the nanny template. This only exists from client version 3.1.2.5
    # onwards.
    if config.CONFIG["Template.version_numeric"] >= 3125:
      self.GenerateFile(
          os.path.join(target_binary_dir, "nanny.sh.in"),
          os.path.join(target_binary_dir, "nanny.sh"))

    # Generate the upstart template.
    self.GenerateFile(
        os.path.join(template_path, "dist/debian/upstart.in/grr-client.conf"),
        os.path.join(template_path, "dist/debian/%s.upstart" % package_name))

    # Generate the initd template. The init will not run if it detects upstart
    # is present.
    self.GenerateFile(
        os.path.join(template_path, "dist/debian/initd.in/grr-client"),
        os.path.join(template_path, "dist/debian/%s.init" % package_name))

    # Generate the systemd unit file.
    self.GenerateFile(
        os.path.join(template_path,
                     "dist/debian/systemd.in/grr-client.service"),
        os.path.join(template_path, "dist/debian/%s.service" % package_name))

    # Clean up the template dirs.
    shutil.rmtree(deb_in_dir)
    shutil.rmtree(os.path.join(template_path, "dist/debian/upstart.in"))
    shutil.rmtree(os.path.join(template_path, "dist/debian/initd.in"))
    shutil.rmtree(os.path.join(template_path, "dist/debian/systemd.in"))
973130
def templates():
    '''
    
    '''
    try:
        template_scripts = os.listdir('/usr/share/lxc/templates')
    except OSError:
        return []
    else:
        return [x[4:] for x in template_scripts if x.startswith('lxc-')]
955755
def get_templatetag_module(cls):
        
        if cls not in CacheTag._templatetags_modules:
            # find the library including the main templatetag of the current class
            all_tags = cls.get_all_tags_and_filters_by_function()['tags']
            CacheTag._templatetags_modules[cls] = all_tags[CacheTag._templatetags[cls]['cache']][0]
        return CacheTag._templatetags_modules[cls]
534902
def get_template(name):
    
    path = pkg_resources.resource_filename('vr.runners', 'templates/' + name)
    with open(path, 'r') as f:
        return f.read()
550345
def get_templates(path: Path) -> List[str]:
    '''
    '''

    result = []

    for item in path.glob('**/*'):
        if item.is_file() and not item.name.startswith('_'):
            result.append(item.relative_to(path.parent).as_posix())

    return result
96219
private void overridePacksAndModules(Celerio celerio) {
        String filename = xmlTemplatePacksOverride;
        if (!FileUtils.fileExists(filename)) {
            return;
        }
        getLog().info("Overriding configuration with " + filename);

        CelerioLoader celerioLoader = context.getBean(CelerioLoader.class);
        try {
            Configuration configuration = celerioLoader.load(filename).getConfiguration();
            // override celerioContext
            CelerioTemplateContext ctc = configuration.getCelerioTemplateContext();
            if (ctc != null) {
                celerio.getConfiguration().setCelerioTemplateContext(ctc);
            }

            // override packs
            List<Pack> newPacks = configuration.getPacks();
            if (newPacks != null && !newPacks.isEmpty()) {
                celerio.getConfiguration().setPacks(newPacks);
            }

            // override modules
            List<Module> newModules = configuration.getModules();
            if (newModules != null && !newModules.isEmpty()) {
                celerio.getConfiguration().setModules(newModules);
            }
        } catch (Exception e) {
            throw new RuntimeException("Could not do override: ["+ filename + "]", e);
        }
    }
1003473
public function getAllTemplates()
    {
        $strCacheDir = $this->container->getParameter('kernel.cache_dir');

        // Try to load from cache
        if (file_exists($strCacheDir.'/contao/config/twig-templates.php')) {
            self::$twigFiles = include $strCacheDir.'/contao/config/twig-templates.php';

            return self::$twigFiles;
        }

        $bundles = $this->kernel->getBundles();

        if (\is_array($bundles)) {
            foreach (array_reverse($bundles) as $key => $value) {
                $path = $this->kernel->locateResource("@$key");

                $dir = rtrim($path, '/').'/Resources/views';

                if (!is_dir($dir)) {
                    continue;
                }
                $finder = new Finder();
                $twigKey = preg_replace('/Bundle$/', '', $key);

                foreach ($finder->in($dir)->files()->name('*.twig') as $file) {
                    /** @var SplFileInfo $file */
                    $name = $file->getBasename();
                    $legacyName = false !== strpos($name, 'html.twig') ? $file->getBasename('.html.twig') : $name;

                    if (isset(self::$twigFiles[$name])) {
                        continue;
                    }

                    self::$twigFiles[$name] = "@$twigKey/".$file->getRelativePathname();

                    if ($legacyName !== $name) {
                        self::$twigFiles[$legacyName] = self::$twigFiles[$name];
                    }
                }
            }
        }

        foreach ($this->container->get('contao.resource_finder')->findIn('templates')->name('*.twig') as $file) {
            $name = $file->getBasename();
            $legacyName = false !== strpos($name, 'html.twig') ? $file->getBasename('.html.twig') : $name;

            /* @var SplFileInfo $file */
            self::$twigFiles[$name] = $file->getRealPath();

            if ($legacyName !== $name) {
                self::$twigFiles[$legacyName] = self::$twigFiles[$name];
            }
        }

        // add root templates
        $rootTemplates = $this->findTemplates($this->containerUtil->getProjectDir().'/templates/');

        if (\is_array($rootTemplates)) {
            foreach ($rootTemplates as $file) {
                $name = basename($file);
                $legacyName = false !== strpos($name, 'html.twig') ? basename($file, '.html.twig') : $name;

                self::$twigFiles[$name] = $file;

                if ($legacyName !== $name) {
                    self::$twigFiles[$legacyName] = self::$twigFiles[$name];
                }
            }
        }

        return self::$twigFiles;
    }
691061
def _find_template(self, template, tree, blocks, with_filename,
                   source, comment):
        
        from uliweb import application
        from uliweb.core.template import _format_code

        def get_rel_filename(filename, path):
            f1 = os.path.splitdrive(filename)[1]
            f2 = os.path.splitdrive(path)[1]
            f = os.path.relpath(f1, f2).replace('\\', '/')
            if f.startswith('..'):
                return filename.replace('\\', '/')
            else:
                return f

        template_file = None

        if not tree:
            application.template_loader.comment = comment
            files = application.template_loader.find_templates(template)
            if files:
                template_file = files[0]

                for x in files:
                    print x

                if source:
                    print
                    print '---------------- source of %s ---------------' % template
                    t = application.template_loader.load(template_file)
                    if t and comment:
                        print _format_code(t.code).rstrip()
                        print
                    else:
                        print t.code
                        print

            else:
                print 'Not Found'
        else:
            application.template_loader.print_tree(template)

        if template_file and blocks:
            application.template_loader.print_blocks(template, with_filename)
1364131
def get_template_dirs():
    """"""
    temp_glob = rel_to_cwd('templates', '**', 'templates', 'config.yaml')
    temp_groups = glob(temp_glob)
    temp_groups = [get_parent_dir(path, 2) for path in temp_groups]
    return set(temp_groups)