Skip to content

Commit 0455d39

Browse files
authored
Merge pull request #8 from Galarzaa90/dev
v1.1.0
2 parents 84df1bb + e5908a8 commit 0455d39

29 files changed

+835
-180
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cache: pip
1010
install:
1111
- pip install -U -r requirements.txt
1212
- pip install -U setuptools wheel
13-
- pip install coverage
13+
- pip install coverage codecov
1414
- pip install -U Sphinx
1515

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

3334
deploy:
3435
provider: pages

CHANGELOG.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
=========
2+
Changelog
3+
=========
4+
5+
.. _v1.1.0:
6+
7+
1.1.0 (2019-01-09)
8+
==================
9+
10+
- Parsing Highscores from Tibia.com and TibiaData.
11+
- Some strings from TibiaData had unpredictable trailing whitespaces,
12+
all leading and trailing whitespaces are removed.
13+
- Added type hints to many variables and methods.
14+
15+
.. _v1.0.0:
16+
17+
1.0.0 (2018-12-23)
18+
==================
19+
20+
- Added support for TibiaData JSON parsing. To have interoperability
21+
between Tibia.com and TibiaData.
22+
- Added support for parsing Houses, House lists, World and World list
23+
- Added support for many missing attributes in Character and Guilds.
24+
- All objects are now serializable to JSON strings.
25+
26+
.. _v0.1.0:
27+
28+
0.1.0 (2018-08-17)
29+
==================
30+
31+
Initial release:
32+
33+
- Parses content from tibia.com
34+
35+
- Character pages
36+
- Guild pages
37+
- Guild list pages
38+
39+
- Parses content into JSON format strings.
40+
- Parses content into Python objects.

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include requirements.txt
22
include README.md
3-
include CHANGELOG.md
3+
include CHANGELOG.rst
44
include LICENSE

docs/api.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Enumerations are provided for various values in order to avoid depending on stri
2020
:members:
2121
:undoc-members:
2222

23+
.. autoclass:: Category
24+
:members:
25+
:undoc-members:
26+
2327
.. autoclass:: HouseStatus
2428
:members:
2529
:undoc-members:
@@ -40,6 +44,12 @@ Enumerations are provided for various values in order to avoid depending on stri
4044
:members:
4145
:undoc-members:
4246

47+
.. autoclass:: VocationFilter
48+
:members:
49+
:undoc-members:
50+
51+
.. automethod:: VocationFilter.from_name
52+
4353
.. autoclass:: WorldLocation
4454
:members:
4555
:undoc-members:
@@ -61,6 +71,12 @@ Guild
6171
:members:
6272
:inherited-members:
6373

74+
Highscores
75+
----------
76+
.. autoclass:: Highscores
77+
:members:
78+
:inherited-members:
79+
6480
House
6581
-----
6682
.. autoclass:: House
@@ -120,6 +136,12 @@ CharacterHouse
120136
:members:
121137
:inherited-members:
122138

139+
ExpHighscoresEntry
140+
-------------------------
141+
.. autoclass:: ExpHighscoresEntry
142+
:members:
143+
:inherited-members:
144+
123145
Death
124146
-----
125147
.. autoclass:: Death
@@ -150,12 +172,25 @@ GuildMembership
150172
:members:
151173
:inherited-members:
152174

175+
176+
HighscoresEntry
177+
---------------
178+
.. autoclass:: HighscoresEntry
179+
:members:
180+
:inherited-members:
181+
153182
Killer
154183
------
155184
.. autoclass:: Killer
156185
:members:
157186
:inherited-members:
158187

188+
LoyaltyHighscoresEntry
189+
----------------------
190+
.. autoclass:: LoyaltyHighscoresEntry
191+
:members:
192+
:inherited-members:
193+
159194
OnlineCharacter
160195
---------------
161196
.. autoclass:: OnlineCharacter

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../CHANGELOG.rst

docs/conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ def setup(app):
9696
# documentation.
9797
#
9898
html_theme_options = {
99-
'github_user': 'galarzaa90',
99+
'github_user': 'Galarzaa90',
100100
'github_repo': 'tibia.py',
101-
'github_type': 'star'
101+
'github_type': 'star',
102+
'fixed_sidebar': True,
103+
'travis_button': True,
104+
'donate_url': 'https://beerpay.io/Galarzaa90/tibia.py'
102105
}
103106

104107
# Add any paths that contain custom static files (such as style sheets) here,

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Indices and tables
3232

3333
intro
3434
api
35+
changelog
3536

3637
* :ref:`genindex`
3738
* :ref:`search`

setup.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ def get_version(package):
1414
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
1515

1616

17+
version = get_version("tibiapy")
18+
if version.endswith(('a', 'b', 'rc')):
19+
# append version identifier based on commit count
20+
try:
21+
import subprocess
22+
p = subprocess.Popen(['git', 'rev-list', '--count', 'HEAD'],
23+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
24+
out, err = p.communicate()
25+
if out:
26+
version += out.decode('utf-8').strip()
27+
p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
28+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
29+
out, err = p.communicate()
30+
if out:
31+
version += '+g' + out.decode('utf-8').strip()
32+
except Exception:
33+
pass
34+
1735
with open('requirements.txt') as f:
1836
requirements = f.read().splitlines()
1937

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

3452
setup(
3553
name='tibia.py',
36-
version=get_version("tibiapy"),
54+
version=version,
3755
author='Galarzaa90',
3856
author_email="[email protected]",
3957
url='https://github.com/Galarzaa90/tibia.py',

tests/resources/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ exist.
5454
- [tibiadata_list.json](house/tibiadata_list.json) - A house list on TibiaData.
5555
- [tibiadata_list_not_found.json](house/tibiadata_list_not_found.json) - The TibiaData response for a house list that
5656
doesn't exist.
57+
58+
## Highscores resources
59+
- [tibiacom_full.txt](highscores/tibiacom_full.txt) - The content of a correct highscore's pagem
60+
- [tibiacom_empty.txt](highscores/tibiacom_empty.txt) - The content of the highscores page of a nonexistent world.
61+
- [tibiacom_experience.txt](highscores/tibiacom_experience.txt) - The content of an experience highscores page.
62+
- [tibiacom_loyalty.txt](highscores/tibiacom_loyalty.txt) - The content of a loyalty highscores page.
63+
- [tibiadata_full.json](highscores/tibiadata_full.json) - A highscores response from TibiaData.
64+
- [tibiadata_empty.json](highscores/tibiadata_empty.json) - A highscores response from TibiaData of a nonexistent world.
65+
- [tibiadata_experience.json](highscores/tibiadata_experience.json) - A response containing experience highscores from
66+
TibiaData.
67+
- [tibiadata_loyalty.json](highscores/tibiadata_loyalty.json) - A response containing loyalty highscores from TibiaData.
5768

5869
## World resources
5970
- [tibiacom_online.txt](world/tibiacom_online.txt) - An online world on Tibia.com.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="BoxContent" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/scroll.gif);">
2+
<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>
3+
</div>

tests/resources/highscores/tibiacom_experience.txt

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)