Bonjour,
J'ai une application en python/gtk (python 2.7).
j'ai une erreur déclenché dan la procédure suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
def abstract():
 
    import inspect
 
    caller = inspect.getouterframes(inspect.currentframe())[1][3]
    print "currentframe=",inspect.currentframe()
    print "getouterframes="
    for i in inspect.getouterframes(inspect.currentframe()):
	print i
 
    print "getouterframes[1][3]=",inspect.getouterframes(inspect.currentframe())[1][3]
    print
    raise NotImplementedError(caller + ' must be implemented in subclass')
J'ai rajouté les print afin d'avoir les détails sur ce que retourne les fonctions d'inspect.
En réalité je ne comprends pas pourquoi une exception est levée et comment l'interprêter. Voici l'erreur signalée :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
currentframe= <frame object at 0x9ed8d9c>
getouterframes=
(<frame object at 0x9ed8d9c>, '/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/genericpanel.py', 37, 'abstract', ['    for i in inspect.getouterframes(inspect.currentframe()):\n'], 0)
(<frame object at 0x9f0297c>, '/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/genericpanel.py', 313, 'GenericPanelGet_AllPages', ['\t\tabstract()\n'], 0)
(<frame object at 0x9fd251c>, '/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/genericpanel.py', 323, 'GenericPanelGet_SamePages', ['\t\t\tfor page in panel.GenericPanelGet_AllPages():\n'], 0)
(<frame object at 0x9ee64a4>, '/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/page.py', 455, 'PageWinDialogReturn', ['\t\tfor page in self.f_GetSamePages():\n'], 0)
(<frame object at 0x9fc8cc4>, '/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/windialogedition.py', 398, 'WinDialogCallback', ['\t\t\tcallbackExit(True)\n'], 0)
(<frame object at 0x9bab8ec>, '/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/windialogedition.py', 701, 'WinDialogCallback', ['\t\tWinDialogEdition__.WinDialogCallback(self, dialogWidget, response, callbackExit)\n'], 0)
(<frame object at 0x9b05254>, './HMI/nedi.py', 322, 'ApplicationRun', ['\t\tgtk.main()\n'], 0)
(<frame object at 0x92b07d4>, './HMI/nedi.py', 858, '<module>', ['\tnedi.ApplicationRun()\n'], 0)
getouterframes[1][3]= GenericPanelGet_AllPages
 
Traceback (most recent call last):
  File "/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/windialogedition.py", line 701, in WinDialogCallback
    WinDialogEdition__.WinDialogCallback(self, dialogWidget, response, callbackExit)
  File "/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/windialogedition.py", line 398, in WinDialogCallback
    callbackExit(True)
  File "/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/page.py", line 455, in PageWinDialogReturn
    for page in self.f_GetSamePages():
  File "/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/genericpanel.py", line 323, in GenericPanelGet_SamePages
    for page in panel.GenericPanelGet_AllPages():
  File "/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/genericpanel.py", line 313, in GenericPanelGet_AllPages
    abstract()
  File "/rsynergy/ccm_wa/NEDI-ACE2010A_prep/NEDI/HMI/genericpanel.py", line 41, in abstract
    raise NotImplementedError(caller + ' must be implemented in subclass')
NotImplementedError: GenericPanelGet_AllPages must be implemented in subclass
Je lis que GenericPanelGet_AllPages (qui est bien une fonction de mon appli) doit être implémentée, que cela signifie t'il ?
Ma fonction GenericPanelGet_AllPages est très simple :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
	def GenericPanelGet_AllPages(self):
		abstract()
Quelqu'un peut t'il m'éclairer ?
merci