fossasia / kniteditor

Kniteditor
https://fossasia.github.io/kniteditor
GNU Lesser General Public License v3.0
1.51k stars 29 forks source link

Reproduce and Fix Error #26

Closed niccokunzmann closed 8 years ago

niccokunzmann commented 8 years ago

This error happened while knitting:

 Exception in thread Thread-1:
 Traceback (most recent call last):
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\threading.py", line 911, in _bootstrap_inner
     self.run()
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\threading.py", line 859, in run
     self._target(*self._args, **self._kwargs)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 278, in _parallel_receive_loop
     self.receive_message()
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 102, in receive_message
     self._message_received(message)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 82, in _message_received
     self._state.receive_message(message)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 51, in receive_message
     message.received_by(self)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\hardware_messages.py", line 355, in received_by
     visitor.receive_line_request(self)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 474, in receive_line_request
     self._next(KnittingLine, message.line_number)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 193, in _next
     self._communication.state = state_class(self._communication, *args)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 180, in state
     self._state.enter()
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 513, in enter
     self._communication.send(LineConfirmation, self._line_number)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 148, in send
     message.send()
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\host_messages.py", line 52, in send
     self._file.write(self.as_bytes())
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\host_messages.py", line 48, in as_bytes
     return bytes([self.MESSAGE_ID]) + self.content_bytes()
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\host_messages.py", line 145, in content_bytes
     return get_message(self._line_number)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\cache.py", line 67, in get_line_configuration_message
     line_bytes += bytes([self.is_last(line_number)])
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\cache.py", line 35, in is_last
     return self.get(line_number + 1) is None
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\cache.py", line 26, in get
     self._get_cache[line_number] = self._get(line_number)
   File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\interaction.py", line 88, in _get_needle_positions
     color_index = colors.index(color)
 ValueError: 'black' is not in list

Hints:

Solution:

The number of colors is required and useful for many applications. In knittingpattern add the following methods:

Also,