def contributing_size(repo): matching = glob('CONTRIBUTING*') if not matching: return 0 return max(utils.filesize_or_zero(fn) for fn in matching)
def license_size(repo): matching = glob('LICENSE*') + glob('COPYING*') if not matching: return 0 return max(utils.filesize_or_zero(fn) for fn in matching)
def readme_size(repo): """Size of the readme, in bytes. 0 can mean either non-existant or 0-length.""" matching = glob('*README*') if not matching: return 0 #take the longest filename; hack to emulate GitHub's preference to #eg README.md over README readme_fn = max(matching, key=len) return utils.filesize_or_zero(readme_fn)
def travis_cfg_size(repo): return utils.filesize_or_zero('.travis.yml')
def setuppy_size(repo): return utils.filesize_or_zero('setup.py')