Esempio n. 1
0
def printBasicInfo(url, commit, name, formated=True):
	fmt_obj = FormatedPrint(formated)
	fmt_obj.printInfo("Repo URL: %s" % url)
	fmt_obj.printInfo("Commit: %s" % commit)
	fmt_obj.printInfo("Name: %s" % name)
Esempio n. 2
0
	parser = CmdSignatureParser([gen_flags]).generate().parse()
	if not parser.check():
		exit(1)

	options = parser.options()
	args = parser.args()

	# get list of tools/packages providing go binary
	pkg_name = ""
	if len(args) > 0:
		pkg_name = args[0]

	Logger.set(options.verbose)

	fp = FormatedPrint()

	scan_time_start = time()
	if not options.cyclic and not options.leaves and not options.roots and not options.graphviz:
		print "Synopsis: prog [-d --from-dir|--from-xml] -c|-l|-r|-g [-v] [PACKAGE]"
		exit(1)

	scan_time_start = time()
	if options.decompose != "":
		if options.fromdir == "":
			fp.printError("--from-dir option is missing")
			exit(1)
		dataset = LocalProjectDatasetBuilder(options.fromdir, options.decompose).build()
		graph = DatasetDependencyGraphBuilder().build(dataset, 2, pkg_name)
	else:
		try:
Esempio n. 3
0
        exit(1)

    options = parser.options()
    args = parser.args()

    # TODO(jchaloup): finish the flag handeling
    #parser.add_option(
    #    "", "", "--include-tests", dest="includetests", action = "store_true", default = False,
    #    help = "Include dependencies for test too"
    #)

    path = "."
    if len(args):
        path = args[0]

    fmt_obj = FormatedPrint()

    if not options.scanalldirs:
        noGodeps = Config().getSkippedDirectories()
    else:
        noGodeps = []

    if options.skipdirs:
        for dir in options.skipdirs.split(','):
            dir = dir.strip()
            if dir == "":
                continue
            noGodeps.append(dir)

    data = {
        "type": "user_directory",
Esempio n. 4
0
		pkg_in_pkgdb = PkgDBClient().packageExists(pkg_name)
		if pkg_in_pkgdb:
			print (GREEN + "\tClass: %s (%s) PkgDB=%s" + ENDC) % (element, pkg_name, pkg_in_pkgdb)
		else:
			print (RED + "\tClass: %s (%s) PkgDB=%s" + ENDC ) % (element, pkg_name, pkg_in_pkgdb)

if __name__ == "__main__":

	options, args = setOptions()

	if checkOptions(options):
		exit(1)

	Logger.set(options.verbose)

	fmt_obj = FormatedPrint(options.format)

	if not options.format:
		ENDC = ""
		RED = ""
		GREEN = ""

	if options.detect == "":
		# collect spec file information
		project = options.project
		repo = options.repo
		if not options.googlecode and project == "":
			fmt_obj.printError("Project missing")
			exit(1)

		if repo == "":
Esempio n. 5
0
File: lint.py Progetto: KotyVM/gofed
	archive = fd.getArchive()

	# if options only files detection
	if options.info:
		exit(0)

	if options.archive:
		archive = options.archive

	if options.spec:
		specfile = options.spec

	if options.sources:
		sources = options.sources

	fp_obj = FormatedPrint(formated=True)

	if options.sourcecodedirectory == "" and archive == "":
		fp_obj.printError("archive not set")
		exit(1)

	if specfile == "":
		fp_obj.printError("specfile not set")
		exit(1)

	if not options.scanalldirs:
		noGodeps = Config().getSkippedDirectories()
	else:
		noGodeps = []

	if options.skipdirs:
Esempio n. 6
0
    archive = fd.getArchive()

    # if options only files detection
    if options.info:
        exit(0)

    if options.archive:
        archive = options.archive

    if options.spec:
        specfile = options.spec

    if options.sources:
        sources = options.sources

    fp_obj = FormatedPrint(formated=True)

    if options.sourcecodedirectory == "" and archive == "":
        fp_obj.printError("archive not set")
        exit(1)

    if specfile == "":
        fp_obj.printError("specfile not set")
        exit(1)

    if not options.scanalldirs:
        noGodeps = Config().getSkippedDirectories()
    else:
        noGodeps = []

    if options.skipdirs:
Esempio n. 7
0
		parser = CmdSignatureParser([gen_flags, "%s/tools.yml" % (cur_dir)])
	elif program_name == "bbobranches":
		parser = CmdSignatureParser([gen_flags, "%s/bbo.yml" % (cur_dir)])
	elif program_name == "update":
		parser = CmdSignatureParser([gen_flags, "%s/update.yml" % (cur_dir)])
	else:
		parser = CmdSignatureParser([gen_flags])

	parser.generate().parse()
	if not parser.check():
		exit(1)

	options = parser.options()
        args = parser.args()

	fp_obj = FormatedPrint(formated=False)

	branches = Config().getBranches()
	if options.branches != "":
		bs = filter(lambda b: b != "", options.branches.split(","))
		for branch in bs:
			if branch in branches:
				continue

			print "%s branch not in a list of all branches" % branch
			exit(1)

		branches = bs

	if options.ebranches != "":
		ebs = filter(lambda b: b != "", options.ebranches.split(","))
Esempio n. 8
0
def printBasicInfo(url, commit, name, formated=True):
    fmt_obj = FormatedPrint(formated)
    fmt_obj.printInfo("Repo URL: %s" % url)
    fmt_obj.printInfo("Commit: %s" % commit)
    fmt_obj.printInfo("Name: %s" % name)
Esempio n. 9
0
    elif program_name == "googlecode2gospec":
        subcmd_flags = "%s/googlecode2gospec.yml" % (cur_dir)
        provider = "googlecode"
    elif program_name == "bitbucket2gospec":
        subcmd_flags = "%s/bitbucket2gospec.yml" % (cur_dir)
        provider = "bitbucket"

    parser = CmdSignatureParser([gen_flags, subcmd_flags]).generate().parse()
    if not parser.check():
        exit(1)

    options = parser.options()

    Logger.set(options.verbose)

    fmt_obj = FormatedPrint(options.format)

    if not options.format:
        ENDC = ""
        RED = ""
        GREEN = ""

    if provider == "":
        if options.github:
            provider = "github"
        elif options.bitbucket:
            provider = "bitbucket"
        elif options.googlecode:
            provider = "googlecode"

    # collect spec file information