@@ -134,6 +134,8 @@ class Character(abc.BaseCharacter, abc.Serializable):
134134 ----------
135135 name: :class:`str`
136136 The name of the character.
137+ traded: :class:`bool`
138+ If the character was traded in the last 6 months.
137139 deletion_date: :class:`datetime.datetime`, optional
138140 The date when the character will be deleted if it is scheduled for deletion.
139141 former_names: :class:`list` of :class:`str`
@@ -190,6 +192,7 @@ class Character(abc.BaseCharacter, abc.Serializable):
190192 __slots__ = (
191193 "name" ,
192194 "former_names" ,
195+ "traded" ,
193196 "sex" ,
194197 "title" ,
195198 "unlocked_titles" ,
@@ -222,6 +225,7 @@ class Character(abc.BaseCharacter, abc.Serializable):
222225
223226 def __init__ (self , name = None , world = None , vocation = None , level = 0 , sex = None , ** kwargs ):
224227 self .name : str = name
228+ self .traded : bool = kwargs .get ("traded" , False )
225229 self .former_names : List [str ] = kwargs .get ("former_names" , [])
226230 self .title : Optional [str ] = kwargs .get ("title" )
227231 self .unlocked_titles = int (kwargs .get ("unlocked_titles" , 0 ))
@@ -436,6 +440,10 @@ def _parse_character_information(self, rows):
436440 m = guild_regexp .match (char ["guild_membership" ])
437441 char ["guild_membership" ] = GuildMembership (m .group (2 ), m .group (1 ))
438442
443+ if "(traded)" in char ["name" ]:
444+ char ["name" ] = char ["name" ].replace ("(traded)" ,"" ).strip ()
445+ char ["traded" ] = True
446+
439447 if "former_names" in char :
440448 former_names = [fn .strip () for fn in char ["former_names" ].split ("," )]
441449 char ["former_names" ] = former_names
@@ -558,6 +566,10 @@ def _parse_other_characters(self, rows):
558566 name , world , status , * __ = cols
559567 _ , * name = name .replace ("\xa0 " , " " ).split (" " )
560568 name = " " .join (name )
569+ traded = False
570+ if "(recently traded)" in name :
571+ name = name .replace ("(recently traded)" , "" ).strip ()
572+ traded = True
561573 main_img = cols_raw [0 ].find ('img' )
562574 main = False
563575 if main_img and main_img ['title' ] == "Main Character" :
@@ -566,7 +578,7 @@ def _parse_other_characters(self, rows):
566578 if "CipSoft Member" in status :
567579 position = "CipSoft Member"
568580 self .other_characters .append (OtherCharacter (name , world , "online" in status , "deleted" in status , main ,
569- position ))
581+ position , traded ))
570582
571583 @classmethod
572584 def _parse_tables (cls , parsed_content ):
@@ -779,6 +791,8 @@ class OtherCharacter(abc.BaseCharacter, abc.Serializable):
779791 Whether the character is online or not.
780792 deleted: :class:`bool`
781793 Whether the character is scheduled for deletion or not.
794+ traded: :class:`bool`
795+ Whether the character has been traded recently or not.
782796 main: :class:`bool`
783797 Whether this is the main character or not.
784798 position: :class:`str`
@@ -789,16 +803,18 @@ class OtherCharacter(abc.BaseCharacter, abc.Serializable):
789803 "world" ,
790804 "online" ,
791805 "deleted" ,
806+ "traded" ,
792807 "main" ,
793808 "position" ,
794809 )
795810
796- def __init__ (self , name , world , online = False , deleted = False , main = False , position = None ):
811+ def __init__ (self , name , world , online = False , deleted = False , main = False , position = None , traded = False ):
797812 self .name : str = name
798813 self .world : str = world
799814 self .online : bool = online
800815 self .deleted : bool = deleted
801816 self .main : bool = main
817+ self .traded : bool = traded
802818 self .position : Optional [str ] = position
803819
804820 def __repr__ (self ):
0 commit comments