Skip to content

Commit 32f6588

Browse files
committed
Fix #76 #75
1 parent 4619ab3 commit 32f6588

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

licensing/internal.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,11 @@ def send_request(method, params):
161161

162162
if HelperMethods.proxy_experimental == True:
163163
proxies = urllib.request.getproxies()
164-
if proxies != {}:
165-
166-
if 'http' in proxies:
167-
req.set_proxy(proxies['http'], 'http')
168-
169-
if 'https' in proxies:
170-
req.set_proxy(proxies['https'], 'https')
171-
164+
if HelperMethods.proxy_experimental:
165+
from urllib.parse import urlparse
166+
for scheme, proxy_uri in urllib.request.getproxies().items():
167+
req.set_proxy(urlparse(proxy_uri).netloc, scheme)
168+
return urllib.request.urlopen(req).read().decode("utf-8")
172169
else:
173170
return urllib.request.urlopen(req).read().decode("utf-8")
174171

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# Inside of setup.cfg
22
[metadata]
3-
description-file = README.md

setup.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
from distutils.core import setup
1+
from setuptools import setup
2+
23
setup(
34
name = 'licensing', # How you named your package folder (MyLib)
45
packages = ['licensing'], # Chose the same as "name"
56
version = '0.51', # Start with a small number and increase it with every change you make
67
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
7-
description = 'Client library for Cryptolens licensing Web API.', # Give a short description about your library
8+
#description_file = 'Client library for Cryptolens licensing Web API.', # Give a short description about your library
9+
long_description = 'Client library for Cryptolens Web API (software licensing).',
10+
long_description_content_type="text/markdown",
811
author = 'Cryptolens AB', # Type in your name
912
author_email = '[email protected]', # Type in your E-Mail
1013
url = 'https://cryptolens.io', # Provide either the link to your github or to your website
11-
download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_51.tar.gz', # I explain this later on
14+
download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_51.tar.gz',
15+
project_urls={ # optional, shows on PyPI
16+
"Source": "https://github.com/Cryptolens/cryptolens-python",
17+
"Tracker": "https://github.com/Cryptolens/cryptolens-python/issues",
18+
},
1219
keywords = ['software licensing', 'licensing library', 'cryptolens'], # Keywords that define your package best
1320
classifiers=[
1421
#'Development Status :: 5 - Stable', # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
1522
'Intended Audience :: Developers', # Define that your audience are developers
1623
'Topic :: Software Development :: Build Tools',
17-
'License :: OSI Approved :: MIT License', # Again, pick a license
1824
'Programming Language :: Python :: 3', #Specify which pyhton versions that you want to support
1925
'Programming Language :: Python :: 3.4',
2026
'Programming Language :: Python :: 3.5',
@@ -30,4 +36,5 @@
3036
'Operating System :: Microsoft :: Windows',
3137
'Operating System :: MacOS :: MacOS X',
3238
],
39+
3340
)

test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
#from cryptolens_python2 import *
1414
pubKey = "<RSAKeyValue><Modulus>sGbvxwdlDbqFXOMlVUnAF5ew0t0WpPW7rFpI5jHQOFkht/326dvh7t74RYeMpjy357NljouhpTLA3a6idnn4j6c3jmPWBkjZndGsPL4Bqm+fwE48nKpGPjkj4q/yzT4tHXBTyvaBjA8bVoCTnu+LiC4XEaLZRThGzIn5KQXKCigg6tQRy0GXE13XYFVz/x1mjFbT9/7dS8p85n8BuwlY5JvuBIQkKhuCNFfrUxBWyu87CFnXWjIupCD2VO/GbxaCvzrRjLZjAngLCMtZbYBALksqGPgTUN7ZM24XbPWyLtKPaXF2i4XRR9u6eTj5BfnLbKAU5PIVfjIS+vNYYogteQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
1515
#HelperMethods.ironpython2730_legacy = True
16+
#HelperMethods.proxy_experimental=True
1617
res = Key.activate(token="WyIyNzMyIiwiYmx6NlJ6ZzdaWjFScmxFVFNCc283YTJyUG5kQURMZ0hucW1YdUZxKyJd",\
1718
rsa_pub_key=pubKey,\
18-
product_id=3349, key="ICVLD-VVSZR-ZTICT-YKGXL", machine_code=Helpers.GetMachineCode(),\
19+
product_id=3349, key="ICVLD-VVSZR-ZTICT-YKGXL", machine_code=Helpers.GetMachineCode(v=2),\
1920
friendly_name=socket.gethostname())
2021

2122
if res[0] == None or not Helpers.IsOnRightMachine(res[0]):

0 commit comments

Comments
 (0)