Skip to content

Commit 1cc735c

Browse files
committed
Added decorator for calls that change when authenticated.
1 parent 6ee0543 commit 1cc735c

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

doc/api/core.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Core
1515
.. autofunction:: datetime_to_commitdate
1616

1717
.. autofunction:: requires_auth
18+
.. autofunction:: enhanced_by_auth
1819

1920
.. autofunction:: doc_generator
2021

github2/core.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ def wrapper(self, *args, **kwargs):
6868
return wrapped
6969

7070

71+
def enhanced_by_auth(f):
72+
"""Decorator to mark a function as enhanced by authentication
73+
74+
Sets a ``enhanced_by_auth`` attribute on functions, for use in
75+
introspection.
76+
77+
:param func f: Function to wrap
78+
"""
79+
f.enhanced_by_auth = True
80+
f.__doc__ += """\n.. note:: This call is enhanced with authentication"""
81+
return f
82+
83+
7184
class GithubCommand(object):
7285

7386
def __init__(self, request):

0 commit comments

Comments
 (0)