示例#1
0
def cmd_dynamic(args):
    dyn_directory = resource_filename(__name__, "R/shiny/apps")

    if args.graph is None and not(args.list):
        log.critical("No dynamic graph given!")

    if args.list or args.graph is None:
        print('List of possible dynamic graphs:')
        for s in sorted(os.listdir(dyn_directory)):
            if os.path.isdir(os.path.join(dyn_directory, s)):
                print(" * " + s)
        return 1

    cwd = os.path.join(dyn_directory, args.graph)
    cfg = os.path.abspath(args.config)
    if not os.path.exists(cwd):
        log.critical('Path "{}" not found!'.format(cwd))
        return 1
    Rcode = "library(shiny); runApp(host='0.0.0.0', port={})".format(args.port)
    cmd = ["Rscript", "-e", Rcode, "-c", cfg]
    execute_command(cmd, direct_io=True, cwd=cwd)
示例#2
0
 def testTestThat(self):
     path = resource_filename("codeface", "R")
     Rcode = 'library(testthat); if (test_dir(".")$n > 0) stop("Some tests failed.")'
     cmd = ["Rscript", "-e", Rcode]
     execute_command(cmd, direct_io=True, cwd=path)
示例#3
0
 def testThat_cluster_dir(self):
     path = resource_filename("codeface", "R")
     cmd = ["Rscript", "do_test.r"]
     execute_command(cmd, direct_io=True, cwd=path)
示例#4
0
 def testTest_R_dir(self):
     path = resource_filename("codeface", "R")
     Rcode = 'library(testthat); if (all(data.frame(test_dir("."))[, "failed"])) stop("Some tests failed.")'
     cmd = ["Rscript", "-e", Rcode]
     execute_command(cmd, direct_io=True, cwd=path)
示例#5
0
 def testThat_cluster_dir(self):
     path = resource_filename("codeface", "R")
     Rcode = 'library(testthat); if (all(data.frame(test_dir("cluster"))[, "failed"])) stop("Some tests failed.")'
     cmd = ["Rscript", "-e", Rcode]
     execute_command(cmd, direct_io=True, cwd=path)