licensing 0.44__tar.gz → 0.46__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: licensing
3
- Version: 0.44
3
+ Version: 0.46
4
4
  Summary: Client library for Cryptolens licensing Web API.
5
5
  Home-page: https://cryptolens.io
6
6
  Author: Cryptolens AB
7
7
  Author-email: support@cryptolens.io
8
8
  License: MIT
9
- Download-URL: https://github.com/Cryptolens/cryptolens-python/archive/v_44.tar.gz
9
+ Download-URL: https://github.com/Cryptolens/cryptolens-python/archive/v_46.tar.gz
10
10
  Description: UNKNOWN
11
11
  Keywords: software licensing,licensing library,cryptolens
12
12
  Platform: UNKNOWN
@@ -899,7 +899,7 @@ class Product:
899
899
  else:
900
900
  return (None, "Could not contact the server.")
901
901
 
902
- return (jobj["licenseKeys"], "")
902
+ return (jobj["licenseKeys"], "", {"returned":jobj["returned"], "total":jobj["total"], "pageCount":jobj["pageCount"]})
903
903
 
904
904
 
905
905
  class Customer:
@@ -940,6 +940,73 @@ class Customer:
940
940
  return (None, "Could not contact the server.")
941
941
 
942
942
  return (jobj, "")
943
+
944
+ @staticmethod
945
+ def get_customer_licenses(token, customer_id, detailed=False, metadata=False):
946
+
947
+ """
948
+ This method will return a list of license keys that belong to a certain customer.
949
+
950
+ More docs: https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses
951
+ """
952
+
953
+ try:
954
+ response = HelperMethods.send_request("/customer/GetCustomerLicenses/",\
955
+ {"token":token,\
956
+ "customerId" : customer_id,\
957
+ "detailed" : detailed,\
958
+ "metadata" : metadata
959
+ })
960
+ except HTTPError as e:
961
+ response = e.read()
962
+ except URLError as e:
963
+ return (None, "Could not contact the server. Error message: " + str(e))
964
+ except Exception:
965
+ return (None, "Could not contact the server.")
966
+
967
+ jobj = json.loads(response)
968
+
969
+ if jobj == None or not("result" in jobj) or jobj["result"] == 1:
970
+ if jobj != None:
971
+ return (None, jobj["message"])
972
+ else:
973
+ return (None, "Could not contact the server.")
974
+
975
+ return (jobj, "")
976
+
977
+ @staticmethod
978
+ def get_customer_licenses_by_secret(token, secret, detailed=False, metadata=False):
979
+
980
+ """
981
+ This method will return a list of license keys that belong to a certain customer.
982
+
983
+ More docs: https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses
984
+ """
985
+
986
+ try:
987
+ response = HelperMethods.send_request("/customer/GetCustomerLicensesBySecret/",\
988
+ {"token":token,\
989
+ "secret" : secret,\
990
+ "detailed" : detailed,\
991
+ "metadata" : metadata
992
+ })
993
+ except HTTPError as e:
994
+ response = e.read()
995
+ except URLError as e:
996
+ return (None, "Could not contact the server. Error message: " + str(e))
997
+ except Exception:
998
+ return (None, "Could not contact the server.")
999
+
1000
+ jobj = json.loads(response)
1001
+
1002
+ if jobj == None or not("result" in jobj) or jobj["result"] == 1:
1003
+ if jobj != None:
1004
+ return (None, jobj["message"])
1005
+ else:
1006
+ return (None, "Could not contact the server.")
1007
+
1008
+ return (jobj, "")
1009
+
943
1010
 
944
1011
  class Data:
945
1012
 
@@ -1,15 +1,14 @@
1
1
  from distutils.core import setup
2
-
3
2
  setup(
4
3
  name = 'licensing', # How you named your package folder (MyLib)
5
4
  packages = ['licensing'], # Chose the same as "name"
6
- version = '0.44', # Start with a small number and increase it with every change you make
5
+ version = '0.46', # Start with a small number and increase it with every change you make
7
6
  license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
8
7
  description = 'Client library for Cryptolens licensing Web API.', # Give a short description about your library
9
8
  author = 'Cryptolens AB', # Type in your name
10
9
  author_email = 'support@cryptolens.io', # Type in your E-Mail
11
10
  url = 'https://cryptolens.io', # Provide either the link to your github or to your website
12
- download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_44.tar.gz', # I explain this later on
11
+ download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_46.tar.gz', # I explain this later on
13
12
  keywords = ['software licensing', 'licensing library', 'cryptolens'], # Keywords that define your package best
14
13
  classifiers=[
15
14
  #'Development Status :: 5 - Stable', # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
File without changes
File without changes
File without changes
File without changes