File tree Expand file tree Collapse file tree 5 files changed +20
-23
lines changed
tests/resources/character Expand file tree Collapse file tree 5 files changed +20
-23
lines changed Original file line number Diff line number Diff line change 3
3
<module name =" tibia.py" />
4
4
<option name =" INTERPRETER_OPTIONS" value =" " />
5
5
<option name =" PARENT_ENVS" value =" true" />
6
- <option name =" SDK_HOME" value =" $PROJECT_DIR$/venv/bin/python " />
7
- <option name =" WORKING_DIRECTORY" value =" $PROJECT_DIR$" />
8
- <option name =" IS_MODULE_SDK" value =" false " />
6
+ <option name =" SDK_HOME" value =" " />
7
+ <option name =" WORKING_DIRECTORY" value =" $PROJECT_DIR$/tests " />
8
+ <option name =" IS_MODULE_SDK" value =" true " />
9
9
<option name =" ADD_CONTENT_ROOTS" value =" true" />
10
10
<option name =" ADD_SOURCE_ROOTS" value =" true" />
11
11
<EXTENSION ID =" PythonCoverageRunConfigurationExtension" runner =" coverage.py" />
12
12
<option name =" _new_pattern" value =" "" " />
13
13
<option name =" _new_additionalArguments" value =" "" " />
14
- <option name =" _new_target" value =" " tibiapy " " />
15
- <option name =" _new_targetType" value =" " CUSTOM " " />
14
+ <option name =" _new_target" value =" " $PROJECT_DIR$/tests " " />
15
+ <option name =" _new_targetType" value =" " PATH " " />
16
16
<method v =" 2" />
17
17
</configuration >
18
18
</component >
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ Changelog
6
6
Due to this library relying on external content, older versions are not guaranteed to work.
7
7
Try to always use the latest version.
8
8
9
+ .. v4.1.5
10
+
11
+ 4.1.5 (2021-06-25)
12
+ ==================
13
+ - Fixed parsing bug on characters, returning an incorrect exception when a character doesn't exist.
14
+
15
+
9
16
.. v4.1.4
10
17
11
18
4.1.4 (2021-06-17)
Original file line number Diff line number Diff line change 1
- <div class="BoxContent" style="background-image:url(https://ssl-static-tibia.akamaized.net/images/global/content/scroll.gif);">
2
- <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
3
- <TR><TD BGCOLOR="#505050" CLASS=white><B>Could not find character</B></TD></TR>
4
- <TR><TD BGCOLOR="#D4C0A1"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Character <b>afasfagf</b> does not exist.</TD></TR></TABLE></TD></TR>
5
- </TABLE>
6
- <br /><br /> <FORM ACTION="https://www.tibia.com/community/?subtopic=characters" METHOD=post>
7
- <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
8
- <TR><TD BGCOLOR="#505050" CLASS=white><B>Search Character</B></TD></TR>
9
- <TR><TD BGCOLOR="#D4C0A1"><TABLE BORDER=0 CELLPADDING=1><TR>
10
- <TD>Name:</TD><TD><INPUT NAME="name" VALUE="afasfagf"SIZE=29 MAXLENGTH=29></TD>
11
- <TD><INPUT TYPE=image NAME="Submit" SRC="https://ssl-static-tibia.akamaized.net/images/global/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD>
12
- </TR></TABLE></TD></TR>
13
- </TABLE>
14
- </FORM>
15
- </div>
1
+ <div class="BoxContent" style="background-image:url(https://static.tibia.com/images/global/content/scroll.gif);">
2
+ <div class="TableContainer"> <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url(https://static.tibia.com/images/global/content/table-headline-border.gif);"></span> <span class="CaptionVerticalLeft" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-vertical.gif);" /></span> <div class="Text">Could not find character</div> <span class="CaptionVerticalRight" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url(https://static.tibia.com/images/global/content/table-headline-border.gif);"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table style="width:100%;"><tr><td>Character <b>critosio</b> does not exist.</td></tr> </table> </div> </td> </tr> </table></div><br /><br /><form><div class="TableContainer"> <table class="Table1" cellpadding="0" cellspacing="0"> <div class="CaptionContainer"> <div class="CaptionInnerContainer"> <span class="CaptionEdgeLeftTop" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url(https://static.tibia.com/images/global/content/table-headline-border.gif);"></span> <span class="CaptionVerticalLeft" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-vertical.gif);" /></span> <div class="Text">Search Character</div> <span class="CaptionVerticalRight" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url(https://static.tibia.com/images/global/content/table-headline-border.gif);"></span> <span class="CaptionEdgeLeftBottom" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url(https://static.tibia.com/images/global/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer"> <table style="width:100%;"><tr><td style="vertical-align:middle;" class="LabelV150">Character Name:</td><td style="width:170px;"><input style="width:165px;" name="name" value="critosio" size="29" maxlength="29" /></td><td><div class="BigButton" style="background-image:url(https://static.tibia.com/images/global/buttons/button_blue.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(https://static.tibia.com/images/global/buttons/button_blue_over.gif);"></div><input class="BigButtonText" type="submit" value="Submit" /></div></div></td></tr> </table> </div> </td> </tr> </table></div></form> </div>
3
+ </div>
Original file line number Diff line number Diff line change 1
- __version__ = '4.1.4 '
1
+ __version__ = '4.1.5 '
2
2
__author__ = 'Allan Galarza'
3
3
4
4
import logging
Original file line number Diff line number Diff line change @@ -309,8 +309,10 @@ def from_content(cls, content):
309
309
parsed_content = parse_tibiacom_content (content )
310
310
tables = cls ._parse_tables (parsed_content )
311
311
char = Character ()
312
- if "Could not find character" in tables .keys ():
313
- return None
312
+ if not tables :
313
+ messsage_table = parsed_content .find ("div" , {"class" : "TableContainer" })
314
+ if messsage_table and "Could not find character" in messsage_table .text :
315
+ return None
314
316
if "Character Information" in tables .keys ():
315
317
char ._parse_character_information (tables ["Character Information" ])
316
318
else :
You can’t perform that action at this time.
0 commit comments