Now using Pipenv, requirements.txt removed

This commit is contained in:
ahmadbilalkhalid 2019-06-07 15:48:48 +05:00
parent b8794b900b
commit bdb21e285a
5 changed files with 53 additions and 8 deletions

12
Pipfile Normal file
View File

@ -0,0 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
apixu-python = {git = "https://github.com/apixu/apixu-python.git"}
[requires]
python_version = "3.7"

25
Pipfile.lock generated Normal file
View File

@ -0,0 +1,25 @@
{
"_meta": {
"hash": {
"sha256": "e84e3c15d8fea5745b66f0970337d98fef35d6898635ea849162932e1dabd55a"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"apixu-python": {
"git": "https://github.com/apixu/apixu-python.git",
"ref": "4beb003c71c0213720e930350f46e5fa6af9ef12"
}
},
"develop": {}
}

View File

@ -10,7 +10,7 @@ It is intended to be used by ungleich engineers and skilled customers.
* cd into this repo
* run the following command
```
sudo pip3 install -r requirements.txt
sudo pip3 install pipenv
```
## Usage general

View File

@ -1 +0,0 @@
git+https://github.com/apixu/apixu-python.git@master

View File

@ -1,5 +1,7 @@
import requests
import urllib.request
import argparse
import json
class ungleichDNS(object):
def __init__(self, parser, parents):
@ -20,14 +22,21 @@ class ungleichDNS(object):
def _handle_dns(self, args):
"""Reverse dns endpoint."""
r = requests.post(
'https://dns.service.ungleich.ch',
json={
url = 'https://dns.service.ungleich.ch'
req = urllib.request.Request(
url=url,
method='POST',
headers={
"Content-Type": "application/json"
},
data=json.dumps({
'username': args.user,
'token': args.token,
'ipaddress': args.set_reverse,
'name': args.name,
'email': args.email,
'realm': args.realm
})
print(r.text)
}).encode('utf-8')
)
response = urllib.request.urlopen(req).read()
print(json.loads(response))