Skip to content

Instantly share code, notes, and snippets.

@someara
Forked from anonymous/gist:839529
Created February 22, 2011 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save someara/839552 to your computer and use it in GitHub Desktop.
Save someara/839552 to your computer and use it in GitHub Desktop.
byte-compiling build/bdist.linux-x86_64/egg/tracscreenshots/tags.py to tags.pyc
byte-compiling build/bdist.linux-x86_64/egg/tracscreenshots/api.py to api.pyc
File "build/bdist.linux-x86_64/egg/tracscreenshots/api.py", line 53
'where' : (' WHERE ' + where) if where else ''}
^
SyntaxError: invalid syntax
byte-compiling build/bdist.linux-x86_64/egg/tracscreenshots/db/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/tracscreenshots/db/db4.py to db4.pyc
class ScreenshotsApi(Component):
default_priority = 0
# Get list functions
def _get_items(self, context, table, columns, where = '', values = ()):
sql_values = {'columns' : ', '.join(columns),
'table' : table,
'where' : (' WHERE ' + where) if where else ''}
sql = ("""SELECT %(columns)s
FROM %(table)s
%(where)s""" % (sql_values))
self.log.debug(sql % values)
context.cursor.execute(sql, values)
items = []
for row in context.cursor:
row = dict(zip(columns, row))
items.append(row)
return items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment