예제 #1
0
    def output_text(self):
        authorinfo_list = self.changes.get_authorinfo_list()
        total_changes = 0.0

        for i in authorinfo_list:
            total_changes += authorinfo_list.get(i).insertions
            total_changes += authorinfo_list.get(i).deletions

        if authorinfo_list:
            print(
                textwrap.fill(_(HISTORICAL_INFO_TEXT) + ":",
                              width=terminal.get_size()[0]) + "\n")
            terminal.printb(
                _("Author").ljust(21) + _("Commits").rjust(13) +
                _("Insertions").rjust(14) + _("Deletions").rjust(15) +
                _("% of changes").rjust(16))

            for i in sorted(authorinfo_list):
                authorinfo = authorinfo_list.get(i)
                percentage = 0 if total_changes == 0 else (
                    authorinfo.insertions +
                    authorinfo.deletions) / total_changes * 100

                print(i.ljust(20)[0:20], end=" ")
                print(str(authorinfo.commits).rjust(13), end=" ")
                print(str(authorinfo.insertions).rjust(13), end=" ")
                print(str(authorinfo.deletions).rjust(14), end=" ")
                print("{0:.2f}".format(percentage).rjust(15))
        else:
            print(_(NO_COMMITED_FILES_TEXT) + ".")
예제 #2
0
def output(repo, hard):
    get(repo, hard)
    authorinfo_list = changes.get_authorinfo_list()
    total_changes = 0.0

    for i in authorinfo_list:
        total_changes += authorinfo_list.get(i).insertions
        total_changes += authorinfo_list.get(i).deletions

    if authorinfo_list:
        print "The following historical commit information, by author, was found in the"
        print "repository:\n"
        terminal.printb("Author".ljust(21) + "Commits   " + "Insertions   " +
                        "Deletions   " + "% of changes")

        for i in sorted(authorinfo_list):
            authorinfo = authorinfo_list.get(i)
            percentage = 0 if total_changes == 0 else (
                authorinfo.insertions +
                authorinfo.deletions) / total_changes * 100

            print i.ljust(20)[0:20],
            print str(authorinfo.commits).rjust(7),
            print str(authorinfo.insertions).rjust(12),
            print str(authorinfo.deletions).rjust(11),
            print "{0:.2f}".format(percentage).rjust(14)
    else:
        print "No commited files with the specified extensions were found."
예제 #3
0
	def output_text(self):
		authorinfo_list = self.changes.get_authorinfo_list()
		total_changes = 0.0

		for i in authorinfo_list:
			total_changes += authorinfo_list.get(i).insertions
			total_changes += authorinfo_list.get(i).deletions

		if authorinfo_list:
			print(textwrap.fill(_(HISTORICAL_INFO_TEXT) + ":", width=terminal.get_size()[0]) + "\n")
			terminal.printb(terminal.ljust(_("Author"), 21) + terminal.rjust(_("Commits"), 13) +
			                terminal.rjust(_("Insertions"), 14) + terminal.rjust(_("Deletions"), 15) +
					terminal.rjust(_("% of changes"), 16))

			for i in sorted(authorinfo_list):
				authorinfo = authorinfo_list.get(i)
				percentage = 0 if total_changes == 0 else (authorinfo.insertions + authorinfo.deletions) / total_changes * 100

				print(terminal.ljust(i, 20)[0:20 - terminal.get_excess_column_count(i)], end=" ")
				print(str(authorinfo.commits).rjust(13), end=" ")
				print(str(authorinfo.insertions).rjust(13), end=" ")
				print(str(authorinfo.deletions).rjust(14), end=" ")
				print("{0:.2f}".format(percentage).rjust(15))
		else:
			print(_(NO_COMMITED_FILES_TEXT) + ".")
예제 #4
0
    def output_text(self):
        authorinfo_list = get(self.hard).get_authorinfo_list()
        total_changes = 0.0

        for i in authorinfo_list:
            total_changes += authorinfo_list.get(i).insertions
            total_changes += authorinfo_list.get(i).deletions

        if authorinfo_list:
            print(
                textwrap.fill(__historical_info_text__ + ":",
                              width=terminal.get_size()[0]) + "\n")
            terminal.printb("Author".ljust(21) + "Commits   " +
                            "Insertions   " + "Deletions   " + "% of changes")

            for i in sorted(authorinfo_list):
                authorinfo = authorinfo_list.get(i)
                percentage = 0 if total_changes == 0 else (
                    authorinfo.insertions +
                    authorinfo.deletions) / total_changes * 100

                print(i.ljust(20)[0:20], end=" ")
                print(str(authorinfo.commits).rjust(7), end=" ")
                print(str(authorinfo.insertions).rjust(12), end=" ")
                print(str(authorinfo.deletions).rjust(11), end=" ")
                print("{0:.2f}".format(percentage).rjust(14))
        else:
            print(__no_commited_files__ + ".")
예제 #5
0
def output(repo, hard):
	b = Blame(repo, hard)

	print "\nBelow is the number of rows from each author that have survived and"
	print "are still intact in the current revision:\n"
	terminal.printb("Author".ljust(21) + "      Rows")
	for i in sorted(b.blames.items()):
		print i[0].ljust(20)[0:20],
		print str(i[1]).rjust(10)
예제 #6
0
def output(repo, hard):
    b = Blame(repo, hard)

    print "\nBelow is the number of rows from each author that have survived and"
    print "are still intact in the current revision:\n"
    terminal.printb("Author".ljust(21) + "      Rows")
    for i in sorted(b.blames.items()):
        print i[0].ljust(20)[0:20],
        print str(i[1]).rjust(10)
예제 #7
0
	def output_text(self):
		if sys.stdout.isatty() and format.is_interactive_format():
			terminal.clear_row()

		print(textwrap.fill(_(BLAME_INFO_TEXT) + ":", width=terminal.get_size()[0]) + "\n")
		terminal.printb(_("Author").ljust(21) + _("Rows").rjust(10) + _("% in comments").rjust(20))

		for i in sorted(__blame__.get_summed_blames().items()):
			print(i[0].ljust(20)[0:20], end=" ")
			print(str(i[1].rows).rjust(10), end=" ")
			print("{0:.2f}".format(100.0 * i[1].comments / i[1].rows).rjust(19))
예제 #8
0
	def output_text(self):
		print("")
		get(self.hard)

		if self.hard and sys.stdout.isatty():
			terminal.clear_row()

		print(textwrap.fill(__blame_info_text__ + ":", width=terminal.get_size()[0]) + "\n")
		terminal.printb("Author".ljust(21) + "Rows".rjust(10) + "% in comments".rjust(16))
		for i in sorted(__blame__.get_summed_blames().items()):
			print(i[0].ljust(20)[0:20], end=" ")
			print(str(i[1].rows).rjust(10), end=" ")
			print("{0:.2f}".format(100.0 * i[1].comments / i[1].rows).rjust(15))
예제 #9
0
	def output_text(self):
		if sys.stdout.isatty() and format.is_interactive_format():
			terminal.clear_row()

		print(textwrap.fill(_(BLAME_INFO_TEXT) + ":", width=terminal.get_size()[0]) + "\n")
		terminal.printb(terminal.ljust(_("Author"), 21) + terminal.rjust(_("Rows"), 10) + terminal.rjust(_("Stability"), 15) +
		                terminal.rjust(_("Age"), 13) + terminal.rjust(_("% in comments"), 20))

		for i in sorted(__blame__.get_summed_blames().items()):
			print(terminal.ljust(i[0], 20)[0:20 - terminal.get_excess_column_count(i[0])], end=" ")
			print(str(i[1].rows).rjust(10), end=" ")
			print("{0:.1f}".format(Blame.get_stability(i[0], i[1].rows, self.changes)).rjust(14), end=" ")
			print("{0:.1f}".format(float(i[1].skew) / i[1].rows).rjust(12), end=" ")
			print("{0:.2f}".format(100.0 * i[1].comments / i[1].rows).rjust(19))
예제 #10
0
	def output_text(self):
		if sys.stdout.isatty() and format.is_interactive_format():
			terminal.clear_row()

		print(textwrap.fill(_(BLAME_INFO_TEXT) + ":", width=terminal.get_size()[0]) + "\n")
		terminal.printb(terminal.ljust(_("Author"), 21) + terminal.rjust(_("Rows"), 10) + terminal.rjust(_("Stability"), 15) +
		                terminal.rjust(_("Age"), 13) + terminal.rjust(_("% in comments"), 20))

		for i in sorted(__blame__.get_summed_blames().items()):
			print(terminal.ljust(i[0], 20)[0:20 - terminal.get_excess_column_count(i[0])], end=" ")
			print(str(i[1].rows).rjust(10), end=" ")
			print("{0:.1f}".format(Blame.get_stability(i[0], i[1].rows, self.changes)).rjust(14), end=" ")
			print("{0:.1f}".format(float(i[1].skew) / i[1].rows).rjust(12), end=" ")
			print("{0:.2f}".format(100.0 * i[1].comments / i[1].rows).rjust(19))
예제 #11
0
    def output_text(self):
        if sys.stdout.isatty() and format.is_interactive_format():
            terminal.clear_row()

        print(
            textwrap.fill(_(BLAME_INFO_TEXT) + ":",
                          width=terminal.get_size()[0]) + "\n")
        terminal.printb(
            _("Author").ljust(21) + _("Rows").rjust(10) +
            _("% in comments").rjust(20))

        for i in sorted(__blame__.get_summed_blames().items()):
            print(i[0].ljust(20)[0:20], end=" ")
            print(str(i[1].rows).rjust(10), end=" ")
            print("{0:.2f}".format(100.0 * i[1].comments /
                                   i[1].rows).rjust(19))
	def output_text(self):
		authorinfo_list = get(self.hard).get_authorinfo_list()
		total_changes = 0.0

		for i in authorinfo_list:
			total_changes += authorinfo_list.get(i).insertions
			total_changes += authorinfo_list.get(i).deletions

		if authorinfo_list:
			print(textwrap.fill(__historical_info_text__ + ":", width=terminal.get_size()[0]) + "\n")
			terminal.printb("Author".ljust(21) + "Commits   " + "Insertions   " + "Deletions   " + "% of changes")

			for i in sorted(authorinfo_list):
				authorinfo = authorinfo_list.get(i)
				percentage = 0 if total_changes == 0 else (authorinfo.insertions + authorinfo.deletions) / total_changes * 100

				print(i.ljust(20)[0:20], end=" ")
				print(str(authorinfo.commits).rjust(7), end=" ")
				print(str(authorinfo.insertions).rjust(12), end=" ")
				print(str(authorinfo.deletions).rjust(11), end=" ")
				print("{0:.2f}".format(percentage).rjust(14))
		else:
			print(__no_commited_files__ + ".")