1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Author : Anthony Geay (EDF R&D)
25 def _raiseNow(strCont):
26 raise Exception("The method %s has been called whereas it is an interface !"%strCont)
28 class WrappedType(object, metaclass=abc.ABCMeta):
29 """ Here definition of an interface in python."""
35 _raiseNow("local_copy")
40 class List(WrappedType):
42 def __getitem__(self,*args):
43 _raiseNow("__getitem__")
45 def __setitem__(self,*args):
46 _raiseNow("__setitem__")
48 def __delitem__(self,*args):
49 _raiseNow("__delitem__")
51 def append(self,*args):
54 def extend(self,*args):
57 def insert(self,*args):
63 def remove(self,*args):
66 def reverse(self,*args):
73 def count(self,*args):
76 def index(self,*args):
83 class Dict(WrappedType):
85 def __getitem__(self,*args):
86 _raiseNow("__getitem__")
88 def __setitem__(self,*args):
89 _raiseNow("__setitem__")
91 def __delitem__(self,*args):
92 _raiseNow("__delitem__")
94 def clear(self,*args):
100 def items(self,*args):
106 def popitem(self,*args):
109 def setdefault(self,*args):
110 _raiseNow("setdefault")
112 def update(self,*args):
115 def values(self,*args):
119 def __contains__(self,*args):
120 _raiseNow("__contains__")
122 def has_key(self,*args):
125 def keys(self,*args):
128 def copy(self,*args):
135 class Tuple(WrappedType):
137 def __getitem__(self,*args):
138 _raiseNow("__getitem__")
141 def count(self,*args):
144 def index(self,*args):
151 class Float(WrappedType):
153 def __iadd__(self,*args):
154 _raiseNow("__iadd__")
156 def __isub__(self,*args):
157 _raiseNow("__isub__")
159 def __imul__(self,*args):
160 _raiseNow("__imul__")
162 def __idiv__(self,*args):
163 _raiseNow("__idiv__")
165 def __add__(self,*args):
168 def __sub__(self,*args):
171 def __mul__(self,*args):
174 def __div__(self,*args):
177 def __pow__(self,*args):
180 def as_integer_ratio(self,*args):
181 _raiseNow("as_integer_ratio")
183 def conjugate(self,*args):
184 _raiseNow("conjugate")
186 def fromhex(self,*args):
192 def imag(self,*args):
195 def is_integer(self,*args):
196 _raiseNow("is_integer")
198 def real(self,*args):
202 class Int(WrappedType):
204 def __iadd__(self,*args):
205 _raiseNow("__iadd__")
207 def __isub__(self,*args):
208 _raiseNow("__isub__")
210 def __imul__(self,*args):
211 _raiseNow("__imul__")
213 def __imod__(self,*args):
214 _raiseNow("__imod__")
216 def __idiv__(self,*args):
217 _raiseNow("__idiv__")
219 def __add__(self,*args):
222 def __sub__(self,*args):
225 def __mul__(self,*args):
228 def __mod__(self,*args):
231 def __div__(self,*args):
234 def __pow__(self,*args):
237 def bit_length(self,*args):
238 _raiseNow("bit_length")
240 def conjugate(self,*args):
241 _raiseNow("conjugate")
243 def denominator(self,*args):
244 _raiseNow("denominator")
246 def imag(self,*args):
249 def numerator(self,*args):
250 _raiseNow("numerator")
252 def real(self,*args):
256 class String(WrappedType):
258 def __add__(self,*args):
261 def __iadd__(self,*args):
262 _raiseNow("__iadd__")
264 def __getitem__(self,*args):
265 _raiseNow("__getitem__")
267 def capitalize(self,*args):
268 _raiseNow("capitalize")
270 def center(self,*args):
273 def count(self,*args):
276 def decode(self,*args):
279 def encode(self,*args):
282 def endswith(self,*args):
283 _raiseNow("endswith")
285 def expandtabs(self,*args):
286 _raiseNow("expandtabs")
288 def find(self,*args):
291 def format(self,*args):
294 def index(self,*args):
297 def isalnum(self,*args):
300 def isalpha(self,*args):
303 def isdigit(self,*args):
306 def islower(self,*args):
309 def isspace(self,*args):
312 def istitle(self,*args):
315 def isupper(self,*args):
318 def join(self,*args):
321 def ljust(self,*args):
324 def lower(self,*args):
327 def lstrip(self,*args):
330 def partition(self,*args):
331 _raiseNow("partition")
333 def replace(self,*args):
336 def rfind(self,*args):
339 def rindex(self,*args):
342 def rjust(self,*args):
345 def rpartition(self,*args):
346 _raiseNow("rpartition")
348 def rsplit(self,*args):
351 def rstrip(self,*args):
354 def split(self,*args):
357 def splitlines(self,*args):
358 _raiseNow("splitlines")
360 def startswith(self,*args):
361 _raiseNow("startswith")
363 def strip(self,*args):
366 def swapcase(self,*args):
367 _raiseNow("swapcase")
369 def title(self,*args):
372 def translate(self,*args):
373 _raiseNow("translate")
375 def upper(self,*args):
378 def zfill(self,*args):