Add API caching support to rbtools.
Review Request #6504 — Created Oct. 24, 2014 and submitted
Add the
rbtools.api.cachemodule. This module includes the
APICacheclass, which allows the results ofHTTP GETrequests to
be cached locally to achieve faster lookup. TheAPICacheunderstands
the following headers:
Cache-ControlPragmaVaryLast-ModifiedETagExpires
The APICache is backed by a SQLite database in the user's cache
directory. If the cache cannot be accessed, the APICache will pass
all requests to the specified urlopen (defaulting to
urllib2.urlopen) method.
The APICache allows for a custom urlopen function so that it can
be tested without making actual HTTP requests.
The APICache stores the version of its schema in the database. If
the APICache is instantiated and the versions of the schema in the
class doesn't match the version of the schema in the database, then
the current cache will be invalidted and the schema will be updated.
Add the ActiveState appdirs module (at version 1.4.0) as
rbtools.utils.appdirs. This module is used to find the user cache
directory in platform-dependant ways.
Add the rbtools.api.cache.Response class which emulates the
behaviour of a urllib2 response. This class allows the read
method to be called more than once.
Add the rbtools.api.cache.CachedResponse class, which is the result
of a cach entry being found the the APICache. It also emulates the
behaviour of a urllib2 response.
Add the clear-cache command. This command manually clears the API
cache.
Added unit tests for the APICache.
Unit tests pass.
The following commands were tested and were successful:
rbt statusrbt postrbt diffrbt patchrbt closerbt clear-cache
Upon clearing the cache with clear-cache, a new cache is created.
The first run of a command always creates cache entries (where
appropriate, i.e., not for PUT or POST requests).
The /api/ endpoint is successfully cached and the cached version is
used.
When using the patch command for the second time on the same review
request, if the diff has not been updated, then the cached version of
the /api/review-requests/<id>/diff/<diff_revision>/ endpoint is
used.
This review request was posted with the APICache enabled.
| Description | From | Last Updated |
|---|---|---|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 34 E128 continuation line under-indented for visual indent |
|
|
|
Col: 5 E303 too many blank lines (2) |
|
|
|
Col: 13 E303 too many blank lines (3) |
|
|
|
Col: 9 E303 too many blank lines (2) |
|
|
|
Col: 5 E303 too many blank lines (2) |
|
|
|
Col: 80 E501 line too long (88 > 79 characters) |
|
|
|
Col: 32 E261 at least two spaces before inline comment |
|
|
|
Col: 5 E303 too many blank lines (2) |
|
|
|
Col: 1 W391 blank line at end of file |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
local variable 'kernel' is assigned to but never used |
|
|
|
undefined name 'kernal' |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
Col: 1 W293 blank line contains whitespace |
|
|
|
Col: 1 W293 blank line contains whitespace |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 9 E303 too many blank lines (2) |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'json' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'json' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'json' imported but unused |
|
|
|
Col: 23 E128 continuation line under-indented for visual indent |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'json' imported but unused |
|
|
|
Switch these two. (cle before clo) |
|
|
|
I know that this module is part of the standard library, but is it always guaranteed to work? I don't … |
|
|
|
Since this will be going into master, and we're bumping the minimum python version, you can change this to just … |
|
|
|
except OSError as e: |
|
|
|
This can go away. |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'json' imported but unused |
|
|
|
Can you alphabetize this list? |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'json' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
These should each be using the :file: markup. (I know we don't have that above, but we should there as … |
|
|
|
We should maybe say the HTTP cache for the API. |
|
|
|
This and the doc page should match the command: clear-cache |
|
|
|
We can just import os. |
|
|
|
This isn't part of Python, so it must go in import group #2. |
|
|
|
This is a Python standard library module, so it can go in the group above. |
|
|
|
What's the reason for setting __slots__ here? Generally speaking, there's rarely a reason to actually set this. It can be … |
|
|
|
The function name and docstring sort of contradict each other. |
|
|
|
Might be worth mentioning that this is intended to be API-compatible with a urllib2's response object. Same with CachedResponse below. … |
|
|
|
Can this be a @staticmethod on ApiCache? |
|
|
|
Trailing period at the end of the log message. Variable on the next line. |
|
|
|
No blank line here. |
|
|
|
These could result in exceptions as well, right? Anything we should be catching here? Also, you could skip doing this … |
|
|
|
No blank line here. |
|
|
|
Unless we're explicitly needing to worry about the difference between None, empty strings, 0, etc., it's usually best to just … |
|
|
|
No blank line. |
|
|
|
In this particular case, it's fine to use \ instead of parens for line continuation. |
|
|
|
No blank line. |
|
|
|
"cacheable" |
|
|
|
No blank line. |
|
|
|
We return response in all of these cases. We should probably just do a single return response at the end. … |
|
|
|
Must be on one line. Doc generators will chop it off otherwise. |
|
|
|
I read this incorrectly at first. Can you add a small comment saying that we restore the old value below? … |
|
|
|
Blank line between these. |
|
|
|
expires can be a separate parameter. |
|
|
|
How about "The C locale is not available on this system. The 'Expires' header cannot be parsed." |
|
|
|
We should actually grab the old locale and set it, instead of calling resetlocale, in case the caller has actually … |
|
|
|
No blank line before elif and else. Same below. |
|
|
|
"posterity's" |
|
|
|
Should be on the same line. I'd rather not do the map/strip trick inline like this, and like the one … |
|
|
|
We don't need to check against None unless there's a reason to worry about empty strings and zero. I believe … |
|
|
|
We should probably catch errors for all these commands. |
|
|
|
Missing a trailing period. |
|
|
|
No blank line here. |
|
|
|
We use dumps to serialize, but are loading above with a custom split. dumps may be too heavy. Can we … |
|
|
|
"ensures" |
|
|
|
Swap these. |
|
|
|
Missing a docstring. |
|
|
|
How about "Deletes the HTTP cache used for the API." |
|
|
|
Rather than this, how about a method on ApiCache for deleting the cache? |
|
|
|
Parameters should go on the line after the log message. |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 13 E303 too many blank lines (2) |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Should go up before logging. |
|
|
|
This blank line should be removed. |
|
|
|
""" on the next line. |
|
|
|
Instead of terminating the process, can we just not cache? RBTools is often run in places where it's locked down … |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'urlopen' imported but unused |
|
|
|
undefined name 'urllib2' |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
'urlopen' imported but unused |
|
|
|
undefined name 'urllib2' |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Should catch sqlite3.Error here and die gracefully. |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
For consistency with the RB database, mind if we use cache_info? |
|
|
|
And api_cache. |
|
|
|
"URL" |
|
|
|
"URL" |
|
|
|
"If-None-Match" |
|
|
|
No blank line. |
|
|
|
No blank line. |
|
|
|
These are only available in Python 2.7+. |
|
|
|
"API" |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
|
|
Col: 80 E501 line too long (96 > 79 characters) |
|
|
|
Col: 80 E501 line too long (93 > 79 characters) |
|
|
|
Col: 38 E261 at least two spaces before inline comment |
|
|
|
Col: 36 E261 at least two spaces before inline comment |
|
|
|
Col: 10 E261 at least two spaces before inline comment |
|
|
|
Col: 1 E303 too many blank lines (3) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (107 > 79 characters) |
|
|
|
Col: 80 E501 line too long (122 > 79 characters) |
|
|
|
Col: 80 E501 line too long (87 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (94 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (92 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (85 > 79 characters) |
|
|
|
Col: 80 E501 line too long (89 > 79 characters) |
|
|
|
Col: 80 E501 line too long (116 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (81 > 79 characters) |
|
|
|
Col: 80 E501 line too long (115 > 79 characters) |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 30 E128 continuation line under-indented for visual indent |
|
|
|
Col: 1 E265 block comment should start with '# ' |
|
|
|
Col: 1 E302 expected 2 blank lines, found 1 |
|
|
|
'win32com' imported but unused |
|
|
|
'windll' imported but unused |
|
|
|
'com' imported but unused |
|
- Change Summary:
-
Formatting.
- Commit:
-
c627b96ab984e257ee15a304c77eb061671d7006e603220a0073b645e35865515af55dc7b90e5214
-
Tool: Pyflakes Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/utils/appdirs.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/utils/appdirs.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Refactor ApiCache to use dependancy injection so that a mockup urlopen can be used. Fully flesh out behaviour. Write unit tests.
- Summary:
-
[WIP] API CachingAdd API caching support to rbtools.
- Description:
-
~ Add an API caching layer to the
ReviewBoardServerclass. All HTTP requests go through that layer so that they may be cached.~ Add the
rbtools.api.cachemodule. This module includes the+ ApiCacheclass, which allows the results ofHTTP GETrequests to+ be cached locally to achieve faster lookup. The ApiCacheunderstands+ the following headers: + + Cache-Control
+ Pragma
+ Vary
+ Last-Modified
+ ETag
+ Expires
+ + The
ApiCacheis backed by a SQLite database in the user's cache+ directory. If the cache cannot be accessed, the ApiCachewill pass+ all requests to the specified urlopen(defaulting to+ urllib2.urlopen) method.+ + The
ApiCacheallows for a customurlopenfunction so that it can+ be tested without making actual HTTP requests. + + Add the ActiveState
appdirsmodule (at version 1.4.0) as+ rbtools.utils.appdirs. This module is used to find the user cache+ directory in platform-dependant ways. + + Add the
rbtools.api.cache.Responseclass which emulates the+ behaviour of a urllib2response. This class allows theread+ method to be called more than once. + + Add the
rbtools.api.cache.CachedResponseclass, which is the result+ of a cach entry being found the the ApiCache. It also emulates the+ behaviour of a urllib2response.+ + Added unit tests for the
ApiCache. - Testing Done:
-
~ TODO:
~ Unit tests pass.
- - - Test if API caching actually works as intendend
- - Write unit tests
- Commit:
-
e603220a0073b645e35865515af55dc7b90e52148f6bef0e66611c51057b60e17bdeeb01e10e9ce0
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/api/request.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/api/request.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 35. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Formatting
- Commit:
-
8f6bef0e66611c51057b60e17bdeeb01e10e9ce0fdaefc92e256302f66a14b83b62c10685e9afd60
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/api/request.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/api/request.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Add
rbt clear-cachecommand and its documentation.Code cleanup and documentation.
- Description:
-
Add the
rbtools.api.cachemodule. This module includes theApiCacheclass, which allows the results ofHTTP GETrequests tobe cached locally to achieve faster lookup. The ApiCacheunderstandsthe following headers: Cache-Control
Pragma
Vary
Last-Modified
ETag
Expires
The
ApiCacheis backed by a SQLite database in the user's cachedirectory. If the cache cannot be accessed, the ApiCachewill passall requests to the specified urlopen(defaulting tourllib2.urlopen) method.The
ApiCacheallows for a customurlopenfunction so that it canbe tested without making actual HTTP requests. Add the ActiveState
appdirsmodule (at version 1.4.0) asrbtools.utils.appdirs. This module is used to find the user cachedirectory in platform-dependant ways. Add the
rbtools.api.cache.Responseclass which emulates thebehaviour of a urllib2response. This class allows thereadmethod to be called more than once. Add the
rbtools.api.cache.CachedResponseclass, which is the resultof a cach entry being found the the ApiCache. It also emulates thebehaviour of a urllib2response.+ Add the
clear-cachecommand. This command manually clears the API+ cache. + Added unit tests for the
ApiCache. - Commit:
-
fdaefc92e256302f66a14b83b62c10685e9afd60a51d81966f9a47a0a308caf69fac855a940e4051
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 34. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Formatting.
- Commit:
-
a51d81966f9a47a0a308caf69fac855a940e4051d8cd9cdcc7fa41dc1bfe74469a5a390bdcf37e75
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Fix formatting and a typo.
- Commit:
-
d8cd9cdcc7fa41dc1bfe74469a5a390bdcf37e7551df36687952c5ef71bd31903af69a534aae9b45
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Add todo to description.
- Summary:
-
Add API caching support to rbtools.[WIP] Add API caching support to rbtools.
- Description:
-
Add the
rbtools.api.cachemodule. This module includes theApiCacheclass, which allows the results ofHTTP GETrequests tobe cached locally to achieve faster lookup. The ApiCacheunderstandsthe following headers: Cache-Control
Pragma
Vary
Last-Modified
ETag
Expires
The
ApiCacheis backed by a SQLite database in the user's cachedirectory. If the cache cannot be accessed, the ApiCachewill passall requests to the specified urlopen(defaulting tourllib2.urlopen) method.The
ApiCacheallows for a customurlopenfunction so that it canbe tested without making actual HTTP requests. Add the ActiveState
appdirsmodule (at version 1.4.0) asrbtools.utils.appdirs. This module is used to find the user cachedirectory in platform-dependant ways. Add the
rbtools.api.cache.Responseclass which emulates thebehaviour of a urllib2response. This class allows thereadmethod to be called more than once. Add the
rbtools.api.cache.CachedResponseclass, which is the resultof a cach entry being found the the ApiCache. It also emulates thebehaviour of a urllib2response.Add the
clear-cachecommand. This command manually clears the APIcache. Added unit tests for the
ApiCache.+ + TODO:
+ - Allow the ApiCache to be invalidated, eg by an update to the schema. + The db should have an Infotable with a version field that+ indicates the current schema version. The ApiCache should request this + value on startup and if it is out of date with the version in the class, + it should invalidate (i.e. wipe) the cache. + - Handle special case that when Vary: header field changes, we should check + if a record exists for the url, new headers tuple before blindly inserting + because this may violate the (url, headers) uniqueness constraint.
- Change Summary:
-
Allow
ApiCacheto be invalidated.Move
ApiCache._insert_entryandApiCache._update_entrytoApiCache._save_entrywhich performs the funcationality of both. - Description:
-
Add the
rbtools.api.cachemodule. This module includes theApiCacheclass, which allows the results ofHTTP GETrequests tobe cached locally to achieve faster lookup. The ApiCacheunderstandsthe following headers: Cache-Control
Pragma
Vary
Last-Modified
ETag
Expires
The
ApiCacheis backed by a SQLite database in the user's cachedirectory. If the cache cannot be accessed, the ApiCachewill passall requests to the specified urlopen(defaulting tourllib2.urlopen) method.The
ApiCacheallows for a customurlopenfunction so that it canbe tested without making actual HTTP requests. + The
ApiCachestores the version of its schema in the database. If+ the ApiCacheis instantiated and the versions of the schema in the+ class doesn't match the version of the schema in the database, then + the current cache will be invalidted and the schema will be updated. + Add the ActiveState
appdirsmodule (at version 1.4.0) asrbtools.utils.appdirs. This module is used to find the user cachedirectory in platform-dependant ways. Add the
rbtools.api.cache.Responseclass which emulates thebehaviour of a urllib2response. This class allows thereadmethod to be called more than once. Add the
rbtools.api.cache.CachedResponseclass, which is the resultof a cach entry being found the the ApiCache. It also emulates thebehaviour of a urllib2response.Add the
clear-cachecommand. This command manually clears the APIcache. Added unit tests for the
ApiCache.- - TODO:
- - Allow the ApiCache to be invalidated, eg by an update to the schema. - The db should have an Infotable with a version field that- indicates the current schema version. The ApiCache should request this - value on startup and if it is out of date with the version in the class, - it should invalidate (i.e. wipe) the cache. - - Handle special case that when Vary: header field changes, we should check - if a record exists for the url, new headers tuple before blindly inserting - because this may violate the (url, headers) uniqueness constraint. - Commit:
-
51df36687952c5ef71bd31903af69a534aae9b4562a5c47b9ec5ea52c88efeb4c3a4e38a7eb66719
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 33. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Formatting.
- Commit:
-
62a5c47b9ec5ea52c88efeb4c3a4e38a7eb66719d5421aa791e6b5eced10dada42388d4ded15ebb9
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
I know that this module is part of the standard library, but is it always guaranteed to work? I don't want users to have to install anything other than python.
-
Since this will be going into master, and we're bumping the minimum python version, you can change this to just be
import jsonand usejson.loadsandjson.dumps -
-
-
- Change Summary:
-
Fix issues in David's review.
- Commit:
-
d5421aa791e6b5eced10dada42388d4ded15ebb9af9417d5c4d0c1e889f879fb0de1ea74c2965145
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This change looks pretty good to me, but I'd like some details on manual testing of the individual rbtools commands.
- Change Summary:
-
Write the API cache to disk. Do not treat 304 as an error code.
Add debugging logs.
- Commit:
-
af9417d5c4d0c1e889f879fb0de1ea74c296514575fc708596acda760475263b6540df4d1d7fb0df
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Add dependancy on r/6548 so that
six.iteritemscan be used.Cache the Vary Headers correctly -- if none are sent, we need to record that none were sent.
Minor formatting and rename headers to vary_headers when referring specifically to the Vary header
Add testing info.
- Testing Done:
-
~ Unit tests pass.
~ The following commands were tested and were successful:
+ + rbt status
+ rbt post
+ rbt diff
+ rbt patch
+ rbt close
+ rbt clear-cache
+ + Upon clearing the cache with
clear-cache, a new cache is created.+ The first run of a command always creates cache entries (where + appropriate, i.e., not for PUT or POST requests). + + The
/api/endpoint is successfully cached and the cached version is+ used. + + When using the
patchcommand for the second time on the same review+ request, if the diff has not been updated, then the cached version of + the /api/review-requests/<id>/diff/<diff_revision>/endpoint is+ used. + + This review request was posted with the
ApiCacheenabled.
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/rbt/commands/clearcache.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Add note about unit tests passing.
- Testing Done:
-
+ Unit tests pass.
+ The following commands were tested and were successful:
rbt status
rbt post
rbt diff
rbt patch
rbt close
rbt clear-cache
Upon clearing the cache with
clear-cache, a new cache is created.The first run of a command always creates cache entries (where appropriate, i.e., not for PUT or POST requests). The
/api/endpoint is successfully cached and the cached version isused. When using the
patchcommand for the second time on the same reviewrequest, if the diff has not been updated, then the cached version of the /api/review-requests/<id>/diff/<diff_revision>/endpoint isused. This review request was posted with the
ApiCacheenabled.
-
<p>Looking pretty awesome!</p>
<p>Caught some typos and style differences. The general logic looks pretty thorough and correct from what I can tell so far.</p> -
These should each be using the
:file:markup. (I know we don't have that above, but we should there as well.):file:`~/.cache/.rbtools/apicache.db` -
-
-
-
-
-
What's the reason for setting
__slots__here?Generally speaking, there's rarely a reason to actually set this. It can be used for memory performance reasons, but unless we're expecting a large number of these to stick around in memory for a while, we probably don't gain enough to warrant here.
-
-
Might be worth mentioning that this is intended to be API-compatible with a urllib2's response object. Same with
CachedResponsebelow.Also, maybe we should call this
HTTPResponse? AndCachedHTTPResponsebelow? Just to make it more specific. (Not sure, just floating the idea.) -
-
-
-
These could result in exceptions as well, right? Anything we should be catching here?
Also, you could skip doing this connect twice by doing:
cache_is_new = not os.path.exists(self.cache_path): if cache_is_new: # All the setup stuff for creating self.db = sqlite3.connect(...) if not cache_is_new: # Check version, etc. -
-
Unless we're explicitly needing to worry about the difference between None, empty strings, 0, etc., it's usually best to just do
if entry:.Same below.
-
-
-
-
-
-
We return
responsein all of these cases. We should probably just do a singlereturn responseat the end.The code above that returns a
CachedResponsecan just assign that toresponseto take advantage of the single exit point. -
-
I read this incorrectly at first. Can you add a small comment saying that we restore the old value below?
Also, this isn't thread-safe. Not a massive deal right now, but potentially problematic later. Easily fixed with doing all this in a
threading.Lock(). -
-
-
-
We should actually grab the old locale and set it, instead of calling
resetlocale, in case the caller has actually set a custom locale before all this. -
-
-
Should be on the same line.
I'd rather not do the map/strip trick inline like this, and like the one above. Instead, can we make a utility function for parsing headr values, and use a list comprehension?
return [ s.strip() for s in headers.split(',') ] -
We don't need to check against None unless there's a reason to worry about empty strings and zero. I believe those values are just as None-worthy as None for our purposes.
-
-
-
-
We use
dumpsto serialize, but are loading above with a custom split.dumpsmay be too heavy. Can we just do a join? -
-
-
-
-
-
- Change Summary:
-
Fix most issues outline in Christian's review.
- Commit:
-
75fc708596acda760475263b6540df4d1d7fb0df6daa3bb7890476147224b5cd959cad465a86de64
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 34. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Formatting. Fix
_split_csvusage. - Commit:
-
6daa3bb7890476147224b5cd959cad465a86de644d80bfe6d1e37a1a777a3453419025f50e4fe206
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Catch exceptions around DB interaction and die gracefully. Rename
ApiCachetoAPICache. - Description:
-
Add the
rbtools.api.cachemodule. This module includes the~ ApiCacheclass, which allows the results ofHTTP GETrequests to~ be cached locally to achieve faster lookup. The ApiCacheunderstands~ APICacheclass, which allows the results ofHTTP GETrequests to~ be cached locally to achieve faster lookup. The APICacheunderstandsthe following headers: Cache-Control
Pragma
Vary
Last-Modified
ETag
Expires
~ The
ApiCacheis backed by a SQLite database in the user's cache~ directory. If the cache cannot be accessed, the ApiCachewill pass~ The
APICacheis backed by a SQLite database in the user's cache~ directory. If the cache cannot be accessed, the APICachewill passall requests to the specified urlopen(defaulting tourllib2.urlopen) method.~ The
ApiCacheallows for a customurlopenfunction so that it can~ The
APICacheallows for a customurlopenfunction so that it canbe tested without making actual HTTP requests. ~ The
ApiCachestores the version of its schema in the database. If~ the ApiCacheis instantiated and the versions of the schema in the~ The
APICachestores the version of its schema in the database. If~ the APICacheis instantiated and the versions of the schema in theclass doesn't match the version of the schema in the database, then the current cache will be invalidted and the schema will be updated. Add the ActiveState
appdirsmodule (at version 1.4.0) asrbtools.utils.appdirs. This module is used to find the user cachedirectory in platform-dependant ways. Add the
rbtools.api.cache.Responseclass which emulates thebehaviour of a urllib2response. This class allows thereadmethod to be called more than once. Add the
rbtools.api.cache.CachedResponseclass, which is the result~ of a cach entry being found the the ApiCache. It also emulates the~ of a cach entry being found the the APICache. It also emulates thebehaviour of a urllib2response.Add the
clear-cachecommand. This command manually clears the APIcache. ~ Added unit tests for the
ApiCache.~ Added unit tests for the
APICache. - Testing Done:
-
Unit tests pass.
The following commands were tested and were successful:
rbt status
rbt post
rbt diff
rbt patch
rbt close
rbt clear-cache
Upon clearing the cache with
clear-cache, a new cache is created.The first run of a command always creates cache entries (where appropriate, i.e., not for PUT or POST requests). The
/api/endpoint is successfully cached and the cached version isused. When using the
patchcommand for the second time on the same reviewrequest, if the diff has not been updated, then the cached version of the /api/review-requests/<id>/diff/<diff_revision>/endpoint isused. ~ This review request was posted with the
ApiCacheenabled.~ This review request was posted with the
APICacheenabled. - Commit:
-
4d80bfe6d1e37a1a777a3453419025f50e4fe2064dae797d0162a1d4cc7be4a70eebc45d3db6a95c
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Use
six.movesforurlopen - Commit:
-
4dae797d0162a1d4cc7be4a70eebc45d3db6a95c7a11e691618eabfae4cf7dc22efed117e43d312d
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Rebased off master. Fixed some of Christian's issues.
- Commit:
-
7a11e691618eabfae4cf7dc22efed117e43d312db7dad8144b2faec94be41fa994d2c66d4ca70849
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Make this review request depend on David's
Use six.moves for StringIOreview request. - Depends On:
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Add a try..except around the last DB operation.
- Commit:
-
b7dad8144b2faec94be41fa994d2c66d4ca7084970ecb18842064c517f0628b59166c57d07c74bca
-
Tool: Pyflakes Processed Files: rbtools/utils/testbase.py rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/utils/testbase.py rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Rename
APICache->api_cacheandCacheInfo->cache_infoin database.Switch to using
assertTrue/assertFalsewithisinstanceinstead ofassertIsInstanceOf/assertIsNotInstanceOfin tests. - Commit:
-
70ecb18842064c517f0628b59166c57d07c74bca89b50a0c9afb40e80f761b7ba5ddbb9d6b2a5320
-
Tool: Pyflakes Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/tests.py rbtools/utils/appdirs.py rbtools/commands/clearcache.py rbtools/api/cache.py setup.py rbtools/api/request.py Ignored Files: rbtools/utils/COPYING.appdirs docs/rbtools/rbt/commands/clear-cache.rst rbtools/utils/README.appdirs docs/rbtools/rbt/commands/index.rst docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 32. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/utils/appdirs.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/utils/appdirs.py rbtools/api/cache.py Ignored Files: rbtools/utils/COPYING.appdirs rbtools/utils/README.appdirs docs/rbtools/index.rst WARNING: Number of comments exceeded maximum, showing 30 of 42.