Changeset 114
- Timestamp:
- 07/26/06 17:10:45 (7 years ago)
- Files:
-
- branches/mk/cheesecake/cheesecake_index.py (modified) (14 diffs)
- branches/mk/cheesecake/util.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/cheesecake/cheesecake_index.py
r111 r114 662 662 663 663 class IndexUrlDownload(Index): 664 """Give points for successful downloading of a package. 665 """ 664 666 max_value = 25 665 667 … … 677 679 678 680 class IndexUnpack(Index): 681 """Give points for successful unpacking of a package archive. 682 """ 679 683 max_value = 25 680 684 … … 684 688 self.value = self.max_value 685 689 else: 690 self.details = "package couldn't be unpacked" 686 691 self.value = 0 687 692 … … 689 694 690 695 class IndexUnpackDir(Index): 696 """Check if package unpack directory resembles package archive name. 697 """ 691 698 max_value = 15 692 699 … … 707 714 708 715 class IndexSetupPy(FilesIndex): 716 """Reward packages that have setup.py file. 717 """ 709 718 name = "setup.py" 710 719 max_value = 25 … … 728 737 729 738 class IndexInstall(Index): 739 """Check if package can be installed via "python setup.py" command. 740 """ 730 741 max_value = 50 731 742 … … 744 755 745 756 class IndexPyPIDownload(Index): 757 """Check if package was successfully downloaded from PyPI 758 and how far from it actual package was. 759 760 Distance is number of links user have to follow to download 761 a given software package. 762 """ 746 763 max_value = 50 747 764 distance_penalty = -5 … … 776 793 777 794 class IndexGeneratedFiles(Index): 795 """Lower score for automatically generated files that should 796 not be present in a package. 797 """ 778 798 generated_files_penalty = -20 779 799 max_value = 0 … … 814 834 815 835 class IndexRequiredFiles(FilesIndex): 836 """Check for existence of important files, like README or INSTALL. 837 """ 816 838 cheese_files = { 817 839 Doc('readme'): 30, … … 841 863 def make_info(dictionary, what): 842 864 missing = self.get_not_used(dictionary.keys()) 843 importance = {30: ' critical', 20: ' important' , 10: ''}865 importance = {30: ' critical', 20: ' important'} 844 866 info = [] 845 867 … … 851 873 if key in missing: 852 874 msg = negative_msg 853 info.append(msg % (index_class_to_name(self.name), importance [dictionary[key]], what, str(key)))875 info.append(msg % (index_class_to_name(self.name), importance.get(dictionary[key], ''), what, str(key))) 854 876 855 877 return ''.join(info) … … 871 893 872 894 class IndexDocstrings(Index): 895 """Compute how many objects have relevant docstrings. 896 """ 873 897 max_value = 100 874 898 … … 887 911 888 912 class IndexFormattedDocstrings(Index): 913 """Compute how many of existing docstrings include any formatting, 914 like epytext or reST. 915 """ 889 916 max_value = 30 890 917 … … 959 986 class IndexUseTestFramework(Index): 960 987 """Check if a package uses any of known test frameworks. 961 962 Currently only checking for doctest.963 988 """ 964 989 max_value = 30 branches/mk/cheesecake/util.py
r108 r114 1 """Utility functions for Cheesecake project. 2 """ 3 1 4 import os 2 5 import shutil
