示例#1
0
文件: main.py 项目: sholiday/cvenv
            ":".join(["=".join(mapping) for mapping in mappings.items()]))


# --------------------------------------------------------------------


def build(config, argv):
    try:
        opts, args = getopt.getopt(argv[1:], "vj:", [])
    except getopt.error, message:
        raise UsageError(message)

    runner = None
    caching_runner = None
    verbose = False
    console = make_console(sys.stdout)
    threads = 1

    for name, value in opts:
        if name == "-v":
            verbose = True
        elif name == "-j":
            threads = int(value)

    if runner is None:
        runner = SubprocessRunner(console, verbose)
        caching_runner = CachingRunner(runner, console)
        runner = caching_runner

        # Note that all configurations share a common cache.pickle.
        _restore_pickle(caching_runner, "cache.pickle")
示例#2
0
 def setUp(self):
     self.dir = VirtualDirectory()
     self.context = MockContext("mock.sebs", "src/mock.sebs")
     self.rule = Rule(self.context)
     self.console = make_console(cStringIO.StringIO())  # ignore output
示例#3
0
文件: main.py 项目: sholiday/cvenv
    config.env_dir.write("$mappings",
        ":".join(["=".join(mapping) for mapping in mappings.items()]))

# --------------------------------------------------------------------

def build(config, argv):
  try:
    opts, args = getopt.getopt(argv[1:], "vj:", [])
  except getopt.error, message:
    raise UsageError(message)

  runner = None
  caching_runner = None
  verbose = False
  console = make_console(sys.stdout)
  threads = 1

  for name, value in opts:
    if name == "-v":
      verbose = True
    elif name == "-j":
      threads = int(value)

  if runner is None:
    runner = SubprocessRunner(console, verbose)
    caching_runner = CachingRunner(runner, console)
    runner = caching_runner

    # Note that all configurations share a common cache.pickle.
    _restore_pickle(caching_runner, "cache.pickle")
示例#4
0
 def setUp(self):
   self.dir = VirtualDirectory()
   self.context = MockContext("mock.sebs", "src/mock.sebs")
   self.rule = Rule(self.context)
   self.console = make_console(cStringIO.StringIO())  # ignore output