Updated string formating
parent
827c501999
commit
65f512304a
|
@ -210,19 +210,20 @@ class Location(SQL_Base):
|
||||||
format(bot_config.dynmap_url, bot_config.world_name, self.x, self.z)
|
format(bot_config.dynmap_url, bot_config.world_name, self.x, self.z)
|
||||||
|
|
||||||
def pos_to_str(self):
|
def pos_to_str(self):
|
||||||
return '(x= {}, z= {}) in the {}'.format(self.x, self.z, self.dimension.value.title())
|
pos_str = '**(x= {}, z= {})** **{}**'.format(self.x, self.z, self.dimension.value.title())
|
||||||
|
if self.tunnel is not None:
|
||||||
|
return pos_str + ', **{}**'.format(self.tunnel)
|
||||||
|
else:
|
||||||
|
return pos_str
|
||||||
|
|
||||||
def info_str(self):
|
def info_str(self):
|
||||||
return "Name: **{}**, Type: **{}**, Owner: **{}** Position: **{}**".format(self.name, self.type,
|
return "**{}** @ {}, Owner: **{}**, Type: **{}**".format(self.name, self.pos_to_str(), self.owner.name,
|
||||||
self.owner.name, self.pos_to_str())
|
self.type)
|
||||||
|
|
||||||
def full_str(self):
|
def full_str(self):
|
||||||
return self.__str__() + '\n' + self.dynmap_link()
|
return self.__str__() + '\n' + self.dynmap_link()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.tunnel is not None:
|
|
||||||
return "{}, Tunnel: **{}**".format(self.info_str(), self.tunnel)
|
|
||||||
else:
|
|
||||||
return self.info_str()
|
return self.info_str()
|
||||||
|
|
||||||
|
|
||||||
|
@ -286,9 +287,9 @@ class ItemListing(SQL_Base):
|
||||||
self.shop = shop
|
self.shop = shop
|
||||||
|
|
||||||
def listing_str(self):
|
def listing_str(self):
|
||||||
return 'Item: **{}**, Price: **{}** for **{}**D'.format(self.name, self.amount, self.price)
|
return '**{}** **{}** for **{}D**'.format(self.amount, self.name, self.price)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return 'Shop: **{}**, {}'.format(self.shop.name, self.listing_str())
|
return '**{}**, selling {}'.format(self.shop.name, self.listing_str())
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue