[ck2cti] Adjust number of species per line dynamically
This commit is contained in:
parent
7c6ef9d3c4
commit
5ca49efff1
1 changed files with 3 additions and 1 deletions
|
|
@ -1731,8 +1731,10 @@ class Parser(object):
|
|||
raise InputParseError('Undefined elements: ' + str(missingElements))
|
||||
|
||||
speciesNames = ['']
|
||||
speciesPerLine = max(int((80-21)/(speciesNameLength + 2)), 1)
|
||||
|
||||
for i,s in enumerate(self.speciesList):
|
||||
if i and not i % 5:
|
||||
if i and not i % speciesPerLine:
|
||||
speciesNames.append(' '*21)
|
||||
speciesNames[-1] += '{0:{1}s}'.format(s.label, speciesNameLength+2)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue