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

View File

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