Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Buddenberg
gcis-py-client
Commits
d51fcb3d
Commit
d51fcb3d
authored
Mar 07, 2014
by
abuddenberg
Browse files
Minor changes to variable names
parent
1592ef46
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/example.py
View file @
d51fcb3d
...
...
@@ -13,29 +13,24 @@ for partial_figure in gcis.get_figure_listing('nca3draft', chapter_id='our-chang
#Let's work with the infamous temperature figure
fig2_
6
=
gcis
.
get_figure
(
'nca3draft'
,
'observed-us-temperature-change'
)
fig2_
7
=
gcis
.
get_figure
(
'nca3draft'
,
'observed-us-temperature-change'
)
#Warning: Images and Chapters are specifically excluded from JSON output. This is what gets sent to GCIS. So...
print
fig2_
6
.
as_json
(
indent
=
4
)
print
fig2_
7
.
as_json
(
indent
=
4
)
#...you might want to view the original input
print
fig2_
6
.
original
print
fig2_
7
.
original
#Let's see about the images:
for
image
in
fig2_
6
.
images
:
for
image
in
fig2_
7
.
images
:
print
image
#How about the whole Image?
print
gcis
.
get_image
(
'69da6d93-4426-4061-a2a1-7b3d01f2dc1c'
).
as_json
(
indent
=
4
)
#Let's assign some GCMD keywords (The first 4 from the list)
keyword_ids
=
[
k
[
'identifier'
]
for
k
in
gcis
.
get_keyword_listing
()[
0
:
4
]]
for
keyword_id
in
keyword_ids
:
resp
=
gcis
.
associate_keyword_with_figure
(
keyword_id
,
'nca3draft'
,
'observed-us-temperature-change'
)
print
resp
.
status_code
,
resp
.
text
# keyword_ids = [k['identifier'] for k in gcis.get_keyword_listing()[0:4]]
# for keyword_id in keyword_ids:
# resp = gcis.associate_keyword_with_figure(keyword_id, 'nca3draft', 'observed-us-temperature-change')
# print resp.status_code, resp.text
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment