- write(f, 'THING_INVENTORY %s %s' % (thing.id_,
- ','.join([str(i) for i in
- thing.inventory])))
+ if len(thing.inventory) > 0:
+ write(f, 'THING_INVENTORY %s %s' %
+ (thing.id_,','.join([str(i) for i in thing.inventory])))
+ else:
+ write(f, 'THING_INVENTORY %s ,' % thing.id_)