Moved all code to one file
This commit is contained in:
parent
7bfee64b45
commit
4cf11f475d
2 changed files with 10 additions and 18 deletions
12
api.py
12
api.py
|
@ -1,12 +0,0 @@
|
||||||
import requests
|
|
||||||
import os, getpass, re, pickle, getpass, json
|
|
||||||
|
|
||||||
class Session():
|
|
||||||
def __init__(self):
|
|
||||||
self.client = requests.Session()
|
|
||||||
|
|
||||||
def api_request(self, url='/', method='get', **kwargs):
|
|
||||||
return json.loads(getattr(self.client, method)('https://api.warframe.market/v1' + url, **kwargs).text)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
16
tui.py
16
tui.py
|
@ -1,12 +1,16 @@
|
||||||
from requests.exceptions import ConnectionError
|
import requests
|
||||||
|
|
||||||
import curses, curses.textpad
|
import curses, curses.textpad
|
||||||
import subprocess, sys
|
import subprocess, sys, json
|
||||||
|
|
||||||
|
class Session():
|
||||||
|
def __init__(self):
|
||||||
|
self.client = requests.Session()
|
||||||
|
|
||||||
|
def api_request(self, url='/', method='get', **kwargs):
|
||||||
|
return json.loads(getattr(self.client, method)('https://api.warframe.market/v1' + url, **kwargs).text)
|
||||||
|
|
||||||
from api import Session
|
|
||||||
|
|
||||||
def check_exit(x):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class GUI():
|
class GUI():
|
||||||
def __init__(self, root, h, w, y, x):
|
def __init__(self, root, h, w, y, x):
|
||||||
|
@ -158,6 +162,6 @@ try:
|
||||||
curses.wrapper(main)
|
curses.wrapper(main)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('Exiting')
|
print('Exiting')
|
||||||
except ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
print("No Internet")
|
print("No Internet")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in a new issue