-
-
Save someara/839552 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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