Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gadzhi committed Dec 17, 2018
1 parent bdaeaad commit e31605f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Pyiiko/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.1.9'
__version__ = '0.2.1'
from Pyiiko.server import *
from Pyiiko.biz import *
from Pyiiko.card5 import *
Expand Down
18 changes: 15 additions & 3 deletions Pyiiko/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ def version(self):
except requests.exceptions.ConnectTimeout:
print("Не удалось подключиться к серверу")

def server_info(self):
"""Вовращает json файл с информацией о сервере и статусе лицензии
:returns: Информация в формате json
"""
try:
return requests.get(
self.address + '/get_server_info.jsp?encoding=UTF-8').json

except requests.exceptions.ConnectTimeout:
print("Не удалось подключиться к серверу")

"----------------------------------Корпорации----------------------------------"

def departments(self):
Expand Down Expand Up @@ -108,7 +120,7 @@ def stores(self):
"""
try:
ur = self.address + 'api/corporation/stores?key=' + self._token
return requests.get(ur, timeout=DEFAULT_TIMEOUT).content
return requests.get(ur, timeout=DEFAULT_TIMEOUT).text
except Exception as e:
print(e)

Expand All @@ -123,7 +135,7 @@ def groups(self):
"""
try:
ur = self.address + 'api/corporation/groups?key=' + self._token
return requests.get(ur, timeout=DEFAULT_TIMEOUT).content
return requests.get(ur, timeout=DEFAULT_TIMEOUT)

except requests.exceptions.ConnectTimeout:
print("Не удалось подключиться к серверу")
Expand Down Expand Up @@ -176,7 +188,7 @@ def stores_find(self, code):
"""
try:
ur = self.address + 'api/corporation/stores/search?key=' + self._token
return requests.get(ur, params=code).content
return requests.get(ur, params=code)

except requests.exceptions.ConnectTimeout:
print("Не удалось подключиться к серверу")
Expand Down

0 comments on commit e31605f

Please sign in to comment.