Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
#9 Get product EULA
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
uilianries committed Jul 20, 2019
1 parent 3dbae38 commit f535810
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 33 deletions.
34 changes: 32 additions & 2 deletions bintray/bintray.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
""" Python Wrapper for Bintray API
https://bintray.com/docs/api
Expand Down Expand Up @@ -1904,7 +1903,7 @@ def delete_eula(self, subject, product, eula):

response = self._requester.delete(url)
self._logger.info("Delete successfully")

# Subjects (This resource is only available to Bintray Premium users.)

def regenerate_subject_url_signing_key(self, subject):
Expand Down Expand Up @@ -2169,3 +2168,34 @@ def search_file_attributes(self, subject, repo, attributes):
response = self._requester.post(url, json=attributes)
self._logger.info("Search successfully")
return response

# EULA Tracking

def get_product_signed_eulas(self, subject, product, from_date=None, to_date=None,
username=None, eula_name=None):
""" Get a list of users who signed eula per product with sign date, version signed and eula.
:param subject: repository owner
:param product: product name
:param from_date: date to filter by, ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
:param to_date: date to filter by, ISO8601 format (yyyy-MM-dd’T’HH:mm:ss.SSSZ)
:param username: filter by username
:param eula_name: filter by Eula name
:return:
"""
url = "{}/products/{}/{}/signed_eulas".format(Bintray.BINTRAY_URL, subject, product)
params = {}
if from_date:
params["from"] = from_date
if to_date:
params["to"] = to_date
if username:
params["username"] = username
if eula_name:
params["eula_name"] = eula_name
response = self._requester.get(url, params=params)
self._logger.info("Get successfully")
return response

def get_all_products_signed_eulas():
pass
2 changes: 0 additions & 2 deletions bintray/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import logging
import os

Expand Down
2 changes: 0 additions & 2 deletions bintray/requester.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import requests
import json

Expand Down
3 changes: 0 additions & 3 deletions bintray/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-


def bool_to_number(value):
""" Convert boolean result into numeric string
Expand Down
2 changes: 0 additions & 2 deletions tests/test_content_downloading.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import os
from bintray.bintray import Bintray

Expand Down
2 changes: 0 additions & 2 deletions tests/test_content_signing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_eula.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_files.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_licenses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_readme.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_repositories.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import random
import pytest
from bintray.bintray import Bintray
Expand Down
2 changes: 0 additions & 2 deletions tests/test_subjects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_teams.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_users_organizations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down
2 changes: 0 additions & 2 deletions tests/test_versions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import datetime
import pytest
from bintray.bintray import Bintray
Expand Down
2 changes: 0 additions & 2 deletions tests/test_webhooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from bintray.bintray import Bintray


Expand Down

0 comments on commit f535810

Please sign in to comment.