X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..2187eef5bb7a81ee3b2738a312f4ecfceb49bded:/wxPython/src/gtk/utils.py diff --git a/wxPython/src/gtk/utils.py b/wxPython/src/gtk/utils.py index be380ee5a4..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 @@ -76,6 +79,9 @@ class wxConfigBasePtr : def ReadFloat(self, *_args, **_kwargs): val = apply(utilsc.wxConfigBase_ReadFloat,(self,) + _args, _kwargs) return val + def ReadBool(self, *_args, **_kwargs): + val = apply(utilsc.wxConfigBase_ReadBool,(self,) + _args, _kwargs) + return val def SetExpandEnvVars(self, *_args, **_kwargs): val = apply(utilsc.wxConfigBase_SetExpandEnvVars,(self,) + _args, _kwargs) return val @@ -106,6 +112,9 @@ class wxConfigBasePtr : def WriteFloat(self, *_args, **_kwargs): val = apply(utilsc.wxConfigBase_WriteFloat,(self,) + _args, _kwargs) return val + def WriteBool(self, *_args, **_kwargs): + val = apply(utilsc.wxConfigBase_WriteBool,(self,) + _args, _kwargs) + return val def GetEntryType(self, *_args, **_kwargs): val = apply(utilsc.wxConfigBase_GetEntryType,(self,) + _args, _kwargs) return val @@ -131,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): @@ -148,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): @@ -256,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) @@ -338,10 +356,6 @@ class wxDateTimePtr : def SetToWeekDay(self, *_args, **_kwargs): val = apply(utilsc.wxDateTime_SetToWeekDay,(self,) + _args, _kwargs) return val - def GetWeekDay(self, *_args, **_kwargs): - val = apply(utilsc.wxDateTime_GetWeekDay,(self,) + _args, _kwargs) - if val: val = wxDateTimePtr(val) ; val.thisown = 1 - return val def SetToLastWeekDay(self, *_args, **_kwargs): val = apply(utilsc.wxDateTime_SetToLastWeekDay,(self,) + _args, _kwargs) return val @@ -421,6 +435,9 @@ class wxDateTimePtr : def GetDay(self, *_args, **_kwargs): val = apply(utilsc.wxDateTime_GetDay,(self,) + _args, _kwargs) return val + def GetWeekDay(self, *_args, **_kwargs): + val = apply(utilsc.wxDateTime_GetWeekDay,(self,) + _args, _kwargs) + return val def GetHour(self, *_args, **_kwargs): val = apply(utilsc.wxDateTime_GetHour,(self,) + _args, _kwargs) return val @@ -546,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__' @@ -598,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) @@ -697,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) @@ -849,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 @@ -951,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