X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1893b029458c15069855bde50889d2a1a82a44e9..7728856b75c201016a30145673bc8a85be96fdfe:/wxPython/src/gtk/utils.py diff --git a/wxPython/src/gtk/utils.py b/wxPython/src/gtk/utils.py index 8bf7b40f86..5dc18f722d 100644 --- a/wxPython/src/gtk/utils.py +++ b/wxPython/src/gtk/utils.py @@ -1,6 +1,6 @@ # This file was created automatically by SWIG. import utilsc -import string +import wx class wxConfigBasePtr : Type_Unknown = utilsc.wxConfigBase_Type_Unknown Type_String = utilsc.wxConfigBase_Type_String @@ -10,9 +10,12 @@ class wxConfigBasePtr : def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,utilsc=utilsc): - if self.thisown == 1 : - utilsc.delete_wxConfigBase(self) + def __del__(self, delfunc=utilsc.delete_wxConfigBase): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def DeleteAll(self, *_args, **_kwargs): val = apply(utilsc.wxConfigBase_DeleteAll,(self,) + _args, _kwargs) return val @@ -137,9 +140,12 @@ class wxConfigPtr(wxConfigBasePtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,utilsc=utilsc): - if self.thisown == 1 : - utilsc.delete_wxConfig(self) + def __del__(self, delfunc=utilsc.delete_wxConfig): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def __repr__(self): return "" % (self.this,) class wxConfig(wxConfigPtr): @@ -154,9 +160,12 @@ class wxFileConfigPtr(wxConfigBasePtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,utilsc=utilsc): - if self.thisown == 1 : - utilsc.delete_wxFileConfig(self) + def __del__(self, delfunc=utilsc.delete_wxFileConfig): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def __repr__(self): return "" % (self.this,) class wxFileConfig(wxFileConfigPtr): @@ -262,9 +271,12 @@ class wxDateTimePtr : def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,utilsc=utilsc): - if self.thisown == 1 : - utilsc.delete_wxDateTime(self) + def __del__(self, delfunc=utilsc.delete_wxDateTime): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def SetToCurrent(self, *_args, **_kwargs): val = apply(utilsc.wxDateTime_SetToCurrent,(self,) + _args, _kwargs) if val: val = wxDateTimePtr(val) @@ -551,17 +563,17 @@ class wxDateTimePtr : return "" % (self.this,) def __add__(self, other): - if string.find(other.this, 'wxTimeSpan') != -1: + if isinstance(other, wxTimeSpanPtr): return self.__add__TS(other) - if string.find(other.this, 'wxDateSpan') != -1: + if isinstance(other, wxDateSpanPtr): return self.__add__DS(other) raise TypeError, 'Invalid r.h.s. type for __add__' def __sub__(self, other): - if string.find(other.this, 'wxDateTime') != -1: + if isinstance(other, wxDateTimePtr): return self.__sub__DT(other) - if string.find(other.this, 'wxTimeSpan') != -1: + if isinstance(other, wxTimeSpanPtr): return self.__sub__TS(other) - if string.find(other.this, 'wxDateSpan') != -1: + if isinstance(other, wxDateSpanPtr): return self.__sub__DS(other) raise TypeError, 'Invalid r.h.s. type for __sub__' @@ -603,9 +615,12 @@ class wxTimeSpanPtr : def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,utilsc=utilsc): - if self.thisown == 1 : - utilsc.delete_wxTimeSpan(self) + def __del__(self, delfunc=utilsc.delete_wxTimeSpan): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def Add(self, *_args, **_kwargs): val = apply(utilsc.wxTimeSpan_Add,(self,) + _args, _kwargs) if val: val = wxTimeSpanPtr(val) @@ -702,9 +717,12 @@ class wxDateSpanPtr : def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,utilsc=utilsc): - if self.thisown == 1 : - utilsc.delete_wxDateSpan(self) + def __del__(self, delfunc=utilsc.delete_wxDateSpan): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def SetYears(self, *_args, **_kwargs): val = apply(utilsc.wxDateSpan_SetYears,(self,) + _args, _kwargs) if val: val = wxDateSpanPtr(val) @@ -854,6 +872,11 @@ def wxDateTime_Now(*_args, **_kwargs): if val: val = wxDateTimePtr(val); val.thisown = 1 return val +def wxDateTime_UNow(*_args, **_kwargs): + val = apply(utilsc.wxDateTime_UNow,_args,_kwargs) + if val: val = wxDateTimePtr(val); val.thisown = 1 + return val + def wxDateTime_Today(*_args, **_kwargs): val = apply(utilsc.wxDateTime_Today,_args,_kwargs) if val: val = wxDateTimePtr(val); val.thisown = 1 @@ -956,3 +979,4 @@ def wxDateSpan_Year(*_args, **_kwargs): wxCONFIG_USE_LOCAL_FILE = utilsc.wxCONFIG_USE_LOCAL_FILE wxCONFIG_USE_GLOBAL_FILE = utilsc.wxCONFIG_USE_GLOBAL_FILE wxCONFIG_USE_RELATIVE_PATH = utilsc.wxCONFIG_USE_RELATIVE_PATH +wxCONFIG_USE_NO_ESCAPE_CHARACTERS = utilsc.wxCONFIG_USE_NO_ESCAPE_CHARACTERS