Skip to content

Commit a913656

Browse files
committed
Add usage examples to annotations and assign methods.
1 parent e36dfd1 commit a913656

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

traceview/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ def annotation(self, message, *args, **kwargs):
9090
:param str layer: (optional) The layer name to associate the annotation with.
9191
:param str time: (optional) The time to associate the annotation with, in seconds since the epoch.
9292
93+
Usage::
94+
95+
>>> import traceview
96+
>>> tv = traceview.TraceView('API KEY HERE')
97+
>>> tv.annotation('Code deployed', appname='production_web')
98+
9399
"""
94100
kwargs['message'] = message
95101
self._annotation.post(*args, **kwargs)
@@ -120,6 +126,12 @@ def assign(self, hostname, appname, *args, **kwargs):
120126
:param str appname: The existing application name.
121127
:param str layer: (optional) The layer name to assign to the application.
122128
129+
Usage::
130+
131+
>>> import traceview
132+
>>> tv = traceview.TraceView('API KEY HERE')
133+
>>> tv.assign(hostname='web-app-1234', appname='production_web')
134+
123135
"""
124136
kwargs['appname'] = appname
125137
kwargs['hostname'] = hostname

0 commit comments

Comments
 (0)