
    _OgF                         S r SSKrSSKJr   " S S\R                  5      r " S S\5      r " S	 S
\5      r " S S\R                  5      rg)zm
This module contains the classes relating to licenses.

See also: https://developer.github.com/v3/licenses/
    N   )modelsc                   (    \ rS rSrSrS rS rS rSrg)_License   zBase license object.c                 T    US   U l         US   U l        US   U l        US   U l        g )Nurlkeynamespdx_id_apir
   r   r   selflicenses     U/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/licenses.py_update_attributes_License._update_attributes   s/    EN	5>FO	y)    c                 <    SU R                    SU R                   S3$ )N<z []>)
class_namer   r   s    r   _repr_License._repr   s     4??#2dii[33r   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__ r   r   r   r      s    J*4r   r   c                   6   ^  \ rS rSrSrS rU 4S jrS rSrU =r	$ )License   a  This object represents a license as returned by the GitHub API.

See https://developer.github.com/v3/licenses/ for more information.

This object has all of the attributes of :class:`ShortLicense` as well as
the following attributes:

.. attribute:: body

    The full text of this license.

.. attribute:: conditions

    A list of the conditions of this license.

.. attribute:: description

    The short description of this license.

.. attribute:: featured

    A boolean attribute describing whether this license is featured on
    GitHub or not.

.. attribute:: html_url

    The URL to view this license on GitHub.

.. attribute:: implementation

    The short description of how a user applies this license to their
    original work.

.. attribute:: limitations

    A list of limitations of this license.

.. attribute:: permissions

    A list of the permissions granted by this license.
c                    > [         TU ]  U5        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l	        g )	Nbody
conditionsdescriptionfeaturedhtml_urlimplementationlimitationspermissions)
superr   r(   r)   r*   r+   r,   r-   r.   r/   )r   r   	__class__s     r   r   License._update_attributesG   st    "7+FO	!,/"=1
+
+%&67"=1"=1r   c                 "    SU R                    S3$ )Nz
<License [r   r   r   s    r   r   License._reprR   s    DII;b))r   )r(   r)   r*   r+   r,   r-   r.   r/   )
r   r   r   r    r!   r   r   r   r"   __classcell__)r1   s   @r   r%   r%      s    (T J	2* *r   r%   c                        \ rS rSrSrS r\rSrg)ShortLicenseV   a'  This object represents a license returned in a collection.

GitHub's API returns different representations of objects in different
contexts. This object reprsents a license that would be returned in a
collection, e.g., retrieving all licenses from ``/licenses``.

This object has the following attributes:

.. attribute:: key

    The short, API name, for this license.

.. attribute:: name

    The long form, legal name for this license.

.. attribute:: spdx_id

    The Software Package Data Exchange (a.k.a, SPDX) identifier for this
    license.
r#   N)	r   r   r   r    r!   r   r%   _refresh_tor"   r#   r   r   r8   r8   V   s    ,  JKr   r8   c                   *    \ rS rSrSrS rS rS rSrg)RepositoryLicenseq   a  The representation of the repository's retrieved license.

This object will be returned from
:meth:`~github3.repos.repo.Repository.license` and behaves like
:class:`~github3.repos.contents.Contents` with a few differences.
This also includes a :attr:`license` attribute to access the licenses API.

This object has the following attributes:

.. attribute:: name

    The name of the file this license is stored in on the repository.

.. attribute:: path

    The path to the file of this license in the repository.

.. attribute:: sha

    The current SHA of this license file in the repository.

.. attribute:: size

    The size in bytes of this file.

.. attribute:: html_url

    The URL used to view this file in a browser.

.. attribute:: git_url

    The URL to retrieve this license file via the git protocol.

.. attribute:: download_url

    The URL used to download this license file from the repository.

.. attribute:: type

    Analogous to :attr:`github3.repos.contents.Contents.type`, this should
    indicate whether this is a file, directory, or some other type.

.. attribute:: content

    The content as returned by the API. This may be base64 encoded. See
    :meth:`decode_content` to retrieve the content in plain-text.

.. attribute:: encoding

    The encoding of the content. For example, ``base64``.

.. attribute:: links

    The dictionary of URLs returned in the ``_links`` key by the API.

.. attribute:: license

    A :class:`github3.licenses.ShortLicense` instance representing the
    metadata GitHub knows about the license.
c                    US   U l         US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        US   U l        US	   U l        US
   U l	        US   U l
        US   U l        [        US   U 5      U l        g )Nr	   r   pathshasizer,   git_urldownload_urltypecontentencoding_linksr   )r   r   r?   r@   rA   r,   rB   rC   rD   rE   rF   linksr8   r   r   s     r   r   $RepositoryLicense._update_attributes   s    EN	FO	FO	5>FO	
+y)#N3FO	y)
+X&
#GI$6=r   c                 "    SU R                    S3$ )Nz<RepositoryLicense [r   r4   r   s    r   r   RepositoryLicense._repr   s    %dii[33r   c                     U R                   S:X  a>  [        R                  " U R                  R	                  S5      5      R                  S5      $ U R                  $ )zDecode the :attr:`content` attribute.

If ``content`` is base64 encoded, decode this and return it.
Otherwise, return ``content``.

:returns:
    plain-text content of this license
:rtype:
    text (str on Python 3)
base64zutf-8)rF   rM   	b64decoderE   encodedecoder   s    r   decode_content RepositoryLicense.decode_content   sL     ==H$##DLL$7$7$@AHH  ||r   )r   rE   rC   rF   rB   r,   r   rH   r   r?   r@   rA   rD   N)	r   r   r   r    r!   r   r   rQ   r"   r#   r   r   r<   r<   q   s    ;z>4r   r<   )	r!   rM    r   
GitHubCorer   r%   r8   r<   r#   r   r   <module>rU      sQ   
  4v   49*h 9*x8 6_)) _r   