Calvin Computer Science Pop Machine

Pop vended

Type Price Stock Today Total
Coke $1.0 Sold Out --> -->
 
 
<type 'exceptions.TypeError'>
Python 2.7.6: /usr/bin/python2
Mon Jun 26 23:44:20 2017

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /home/popmachine/web/popmachine.py in ()
    106 print "<table class='mainTable'>"
    107 print "<tr><td style='vertical-align: top'>"
=>  108 infoTable( conn )
    109 print "<h3>Twitter</h3>"
    110 print twitterWidget
infoTable = <function infoTable>, conn = <_mysql.connection open to 'localhost' at 2728150>
 /home/popmachine/popmachine/web_interface/statuslib.py in infoTable(conn=<_mysql.connection open to 'localhost' at 2728150>)
    114 
    115                 # Today
=>  116                 print "<td>", last_row[3] - midnight_row[3], "</td>"
    117                 # Since began tracking
    118                 print "<td>", last_row[3] - first_row[3], "</td>"
last_row = (1491971530L, 1L, 1.0, 2044L, 'Coke'), midnight_row = None

<type 'exceptions.TypeError'>: 'NoneType' object has no attribute '__getitem__'
      args = ("'NoneType' object has no attribute '__getitem__'",)
      message = "'NoneType' object has no attribute '__getitem__'"