fix for division by 0 problem for projects without any modules

This commit is contained in:
Radovan Bast 2015-06-22 09:24:39 +02:00
parent a72f7f6eba
commit 8c38f35167

View File

@ -194,9 +194,11 @@ def fetch_modules(config, module_directory):
config.sections()))
n = len(l)
list_of_modules = []
if n > 0: # otherwise division by zero in print_progress_bar
i = 0
print_progress_bar(text='- fetching modules:', done=0, total=n, width=30)
list_of_modules = []
for section in config.sections():
if config.has_option(section, 'source'):
for src in config.get(section, 'source').split('\n'):
@ -219,6 +221,7 @@ def fetch_modules(config, module_directory):
width=30
)
print('')
return list_of_modules