@@ -184,9 +184,10 @@ def handel_word(self, item, cur_dex):
184184 def end (self ):
185185 cur_dex = self .last_samplenum
186186 #the last annotation
187- self .put_py (self .prv_dex , cur_dex , ['ITEM' , self .saved_item ])
188- self .put_ann (self .prv_dex , cur_dex , [0 , [self .fmt_item .format (self .saved_item )]])
189- self .handel_word (None , cur_dex )
187+ if self .saved_item != None :
188+ self .put_py (self .prv_dex , cur_dex , ['ITEM' , self .saved_item ])
189+ self .put_ann (self .prv_dex , cur_dex , [0 , [self .fmt_item .format (self .saved_item )]])
190+ self .handel_word (None , cur_dex )
190191
191192 def decode (self ):
192193 # Determine which (optional) channels have input data. Insist in
@@ -227,9 +228,9 @@ def decode(self):
227228 num_word_items = self .options ['wordsize' ]
228229 num_word_bits = num_item_bits * num_word_items
229230 num_digits = (num_item_bits + 3 ) // 4
230- self .fmt_item = "{{:0{}X}}" .format (num_digits )
231+ self .fmt_item = "@ {{:0{}X}}" .format (num_digits )
231232 num_digits = (num_word_bits + 3 ) // 4
232- self .fmt_word = "{{:0{}X}}" .format (num_digits )
233+ self .fmt_word = "@ {{:0{}X}}" .format (num_digits )
233234 self .num_item_bits = num_item_bits
234235
235236 # Keep processing the input stream. Assume "always zero" for
0 commit comments