Skip to content

Commit

Permalink
0.2.4: REPRs for all!
Browse files Browse the repository at this point in the history
  • Loading branch information
umbresp committed Feb 15, 2018
1 parent db104c7 commit 1d9c1b3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion brawlstars.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: brawlstars
Version: 0.2.3
Version: 0.2.4
Summary: A wrapper, both asynchronous and not, for the Brawl Stars API made by Zihad!
Home-page: https://github.com/umbresp/brawlstars
Author: Umbresp
Expand Down
2 changes: 1 addition & 1 deletion brawlstars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
__author__ = 'Umbresp'
__title__ = 'brawlstars'
__license__ = 'MIT'
__version__ = '0.2.3'
__version__ = '0.2.4'
__github__ = 'https://www.github.com/umbresp/brawlstars'
22 changes: 18 additions & 4 deletions brawlstars/asyncclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __del__(self):
self.session.close()

def __repr__(self):
return f'<Asynchronous BS Client timeout = {self.timeout}>'
return f'<Asynchronous BS Client timeout = {self.timeout} baseUrl = {self.baseUrl}>'

async def get_player(self, tag=None):
if tag is None:
Expand Down Expand Up @@ -78,6 +78,9 @@ async def get_band(self, tag=None):

class Player(Box):

def __repr__(self):
return f'<Asynchronous Player tag = {self.tag} name = {self.name}'

async def get_id(self):
try:
ret = self.id
Expand All @@ -104,13 +107,16 @@ async def get_brawlers(self):
async def get_band(self):
try:
band = self.band
except AttributError:
except AttributeError:
return None
band = Box(band)
band = MinimalBand(band)
return band

class MinimalBand(Box):

def __repr__(self):
return f'<Asynchronous Minimal Band tag = {self.tag} name = {self.name}'

async def get_id(self):
try:
Expand All @@ -123,6 +129,9 @@ async def get_id(self):

class Band(Box):

def __repr__(self):
return f'<Asynchronous Band tag = {self.tag} name = {self.name}'

async def get_id(self):
try:
ret = self.id
Expand All @@ -147,6 +156,9 @@ async def get_members(self):

class Member(Box):

def __repr__(self):
return f'<Asynchronous Member role = {self.role} name = {self.name}'

async def get_id(self):
try:
ret = self.id
Expand All @@ -157,7 +169,9 @@ async def get_id(self):
return ret

class Id(Box):
pass
def __repr__(self):
return f'<Asynchronous ID high = {self.high} low = {self.low}'

class Brawler(Box):
pass
def __repr__(self):
return f'<Asynchronous Brawler trophies = {self.trophies} name = {self.name}'
20 changes: 17 additions & 3 deletions brawlstars/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __del__(self):
pass

def __repr__(self):
return f'<BS Client timeout = {self.timeout}>'
return f'<BS Client timeout = {self.timeout} baseUrl = {self.baseUrl}>'

def get_player(self, tag=None):
if tag is None:
Expand Down Expand Up @@ -70,6 +70,9 @@ def get_band(self, tag=None):

class Player(Box):

def __repr__(self):
return f'<Player tag = {self.tag} name = {self.name}'

def get_id(self):
try:
ret = self.id
Expand Down Expand Up @@ -105,6 +108,9 @@ def get_band(self):

class MinimalBand(Box):

def __repr__(self):
return f'<Minimal Band tag = {self.tag} name = {self.name}'

def get_id(self):
try:
ret = self.id
Expand All @@ -116,6 +122,9 @@ def get_id(self):

class Band(Box):

def __repr__(self):
return f'<Band tag = {self.tag} name = {self.name}'

def get_id(self):
try:
ret = self.id
Expand All @@ -140,6 +149,9 @@ def get_members(self):

class Member(Box):

def __repr__(self):
return f'<Member role = {self.role} name = {self.name}'

def get_id(self):
try:
ret = self.id
Expand All @@ -150,7 +162,9 @@ def get_id(self):
return ret

class Id(Box):
pass
def __repr__(self):
return f'<ID high = {self.high} low = {self.low}'

class Brawler(Box):
pass
def __repr__(self):
return f'<Brawler trophies = {self.trophies} name = {self.name}'
Binary file added dist/brawlstars-0.2.3.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='brawlstars',
version='0.2.3',
version='0.2.4',
description='A wrapper, both asynchronous and not, for the Brawl Stars API made by Zihad!',
long_description="I am bad at writing descriptions. TODO",
url='https://github.com/umbresp/brawlstars',
Expand Down

0 comments on commit 1d9c1b3

Please sign in to comment.