Beispiel #1
0
 def tests(self):
     """
     For developers. Serves individual tests. Adds any test dependencies if there are any.
     """
     corebuilder.run()
     preprocessor = preprocess.SSPreProcessor(project="sandalphon", env="sandalphon", export=True)
     preprocessor.preprocess(input="sandalphon/BootstrapSandalphon.js",
                             output="builds/shiftspace.sandalphon.js")
     return serve_file(os.path.join(WEB_ROOT, 'tests/index.html'))
Beispiel #2
0
def build(argv):
    """
    Generates the supporting HTML and CSS files as well as the
    concatenated source.
    """
    input = "client/ShiftSpace.js"
    output = "shiftspace.sandbox.js"
    env = "mydev"
    proj = "sandbox"
    templ = "client/ShiftSpace.html"

    def buildUsage():
        print
        print "When running build you may use the following options"
        print "    -i     input file"
        print "    -t     template file"
        print "    -o     output file"
        print "    -e     environment file"
        print "    -p     project file"
        print "    -app   build an application"
        print

    try:
        opts, args = getopt.getopt(
            argv, "i:o:e:p:t:",
            ['input=', 'output=', 'environment=', 'project=', 'template='])
    except Exception:
        print 'Invalid flag\n'
        buildUsage()
        sys.exit(2)

    for opt, arg in opts:
        if opt in ('-i', '--input'):
            input = arg
        elif opt in ('-o', '--output'):
            output = arg
        elif opt in ('-e', '--environment'):
            env = arg
        elif opt in ('-p', '--project'):
            proj = arg
        elif opt in ('-t', '--template'):
            templ = arg
        else:
            buildUsage()

    corebuilder.run()
    compiler = sandalphon.SandalphonCompiler()
    compiler.compile(inputFile=templ,
                     outDir="builds/compiledViews",
                     envFile=env)
    preprocessor = preprocess.SSPreProcessor(project=proj, env=env)
    preprocessor.preprocess(input=input, output=os.path.join("builds", output))
Beispiel #3
0
 def build(self):
     """
     For developers. Serves the developer greasemonkey user script for deployment testing.
     """
     corebuilder.run()
     compiler = sandalphon.SandalphonCompiler()
     compiler.compile(inputFile="client/ShiftSpace.html",
                      outDir="builds/compiledViews",
                      envFile="dev")
     preprocessor = preprocess.SSPreProcessor(project="shiftspace", env="dev")
     preprocessor.preprocess(input="client/ShiftSpace.js",
                             output="builds/shiftspace.dev.user.js")
     return ack
Beispiel #4
0
def build(argv):
    """
    Generates the supporting HTML and CSS files as well as the
    concatenated source.
    """
    input = "client/ShiftSpace.js"
    output = "shiftspace.sandbox.js"
    env = "mydev"
    proj = "sandbox"
    templ = "client/ShiftSpace.html"
    
    def buildUsage():
        print
        print "When running build you may use the following options"
        print "    -i     input file"
        print "    -t     template file"
        print "    -o     output file"
        print "    -e     environment file"
        print "    -p     project file"
        print "    -app   build an application"
        print

    try:
        opts, args = getopt.getopt(argv, "i:o:e:p:t:", ['input=', 'output=', 'environment=', 'project=', 'template='])
    except Exception:
        print 'Invalid flag\n'
        buildUsage()
        sys.exit(2)

    for opt, arg in opts:
        if opt in ('-i', '--input'):
            input = arg
        elif opt in ('-o', '--output'):
            output = arg
        elif opt in ('-e', '--environment'):
            env = arg
        elif opt in ('-p', '--project'):
            proj = arg
        elif opt in ('-t', '--template'):
            templ = arg
        else:
            buildUsage()
    
    corebuilder.run()
    compiler = sandalphon.SandalphonCompiler()
    compiler.compile(inputFile=templ,
                     outDir="builds/compiledViews",
                     envFile=env)
    preprocessor = preprocess.SSPreProcessor(project=proj, env=env)
    preprocessor.preprocess(input=input, output=os.path.join("builds", output))
Beispiel #5
0
 def sandbox(self):
     """
     For developers. Serves the sandbox development enviroment. Automatically cocatenates 
     and preprocess all of CSS files and HTML files for the interface and
     as well as all of the JavaScript before serving the page.
     """
     import models.core
     t = Template(filename="html/index.mako", lookup=lookup)
     try:
         server = core.sharedServer()
         server.version
     except Exception:
         return self.statusPage(status="err", details="couchdb")
     corebuilder.run()
     compiler = sandalphon.SandalphonCompiler()
     compiler.compile(inputFile="client/ShiftSpace.html",
                      outDir="builds/compiledViews",
                      envFile="mydev")
     preprocessor = preprocess.SSPreProcessor(project="sandbox", env="mydev")
     preprocessor.preprocess(input="client/ShiftSpace.js",
                             output="builds/shiftspace.sandbox.js")
     return serve_file(os.path.join(WEB_ROOT, 'sandbox/index.html'))