Esempio n. 1
0
    def _createLoaderJs(self):
        """Doc..."""
        result = SiteProcessUtils.compileCoffeescriptFile(
            FileUtils.createPath(
                StaticFlowEnvironment.rootResourcePath, '..', 'js', 'loader.coffee', isFile=True),
            FileUtils.createPath(
                StaticFlowEnvironment.rootResourcePath, 'web', 'js', isDir=True) )
        if result['code']:
            print 'ERROR: Failed to compile loader.coffee'
            print result
            return False

        print u'COMPILED: loader.js'
        return True
Esempio n. 2
0
    def _createEngineJs(self):
        cb = CoffeescriptBuilder(
            'sflow.api.SFlowApi-exec',
            FileUtils.createPath(StaticFlowEnvironment.rootResourcePath, '..', 'js', isDir=True),
            buildOnly=True)
        target = cb.construct()[0]

        targetFolder = FileUtils.createPath(
                StaticFlowEnvironment.rootResourcePath, 'web', 'js', isDir=True)

        result = SiteProcessUtils.compileCoffeescriptFile(target.assembledPath, targetFolder)
        if result['code']:
            print 'ERROR: Failed compilation of the Static Flow engine'
            print result
            return False

        sourcePath = FileUtils.createPath(targetFolder, target.name + '.js', isFile=True)
        destPath   = FileUtils.createPath(targetFolder, 'engine.js', isFile=True)
        SystemUtils.move(sourcePath, destPath)
        return True