reading yaml
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json, yaml
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from rowers.utils import dologging
|
from rowers.utils import dologging
|
||||||
@@ -14,7 +14,9 @@ contacts_url = 'https://api.idoklad.cz/v3/Contacts'
|
|||||||
|
|
||||||
from rowers.models import iDokladToken
|
from rowers.models import iDokladToken
|
||||||
|
|
||||||
idoklad_countries = json.loads(open('rowers/idoklad_countries.json').read())["Data"]["Items"]
|
#idoklad_countries = json.loads(open('rowers/idoklad_countries.json').read())["Data"]["Items"]
|
||||||
|
with open('rowers/idoklad_countries.yaml') as f:
|
||||||
|
idoklad_countries = yaml.load(f, Loader=yaml.FullLoader)["Data"]["Items"]
|
||||||
|
|
||||||
def get_country_id(code):
|
def get_country_id(code):
|
||||||
for c in idoklad_countries:
|
for c in idoklad_countries:
|
||||||
|
|||||||
Reference in New Issue
Block a user