Skip to content

Commit

Permalink
extend backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adl212 committed Jun 2, 2021
1 parent 96a1260 commit 3d5eaa3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion NT.py.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: NT.py
Version: 3.5.1
Version: 3.5.5
Summary: A package to use the nitrotype api and get player or team stats
Home-page: https://github.com/adl212/NT.py
Author: adl212
Expand Down
9 changes: 6 additions & 3 deletions build/lib/nitrotype/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import re, json
from datetime import date
from .https import idk
requests = idk()
def get(*args, **kwargs):
return requests.get(headers=requests.headers, *args, **kwargs)
#cars of nitrotype
cars = {
1 : 'Lamborgotti Mephisto SS',
Expand Down Expand Up @@ -468,6 +465,9 @@ def get(*args, **kwargs):

class Racer:
def __init__(self, racer=None):
self.requests = idk()
def get(*args, **kwargs):
return self.requests.get(headers=self.requests.headers, *args, **kwargs)
if racer == None:
self.success = False
return
Expand Down Expand Up @@ -599,6 +599,9 @@ def __init__(self, racer=None):
self.looking_for_team = True if newdata['lookingForTeam'] == 1 else False
class Team:
def __init__(self, team):
self.requests = idk()
def get(*args, **kwargs):
return self.requests.get(headers=self.requests.headers, *args, **kwargs)
try:
def api_get(path): return get(f'https://www.nitrotype.com/api/{path}')
self.data = json.loads(api_get(f'teams/{team}').content)
Expand Down
Binary file removed dist/NT.py-3.5.1.tar.gz
Binary file not shown.
Binary file not shown.
Binary file added dist/NT.py-3.5.5.tar.gz
Binary file not shown.
6 changes: 5 additions & 1 deletion nitrotype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,10 @@


class Racer:
def __init__(self, racer=None):
def __init__(self, racer=None, scraper=None):
self.requests = idk()
if scraper:
self.requests = scraper
def get(*args, **kwargs):
return self.requests.get(headers=self.requests.headers, *args, **kwargs)
if racer == None:
Expand Down Expand Up @@ -600,6 +602,8 @@ def get(*args, **kwargs):
class Team:
def __init__(self, team):
self.requests = idk()
if scraper:
self.requests = scraper
def get(*args, **kwargs):
return self.requests.get(headers=self.requests.headers, *args, **kwargs)
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="NT.py",
version="3.5.1",
version="3.5.5",
author="adl212",
author_email="[email protected]",
description="A package to use the nitrotype api and get player or team stats",
Expand Down

0 comments on commit 3d5eaa3

Please sign in to comment.