Update hb_config.py

.rjust will return the orig string if the len > width.  I just made sure to truncate.
This commit is contained in:
mzingman 2016-07-25 11:05:30 -04:00 committed by GitHub
parent b02438fe4b
commit f8ec4d9069
1 changed files with 6 additions and 6 deletions

View File

@ -56,12 +56,12 @@ def build_config(_config_file):
'LATITUDE': config.get(section, 'LATITUDE').ljust(9),
'LONGITUDE': config.get(section, 'LONGITUDE').ljust(10),
'HEIGHT': config.get(section, 'HEIGHT').rjust(3,'0'),
'LOCATION': config.get(section, 'LOCATION').ljust(20),
'DESCRIPTION': config.get(section, 'DESCRIPTION').ljust(19),
'LOCATION': config.get(section, 'LOCATION').ljust(20)[:20],
'DESCRIPTION': config.get(section, 'DESCRIPTION').ljust(19)[:19],
'SLOTS': config.get(section, 'SLOTS'),
'URL': config.get(section, 'URL').ljust(124),
'SOFTWARE_ID': config.get(section, 'SOFTWARE_ID').ljust(40),
'PACKAGE_ID': config.get(section, 'PACKAGE_ID').ljust(40)
'URL': config.get(section, 'URL').ljust(124)[:124],
'SOFTWARE_ID': config.get(section, 'SOFTWARE_ID').ljust(40)[:40],
'PACKAGE_ID': config.get(section, 'PACKAGE_ID').ljust(40)[:40]
}})
CONFIG['CLIENTS'][section].update({'STATS': {
'CONNECTION': 'NO', # NO, RTPL_SENT, AUTHENTICATED, CONFIG-SENT, YES
@ -85,4 +85,4 @@ def build_config(_config_file):
except:
sys.exit('Could not parse configuration file, exiting...')
return CONFIG
return CONFIG