How to use the tmt.glob function in tmt

To help you get started, we’ve selected a few tmt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thewca / tnoodle / scrambles / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*png$', relativeTo=self.src)
        self.nonJavaSrcDeps.add('puzzle/puzzles')
        self.javaFilesToIgnore = tmt.glob(join(self.src, 'net/gnehzr/tnoodle/js/'), r'.*\.java')
        self.javaFilesToIgnore |= tmt.glob(join(self.src, 'net/gnehzr/tnoodle/jre/'), r'.*\.java')
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)

        self.nonJavaResourceDeps |= tmt.glob(self.srcResource, '.*$', relativeTo=self.srcResource)
        for f in xmlFileTypes:
            self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)

        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.properties$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.xsd$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.dtd$', relativeTo=self.src)
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)

        self.nonJavaResourceDeps |= tmt.glob(self.srcResource, '.*$', relativeTo=self.srcResource)
        for f in xmlFileTypes:
            self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)

        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.properties$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.xsd$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.dtd$', relativeTo=self.src)
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)

        self.nonJavaResourceDeps |= tmt.glob(self.srcResource, '.*$', relativeTo=self.srcResource)
        for f in xmlFileTypes:
            self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)

        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.properties$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.xsd$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.dtd$', relativeTo=self.src)
github thewca / tnoodle / scrambles / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*png$', relativeTo=self.src)
        self.nonJavaSrcDeps.add('puzzle/puzzles')
        self.javaFilesToIgnore = tmt.glob(join(self.src, 'net/gnehzr/tnoodle/js/'), r'.*\.java')
        self.javaFilesToIgnore |= tmt.glob(join(self.src, 'net/gnehzr/tnoodle/jre/'), r'.*\.java')
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)

        self.nonJavaResourceDeps |= tmt.glob(self.srcResource, '.*$', relativeTo=self.srcResource)
        for f in xmlFileTypes:
            self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)

        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.properties$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.xsd$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.dtd$', relativeTo=self.src)
github thewca / tnoodle / tnoodlejs / tmtproject.py View on Github external
with open(join(self.scramblesProject.src, filename), 'rb') as f:
                data = f.read()
                data64 = base64.b64encode(data).decode()
                resources[filename] = data64
        javaResources = ""
        for filename, data64 in sorted(resources.items()):
            javaResources += 'resources.put("%s", "%s");\n' % ( filename, data64 )
        puzzles = open(join(self.scramblesProject.src, 'puzzle', 'puzzles')).read()
        puzzles = puzzles.replace("\n", "\\n")

        defines = {
            '%%PUZZLES%%': puzzles,
            '%%VERSION%%': tmt.VERSION,
            '//%%RESOURCES%%': javaResources
        }
        javaFiles = tmt.glob(self.scramblesProject.src, r'.*\.java$')
        for f in javaFiles:
            with open(f) as opened:
                contents = opened.read()
            dirty = False
            for define, value in defines.items():
                if define in contents:
                    dirty = True
                    contents = contents.replace(define, value)
            if dirty:
                f = f.replace("/src/", "/postprocessed/", 1)
                if not isdir(dirname(f)):
                    os.makedirs(dirname(f))
                with open(f, 'w') as opened:
                    opened.write(contents)

        # TODO - add documentation target
github thewca / tnoodle / webscrambles / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)
        tmt.WinstoneServer.addPlugin(self)

        self.nonJavaResourceDeps |= tmt.glob(self.src, '.*html$', relativeTo=self.src)
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def configure(self):
        tmt.EclipseProject.configure(self)

        self.nonJavaResourceDeps |= tmt.glob(self.srcResource, '.*$', relativeTo=self.srcResource)
        for f in xmlFileTypes:
            self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)

        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.properties$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.xsd$', relativeTo=self.src)
        self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.dtd$', relativeTo=self.src)