Check for validity in __repr__ and __str__
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -809,9 +809,15 @@ public:
|
||||
|
||||
%pythoncode {
|
||||
def __repr__(self):
|
||||
return '<wxDateTime: \"%s\" at %s>' % ( self.Format(), self.this)
|
||||
if self.IsValid():
|
||||
return '<wx.DateTime: \"%s\" at %s>' % ( self.Format(), self.this)
|
||||
else:
|
||||
return '<wx.DateTime: \"INVALID\" at %s>' % self.this
|
||||
def __str__(self):
|
||||
return self.Format()
|
||||
if self.IsValid():
|
||||
return self.Format()
|
||||
else:
|
||||
return "INVALID DateTime"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -955,7 +961,7 @@ public:
|
||||
|
||||
%pythoncode {
|
||||
def __repr__(self):
|
||||
return '<wxTimeSpan: \"%s\" at %s>' % ( self.Format(), self.this)
|
||||
return '<wx.TimeSpan: \"%s\" at %s>' % ( self.Format(), self.this)
|
||||
def __str__(self):
|
||||
return self.Format()
|
||||
}
|
||||
|
Reference in New Issue
Block a user