Skip to content

Commit 9726fc9

Browse files
iorytkmtnt7000
authored andcommitted
[jsk_robot_startup/smach_to_mail.py] Add space for concatenated base64 images
1 parent e7ec500 commit 9726fc9

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
@@ -177,17 +177,24 @@ def _send_twitter(self, subject, state_list):
177177
if isinstance(subject, bytes):
178178
subject = subject.decode('utf-8')
179179
text += subject
180+
prev_text_type = ''
180181
for x in state_list:
181182
if 'DESCRIPTION' in x and x['DESCRIPTION']:
182183
desc = x['DESCRIPTION']
183184
if isinstance(desc, bytes):
184185
desc = desc.decode('utf-8')
185186
text += '\n' + desc
187+
prev_text_type = 'DESCRIPTION'
186188
if 'IMAGE' in x and x['IMAGE']:
187189
img_txt = x['IMAGE']
188190
if isinstance(img_txt, bytes):
189191
img_txt = img_txt.decode('utf-8')
192+
if prev_text_type == 'IMAGE':
193+
# [rostwitter] Do not concatenate
194+
# multiple base64 images without spaces.
195+
text += ' '
190196
text += img_txt
197+
prev_text_type = 'IMAGE'
191198
if len(text) > 1:
192199
self.pub_twitter.publish(String(text))
193200

0 commit comments

Comments
 (0)