示例#1
0
 def init_pyscope(self, fpath):
     """ initialize pyscope with codebase"""
     pythoscope_workspace = (fpath + path('/.pythoscope'))
     if pythoscope_workspace.exists():
         from kinbaku.util import remove_recursively
         remove_recursively(pythoscope_workspace)
     init_project(fpath)
示例#2
0
 def init_pyscope(self, fpath):
     """ initialize pythoscope with codebase
          ( will be <codebase-shadow>/.pythonscope )
     """
     from pythoscope import init_project
     self.workspace = (fpath + path('/.pythoscope'))
     if self.workspace.exists():
         report("Workspace exists.. wiping it")
         from kinbaku.util import remove_recursively
         remove_recursively(self.workspace)
     init_project(fpath)
示例#3
0
            init = True
        elif opt in ("-t", "--template"):
            template = value
        elif opt in ("-q", "--quiet"):
            log.level = logger.ERROR
        elif opt in ("-v", "--verbose"):
            log.level = logger.DEBUG
        elif opt in ("-V", "--version"):
            print "%s %s" % (appname, __version__)
            sys.exit()

    try:
        if init:
            if args:
                project_path = args[0]
            else:
                project_path = "."
            init_project(project_path)
        else:
            if not args:
                log.error("You didn't specify any modules for test generation.\n")
                print USAGE % appname
            else:
                generate_tests(args, force, template)

    except KeyboardInterrupt:
        log.info("Interrupted by the user.")
    except Exception: # SystemExit gets through
        log.error("Oops, it seems that an internal Pythoscope error occurred. Please file a bug report at %s\n" % BUGTRACKER_URL)
        raise