|
32 | 32 | # https://support.shotgunsoftware.com/forums/48807-developer-api-info |
33 | 33 | # --------------------------------------------------------------------------------------------- |
34 | 34 |
|
35 | | -__version__ = "3.0.3" |
| 35 | +__version__ = "3.0.4" |
36 | 36 |
|
37 | 37 | # --------------------------------------------------------------------------------------------- |
38 | 38 | # SUMMARY |
|
58 | 58 | # CHANGELOG |
59 | 59 | # --------------------------------------------------------------------------------------------- |
60 | 60 | """ |
| 61 | ++v3.0.4 - 2010 Nov 22 |
| 62 | + + fix for issue where create() method was returning list type instead of dictionary |
| 63 | + + support new style classes (thanks to Alex Schworer https://github.com/schworer) |
| 64 | +
|
61 | 65 | +v3.0.3 - 2010 Nov 12 |
62 | 66 | + add support for local files. Injects convenience info into returned hash for local file links |
63 | 67 | + add support for authentication through http proxy server |
|
153 | 157 | # --------------------------------------------------------------------------------------------- |
154 | 158 | class ShotgunError(Exception): pass |
155 | 159 |
|
156 | | -class Shotgun: |
| 160 | +class Shotgun(object): |
157 | 161 | # Used to split up requests into batches of records_per_page when doing requests. this helps speed tremendously |
158 | 162 | # when getting lots of results back. doesn't affect the interface of the api at all (you always get the full set |
159 | 163 | # of results back as one array) but just how the client class communicates with the server. |
@@ -473,8 +477,8 @@ def create(self, entity_type, data, return_fields=None): |
473 | 477 | args["fields"].append( {"field_name":f,"value":v} ) |
474 | 478 |
|
475 | 479 | resp = self._api3.create(args) |
476 | | - records = self._inject_field_values([resp["results"]]) |
477 | | - return records |
| 480 | + record = self._inject_field_values([resp["results"]])[0] |
| 481 | + return record |
478 | 482 |
|
479 | 483 | def update(self, entity_type, entity_id, data): |
480 | 484 | """ |
@@ -626,7 +630,7 @@ def schema(self, entity_type): |
626 | 630 | def entity_types(self): |
627 | 631 | raise ShotgunError("Deprecated: use schema_entity_read() instead") |
628 | 632 |
|
629 | | -class ShotgunCRUD: |
| 633 | +class ShotgunCRUD(object): |
630 | 634 | def __init__(self, options): |
631 | 635 | self.__sg_url = options['server_url'] |
632 | 636 | self.__auth_args = {'script_name': options['script_name'], 'script_key': options['script_key']} |
@@ -735,7 +739,7 @@ def https_request(self, request): |
735 | 739 | DSTOFFSET = STDOFFSET |
736 | 740 | DSTDIFF = DSTOFFSET - STDOFFSET |
737 | 741 |
|
738 | | -class SgTimezone: |
| 742 | +class SgTimezone(object): |
739 | 743 |
|
740 | 744 | def __init__(self): |
741 | 745 | self.utc = self.UTC() |
|
0 commit comments