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:
parent
b02438fe4b
commit
f8ec4d9069
12
hb_config.py
12
hb_config.py
@ -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
|
||||||
@ -85,4 +85,4 @@ def build_config(_config_file):
|
|||||||
except:
|
except:
|
||||||
sys.exit('Could not parse configuration file, exiting...')
|
sys.exit('Could not parse configuration file, exiting...')
|
||||||
|
|
||||||
return CONFIG
|
return CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user