Commit Graph

124 Commits

Author SHA1 Message Date
03fab52da2 Prevent KeyError when thumbnail has no link.
This can happen when the link isn't refreshing properly. It's better to
show an empty thumbnail than a 500 Internal Server Error.
2016-05-31 17:57:08 +02:00
4b028d85c9 Added exception for HTTP 412/Precondition Failed 2016-05-30 14:54:27 +02:00
b1c2b105af Expose Resource class at top module level 2016-05-23 18:12:22 +02:00
2d195c7cd3 Added User.me() and Find.find_from_endpoint() class methods. 2016-05-23 14:19:14 +02:00
75d71b824f Bumped version to 1.2.0 version-1.2.0 2016-05-18 15:26:17 +02:00
3e223bcc9f Added List.all_from_endpoint(url) function.
This is useful when resources should be loaded from a custom Pillar
endpoint.
2016-05-18 13:02:26 +02:00
cfa8840c64 Add URL in error messages. 2016-05-18 13:02:02 +02:00
8312388641 Removed File.thumbnail_file in favour of File.thumbnail 2016-05-13 10:51:26 +02:00
bea3385866 Bumped version to 1.1.2 version-1.1.2 2016-05-10 15:03:28 +02:00
d7370eee33 Updated changelog 2016-05-10 15:03:09 +02:00
99d46593bf made "'field' in resource" work 2016-05-10 15:02:27 +02:00
a9920fa76a Files: Get thumbnails from variations, rather than from 'link' property
The 'link' property might not exist, for example when a user is not a
Cloud subscriber.
2016-05-10 12:45:27 +02:00
1e44703147 Don't include *.md files in wheel.
Those are installed in /usr/lib/pillarsdk or /path/to/venv/lib/pillarsdk,
which is too far away from the Python package itself.
2016-05-09 15:03:14 +02:00
56da7923d7 Bumped version to 1.1.1 version-1.1.1 2016-05-09 14:36:25 +02:00
a229251f62 Gracefully handle missing 'allowed_methods' 2016-05-09 14:34:25 +02:00
a6364f338e Bumped version to 1.1.0 version-1.1.0 2016-05-09 12:19:58 +02:00
6f251feab8 Updated changelog 2016-05-09 12:16:20 +02:00
2664c7bf8b Use new /p/create entry point for project creation
Instead of POSTing to /projects, we now use /p/create to create a new
project.
2016-05-09 11:17:46 +02:00
e9289e05f3 Updated changelog 2016-05-06 10:50:14 +02:00
ef6ea3a927 Little tweak. 2016-05-06 10:49:35 +02:00
eb5ad24a32 User management functions for projects 2016-05-06 10:43:24 +02:00
348e9d6c19 Include README.md, LICENSE.md and CHANGELOG.md in wheel. version-1.0.1 2016-05-06 10:30:52 +02:00
611910372e Added changelog 2016-05-06 10:28:39 +02:00
ecbaf5ab97 Added script to update version numbers in all relevant places. 2016-05-06 10:26:51 +02:00
3cad957a4d Bumped version to 1.0.1 2016-05-06 10:26:41 +02:00
6c51cc7321 Tokens: pass None password as '' 2016-05-06 10:18:58 +02:00
22825e31ad Bumped version to 1.0.0 version-1.0.0 2016-05-04 14:39:22 +02:00
f3fd48cd9f Bumped version to 0.1.1 version-0.1.1 2016-05-04 14:11:00 +02:00
38de7d6433 Include subclient-ID in the password field when authenticating with token. 2016-05-04 14:08:46 +02:00
312b5816cc Bumped version to 0.1.0 and added me as co-author 2016-05-03 12:22:52 +02:00
7e5f399ce9 Renamed the pypi package from pillar-sdk to pillarsdk
Now the package on pypi is named the same as the Python package, i.e.
the package is stored in '{name}-blah.whl' and
'import {name}' works for the same name='pillarsdk'.
2016-05-03 12:22:48 +02:00
05c99e9a41 Typo in setup.py 2016-05-03 12:12:35 +02:00
b74053a95b Support getting /latest node type entry point 2016-05-02 19:05:53 +02:00
e088b56560 Pop more _deleted attributes. 2016-05-02 17:43:06 +02:00
838fbd14ae Remove _deleted private key 2016-04-29 10:01:11 +02:00
d60a1878e7 Skip missing keys in convert_datetime 2016-04-26 17:33:36 +02:00
e6ef3c2332 Pass empty password when using token 2016-04-13 15:32:10 +02:00
463eb068f6 Ensuring more projections 2016-04-13 15:31:58 +02:00
9a51c82d9a Added util function for filename sanitation 2016-03-22 14:32:34 +01:00
dac5d638da Added support for saving Pillar resources as JSON. 2016-03-22 12:42:31 +01:00
2c39a88cfe Removed unused import 2016-03-22 12:42:13 +01:00
20a9c61fac Include link & link_expires in mandatory projections for File. 2016-03-22 12:41:41 +01:00
ba15c830c5 PEP8 formatting 2016-03-18 16:56:28 +01:00
886e3c7eaf Sort parameters on the URL to allow caching.
Python randomizes dict item order with a random seed, which changes every
time Python/Blender is run. As a result, Pillar GET parameters on the URL
would change, making them uncachable. Sorting the parameters solves this.
2016-03-18 16:37:16 +01:00
1ec234716a Log to 'pillarsdk.api' logger, instead of the root logger.
Also switched to percent-formatting, as this allows the logging module
to skip string formatting altogether if the log entry is filtered out
(for example for INFO messages on a logger with level=WARNING).
2016-03-18 14:00:55 +01:00
c8cc82f96b Don't assume UTF-8, just use content encoding from HTTP headers. 2016-03-18 13:56:26 +01:00
2ef050dd8f Simplified code 2016-03-18 12:41:36 +01:00
0fd043ecb8 Support session objects.
This not only improves general performance by sharing socket connections
between HTTP calls, but also allows for caching with Requests-Cache.
2016-03-18 12:41:24 +01:00
914e8f9eaa Moved _ensure_projections(...) up from Find to Resource
It's now also used in List
2016-03-18 10:59:57 +01:00
bcde995e64 Tweak to Project update
Now we use utils.remove_none_attributes to remove None values, and
revert to file _id only if it exists.
2016-03-16 16:08:51 +01:00