UnboundLocalError
Python 3.11.7: /usr/bin/python3
Mon May 20 08:12:05 2024

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/tutor/public_html/cgi-bin/sndms/Story01.py in <module>
    510 
    511         displayData( db, project, account, pwd, node, NetworkLimit  )
    512 
    513 
=>  514 main()
main = <function main>
 /home/tutor/public_html/cgi-bin/sndms/Story01.py in main()
    509         if ( NetworkLimit < 1 ): NetworkLimit = 100
    510 
=>  511         displayData( db, project, account, pwd, node, NetworkLimit  )
    512 
    513 
global displayData = <function displayData>, db = 'studio', project = 'cocktail', account = 'guest', pwd = 'guest', node = 'SeaBreeze', NetworkLimit = 100
 /home/tutor/public_html/cgi-bin/sndms/Story01.py in displayData(database='studio', project='cocktail', account='guest', password='guest', node='SeaBreeze', NetworkLimit=100)
    483         
    484         if( count <= NetworkLimit ):
=>  485                 displayNetwork( nodelist, edgelist, database, project, account, password, node )
    486         else:
    487                 displayList( nodelist, edgelist, database, project, account, password, node )   
global displayNetwork = <function displayNetwork>, nodelist = [{'class': 'Method', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Method/Build_xs.png', 'id': 'Build', 'infoUrl': None, 'label': 'Build'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/CranberryJuice_xs.png', 'id': 'CranberryJuice', 'infoUrl': None, 'label': 'Cranberry Juice'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/GrapefruitJuice_xs.png', 'id': 'GrapefruitJuice', 'infoUrl': None, 'label': 'Grapefruit Juice'}, {'class': 'Glass', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Glass/HighballGlass_xs.png', 'id': 'HighballGlass', 'infoUrl': None, 'label': 'Highball Glass'}, {'class': 'Garnish', 'iconUrl': None, 'id': 'NoGarnish', 'infoUrl': None, 'label': 'No Garnish'}, {'class': 'Cocktail', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Cocktail/SeaBreeze_xs.png', 'id': 'Seabreeze', 'infoUrl': 'https://en.wikipedia.org/wiki/Sea_Breeze_(cocktail)', 'label': 'Sea Breeze'}, {'class': 'Spirit', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Spirit/Vodka_xs.png', 'id': 'Vodka', 'infoUrl': None, 'label': 'Vodka'}], edgelist = [{'attribute': None, 'relation': 'isMadeBy', 'source': 'Seabreeze', 'target': 'Build'}, {'attribute': '3oz', 'relation': 'useSoftModifier', 'source': 'Seabreeze', 'target': 'CranberryJuice'}, {'attribute': '1/2oz', 'relation': 'useSoftModifier', 'source': 'Seabreeze', 'target': 'GrapefruitJuice'}, {'attribute': None, 'relation': 'isServedIn', 'source': 'Seabreeze', 'target': 'HighballGlass'}, {'attribute': None, 'relation': 'isGarnishedWith', 'source': 'Seabreeze', 'target': 'NoGarnish'}, {'attribute': '1+1/2oz', 'relation': 'useBaseLiquor', 'source': 'Seabreeze', 'target': 'Vodka'}], database = 'studio', project = 'cocktail', account = 'guest', password = 'guest', node = 'SeaBreeze'
 /home/tutor/public_html/cgi-bin/sndms/Story01.py in displayNetwork(nodelist=[{'class': 'Method', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Method/Build_xs.png', 'id': 'Build', 'infoUrl': None, 'label': 'Build'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/CranberryJuice_xs.png', 'id': 'CranberryJuice', 'infoUrl': None, 'label': 'Cranberry Juice'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/GrapefruitJuice_xs.png', 'id': 'GrapefruitJuice', 'infoUrl': None, 'label': 'Grapefruit Juice'}, {'class': 'Glass', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Glass/HighballGlass_xs.png', 'id': 'HighballGlass', 'infoUrl': None, 'label': 'Highball Glass'}, {'class': 'Garnish', 'iconUrl': None, 'id': 'NoGarnish', 'infoUrl': None, 'label': 'No Garnish'}, {'class': 'Cocktail', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Cocktail/SeaBreeze_xs.png', 'id': 'Seabreeze', 'infoUrl': 'https://en.wikipedia.org/wiki/Sea_Breeze_(cocktail)', 'label': 'Sea Breeze'}, {'class': 'Spirit', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Spirit/Vodka_xs.png', 'id': 'Vodka', 'infoUrl': None, 'label': 'Vodka'}], edgelist=[{'attribute': None, 'relation': 'isMadeBy', 'source': 'Seabreeze', 'target': 'Build'}, {'attribute': '3oz', 'relation': 'useSoftModifier', 'source': 'Seabreeze', 'target': 'CranberryJuice'}, {'attribute': '1/2oz', 'relation': 'useSoftModifier', 'source': 'Seabreeze', 'target': 'GrapefruitJuice'}, {'attribute': None, 'relation': 'isServedIn', 'source': 'Seabreeze', 'target': 'HighballGlass'}, {'attribute': None, 'relation': 'isGarnishedWith', 'source': 'Seabreeze', 'target': 'NoGarnish'}, {'attribute': '1+1/2oz', 'relation': 'useBaseLiquor', 'source': 'Seabreeze', 'target': 'Vodka'}], database='studio', project='cocktail', account='guest', password='guest', node='SeaBreeze')
    342                 if not line: break
    343                 if( '#YourData' == line.strip()):
=>  344                         printNodes( nodelist, database, project, account, password, node )
    345                         printLinks( edgelist, node, account )
    346                 else:
global printNodes = <function printNodes>, nodelist = [{'class': 'Method', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Method/Build_xs.png', 'id': 'Build', 'infoUrl': None, 'label': 'Build'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/CranberryJuice_xs.png', 'id': 'CranberryJuice', 'infoUrl': None, 'label': 'Cranberry Juice'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/GrapefruitJuice_xs.png', 'id': 'GrapefruitJuice', 'infoUrl': None, 'label': 'Grapefruit Juice'}, {'class': 'Glass', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Glass/HighballGlass_xs.png', 'id': 'HighballGlass', 'infoUrl': None, 'label': 'Highball Glass'}, {'class': 'Garnish', 'iconUrl': None, 'id': 'NoGarnish', 'infoUrl': None, 'label': 'No Garnish'}, {'class': 'Cocktail', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Cocktail/SeaBreeze_xs.png', 'id': 'Seabreeze', 'infoUrl': 'https://en.wikipedia.org/wiki/Sea_Breeze_(cocktail)', 'label': 'Sea Breeze'}, {'class': 'Spirit', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Spirit/Vodka_xs.png', 'id': 'Vodka', 'infoUrl': None, 'label': 'Vodka'}], database = 'studio', project = 'cocktail', account = 'guest', password = 'guest', node = 'SeaBreeze'
 /home/tutor/public_html/cgi-bin/sndms/Story01.py in printNodes(nodelist=[{'class': 'Method', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Method/Build_xs.png', 'id': 'Build', 'infoUrl': None, 'label': 'Build'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/CranberryJuice_xs.png', 'id': 'CranberryJuice', 'infoUrl': None, 'label': 'Cranberry Juice'}, {'class': 'SoftModifier', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/SoftDrink/GrapefruitJuice_xs.png', 'id': 'GrapefruitJuice', 'infoUrl': None, 'label': 'Grapefruit Juice'}, {'class': 'Glass', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Glass/HighballGlass_xs.png', 'id': 'HighballGlass', 'infoUrl': None, 'label': 'Highball Glass'}, {'class': 'Garnish', 'iconUrl': None, 'id': 'NoGarnish', 'infoUrl': None, 'label': 'No Garnish'}, {'class': 'Cocktail', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Cocktail/SeaBreeze_xs.png', 'id': 'Seabreeze', 'infoUrl': 'https://en.wikipedia.org/wiki/Sea_Breeze_(cocktail)', 'label': 'Sea Breeze'}, {'class': 'Spirit', 'iconUrl': 'http://dh.aks.ac.kr/~tutor/Graph/Cocktail/images/Spirit/Vodka_xs.png', 'id': 'Vodka', 'infoUrl': None, 'label': 'Vodka'}], database='studio', project='cocktail', account='guest', password='guest', subject='SeaBreeze')
    225         
    226         #add show-all-story-nodes button
=>  227         if( subjectClass == 'Story' ) :
    228                 print( "                        nodesArray.push({" )
    229                 print( "                                id: 'switch1'," )
subjectClass undefined

UnboundLocalError: cannot access local variable 'subjectClass' where it is not associated with a value
      add_note = <built-in method add_note of UnboundLocalError object>
      args = ("cannot access local variable 'subjectClass' where it is not associated with a value",)
      name = None
      with_traceback = <built-in method with_traceback of UnboundLocalError object>