Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cache: pip
install:
- pip install -U -r requirements.txt
- pip install -U setuptools wheel
- pip install coverage
- pip install coverage codecov
- pip install -U Sphinx

before_script:
Expand All @@ -29,6 +29,7 @@ after_script:
- coverage report
- coverage xml
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then codecov; fi

deploy:
provider: pages
Expand Down
15 changes: 0 additions & 15 deletions CHANGELOG.md

This file was deleted.

40 changes: 40 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
=========
Changelog
=========

.. _v1.1.0:

1.1.0 (2019-01-09)
==================

- Parsing Highscores from Tibia.com and TibiaData.
- Some strings from TibiaData had unpredictable trailing whitespaces,
all leading and trailing whitespaces are removed.
- Added type hints to many variables and methods.

.. _v1.0.0:

1.0.0 (2018-12-23)
==================

- Added support for TibiaData JSON parsing. To have interoperability
between Tibia.com and TibiaData.
- Added support for parsing Houses, House lists, World and World list
- Added support for many missing attributes in Character and Guilds.
- All objects are now serializable to JSON strings.

.. _v0.1.0:

0.1.0 (2018-08-17)
==================

Initial release:

- Parses content from tibia.com

- Character pages
- Guild pages
- Guild list pages

- Parses content into JSON format strings.
- Parses content into Python objects.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include requirements.txt
include README.md
include CHANGELOG.md
include CHANGELOG.rst
include LICENSE
35 changes: 35 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Enumerations are provided for various values in order to avoid depending on stri
:members:
:undoc-members:

.. autoclass:: Category
:members:
:undoc-members:

.. autoclass:: HouseStatus
:members:
:undoc-members:
Expand All @@ -40,6 +44,12 @@ Enumerations are provided for various values in order to avoid depending on stri
:members:
:undoc-members:

.. autoclass:: VocationFilter
:members:
:undoc-members:

.. automethod:: VocationFilter.from_name

.. autoclass:: WorldLocation
:members:
:undoc-members:
Expand All @@ -61,6 +71,12 @@ Guild
:members:
:inherited-members:

Highscores
----------
.. autoclass:: Highscores
:members:
:inherited-members:

House
-----
.. autoclass:: House
Expand Down Expand Up @@ -120,6 +136,12 @@ CharacterHouse
:members:
:inherited-members:

ExpHighscoresEntry
-------------------------
.. autoclass:: ExpHighscoresEntry
:members:
:inherited-members:

Death
-----
.. autoclass:: Death
Expand Down Expand Up @@ -150,12 +172,25 @@ GuildMembership
:members:
:inherited-members:


HighscoresEntry
---------------
.. autoclass:: HighscoresEntry
:members:
:inherited-members:

Killer
------
.. autoclass:: Killer
:members:
:inherited-members:

LoyaltyHighscoresEntry
----------------------
.. autoclass:: LoyaltyHighscoresEntry
:members:
:inherited-members:

OnlineCharacter
---------------
.. autoclass:: OnlineCharacter
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CHANGELOG.rst
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ def setup(app):
# documentation.
#
html_theme_options = {
'github_user': 'galarzaa90',
'github_user': 'Galarzaa90',
'github_repo': 'tibia.py',
'github_type': 'star'
'github_type': 'star',
'fixed_sidebar': True,
'travis_button': True,
'donate_url': 'https://beerpay.io/Galarzaa90/tibia.py'
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Indices and tables

intro
api
changelog

* :ref:`genindex`
* :ref:`search`
Expand Down
20 changes: 19 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ def get_version(package):
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)


version = get_version("tibiapy")
if version.endswith(('a', 'b', 'rc')):
# append version identifier based on commit count
try:
import subprocess
p = subprocess.Popen(['git', 'rev-list', '--count', 'HEAD'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
version += out.decode('utf-8').strip()
p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
version += '+g' + out.decode('utf-8').strip()
except Exception:
pass

with open('requirements.txt') as f:
requirements = f.read().splitlines()

Expand All @@ -33,7 +51,7 @@ def get_version(package):

setup(
name='tibia.py',
version=get_version("tibiapy"),
version=version,
author='Galarzaa90',
author_email="allan.galarza@gmail.com",
url='https://github.com/Galarzaa90/tibia.py',
Expand Down
11 changes: 11 additions & 0 deletions tests/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ exist.
- [tibiadata_list.json](house/tibiadata_list.json) - A house list on TibiaData.
- [tibiadata_list_not_found.json](house/tibiadata_list_not_found.json) - The TibiaData response for a house list that
doesn't exist.

## Highscores resources
- [tibiacom_full.txt](highscores/tibiacom_full.txt) - The content of a correct highscore's pagem
- [tibiacom_empty.txt](highscores/tibiacom_empty.txt) - The content of the highscores page of a nonexistent world.
- [tibiacom_experience.txt](highscores/tibiacom_experience.txt) - The content of an experience highscores page.
- [tibiacom_loyalty.txt](highscores/tibiacom_loyalty.txt) - The content of a loyalty highscores page.
- [tibiadata_full.json](highscores/tibiadata_full.json) - A highscores response from TibiaData.
- [tibiadata_empty.json](highscores/tibiadata_empty.json) - A highscores response from TibiaData of a nonexistent world.
- [tibiadata_experience.json](highscores/tibiadata_experience.json) - A response containing experience highscores from
TibiaData.
- [tibiadata_loyalty.json](highscores/tibiadata_loyalty.json) - A response containing loyalty highscores from TibiaData.

## World resources
- [tibiacom_online.txt](world/tibiacom_online.txt) - An online world on Tibia.com.
Expand Down
3 changes: 3 additions & 0 deletions tests/resources/highscores/tibiacom_empty.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="BoxContent" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/scroll.gif);">
<form action="https://www.tibia.com/community/?subtopic=highscores" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/box-frame-vertical.gif);" /></span> <div class="Text" >Highscores Filter</div> <span class="CaptionVerticalRight" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>World:</td><td><select size="1" name="world" style="width:165px;" ><option value="" selected>(choose world)</option><option value="Antica" >Antica</option><option value="Astera" >Astera</option><option value="Belobra" >Belobra</option><option value="Bona" >Bona</option><option value="Calmera" >Calmera</option><option value="Carnera" >Carnera</option><option value="Celebra" >Celebra</option><option value="Celesta" >Celesta</option><option value="Damora" >Damora</option><option value="Descubra" >Descubra</option><option value="Duna" >Duna</option><option value="Epoca" >Epoca</option><option value="Estela" >Estela</option><option value="Faluna" >Faluna</option><option value="Ferobra" >Ferobra</option><option value="Firmera" >Firmera</option><option value="Garnera" >Garnera</option><option value="Gentebra" >Gentebra</option><option value="Gladera" >Gladera</option><option value="Harmonia" >Harmonia</option><option value="Helera" >Helera</option><option value="Honbra" >Honbra</option><option value="Impera" >Impera</option><option value="Inabra" >Inabra</option><option value="Jonera" >Jonera</option><option value="Kalibra" >Kalibra</option><option value="Kenora" >Kenora</option><option value="Lobera" >Lobera</option><option value="Luminera" >Luminera</option><option value="Lutabra" >Lutabra</option><option value="Macabra" >Macabra</option><option value="Menera" >Menera</option><option value="Monza" >Monza</option><option value="Nefera" >Nefera</option><option value="Noctera" >Noctera</option><option value="Nossobra" >Nossobra</option><option value="Olera" >Olera</option><option value="Ombra" >Ombra</option><option value="Pacera" >Pacera</option><option value="Peloria" >Peloria</option><option value="Premia" >Premia</option><option value="Pyra" >Pyra</option><option value="Quelibra" >Quelibra</option><option value="Quintera" >Quintera</option><option value="Refugia" >Refugia</option><option value="Relembra" >Relembra</option><option value="Secura" >Secura</option><option value="Serdebra" >Serdebra</option><option value="Solidera" >Solidera</option><option value="Talera" >Talera</option><option value="Tortura" >Tortura</option><option value="Vita" >Vita</option><option value="Vunira" >Vunira</option><option value="Wintera" >Wintera</option><option value="Zuna" >Zuna</option><option value="Zunera" >Zunera</option></select></td><td rowspan="3" ><div class="BigButton" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="https://ssl-static-tibia.akamaized.net/images/global/buttons/_sbutton_submit.gif" ></div></div></td></tr><tr><td>Vocation:</td><td><select name="profession" ><option value="0" >(all)</option><option value="1" >Knights</option><option value="2" >Paladins</option><option value="3" >Sorcerers</option><option value="4" >Druids</option></select></td></tr><tr><td>Category:</td><td><select name="list" ><option value="achievements" >Achievements</option><option value="axe" >Axe Fighting</option><option value="club" >Club Fighting</option><option value="distance" >Distance Fighting</option><option value="experience" selected="selected">Experience Points</option><option value="fishing" >Fishing</option><option value="fist" >Fist Fighting</option><option value="loyalty" >Loyalty Points</option><option value="magic" >Magic Level</option><option value="shielding" >Shielding</option><option value="sword" >Sword Fighting</option></select></td></tr> </table> </div> </td> </tr> </table></div></form><p><i>Skills displayed in the Highscores do not include any bonuses (loyalty, equipment etc.).</i></p> </div>
</div>
4 changes: 4 additions & 0 deletions tests/resources/highscores/tibiacom_experience.txt

Large diffs are not rendered by default.

Loading