Don't Understand This Error

Victor Subervi victorsubervi at gmail.com
Wed Dec 2 05:33:51 EST 2009


I get the following error:

 /var/www/html/angrynates.com/cart/chooseOptions.py
    8 from login import login
    9 import string
   10 import options
   11 from particulars import optionsTables, addStore
   12
options undefined

SyntaxError: invalid syntax (options.py, line 140)
      args = ('invalid syntax', ('/var/www/html/
angrynates.com/cart/options.py', 140, 85, " colorsTables, colorsNames =
colors('products', 'specificTables', specificTables):\n"))
      filename = '/var/www/html/angrynates.com/cart/options.py'
      lineno = 140
      msg = 'invalid syntax'
      offset = 85
      print_file_and_line = None
      text = " colorsTables, colorsNames = colors('products',
'specificTables', specificTables):\n"

I don't understand the 'text = "..." part of the last line. Here's the line
from the code:

    colorsTables, colorsNames = colors('products', 'specificTables',
specificTables):

No "text". I'm just calling a function and getting the results. Here's the
pared-down function:

def colors(callingTable, which='', specificTables=[]):
  code = []
  names = []
  meanings = []
  code.append({'black': '0000FF', 'gray': '465945', 'silver': '708090',
'white': '0F4D92', 'maroon': 'B03060', 'red': 'FE2712', 'purple': '50404D',
'fuchsia': 'FF77FF', 'green': '00A550', 'lime': '32CD32', 'olive': '6B8E23',
'yellow': '9ACD32', 'navy blue': 'CC7722', 'blue': '333399', 'teal':
'E2725B', 'aqua': '7FFFD4'})
  meanings.append('These are the standard Web colors.')
  names.append('standardWebColors')
  if which == 'specificTables':
    whichTablesToReturn = []
    i = 0
    while i < len(names): # We utilize the name of the table to determine
where it is in the code tuple
      for table in specificTables:
        if names[i] == table:
          whichTablesToReturn.append(i)
      i += 1
    returnTheseTables = []
    for table in whichTablesToReturn:
      returnTheseTables.append(whichTablesToReturn)
    returnTheseNames = []
    for table in whichTablesToReturn:
      returnTheseNames.append(whichTablesToReturn)
    return returnTheseTables, returnTheseNames
  else:
    return optionsDict(which)

Please help me understand what this error is trying to show me.
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091202/b88dbc78/attachment-0001.html>


More information about the Python-list mailing list