Skip to content

Commit c069170

Browse files
iorytkmtnt7000
authored andcommitted
[jsk_robot_startup/smach_to_mail.py] Add space for concatenated base64 images
1 parent 408f551 commit c069170

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,24 @@ def _send_twitter(self, subject, state_list):
197197
if isinstance(subject, bytes):
198198
subject = subject.decode('utf-8')
199199
text += subject
200+
prev_text_type = ''
200201
for x in state_list:
201202
if 'DESCRIPTION' in x and x['DESCRIPTION']:
202203
desc = x['DESCRIPTION']
203204
if isinstance(desc, bytes):
204205
desc = desc.decode('utf-8')
205206
text += '\n' + desc
207+
prev_text_type = 'DESCRIPTION'
206208
if 'IMAGE' in x and x['IMAGE']:
207209
img_txt = x['IMAGE']
208210
if isinstance(img_txt, bytes):
209211
img_txt = img_txt.decode('utf-8')
212+
if prev_text_type == 'IMAGE':
213+
# [rostwitter] Do not concatenate
214+
# multiple base64 images without spaces.
215+
text += ' '
210216
text += img_txt
217+
prev_text_type = 'IMAGE'
211218
if len(text) > 1:
212219
self.pub_twitter.publish(String(text))
213220

0 commit comments

Comments
 (0)