Command completion was broken after last changes

This commit is contained in:
elias.bachaalany 2010-09-17 12:03:24 +00:00
parent 930b333d3b
commit 0f64f33981

View File

@ -34,10 +34,12 @@
#ifdef HAVE_SSIZE_T #ifdef HAVE_SSIZE_T
#define _SSIZE_T_DEFINED 1 #define _SSIZE_T_DEFINED 1
#endif #endif
#if defined(__NT__) && !defined(_WINDOWS_) #if defined(__NT__) && !defined(_WINDOWS_)
#define _WINDOWS_ // kernwin.hpp needs it to declare create_tform() #define _WINDOWS_ // kernwin.hpp needs it to declare create_tform()
typedef void *HWND; // we don't need to include windows.h for just this definition typedef void *HWND; // we don't need to include windows.h for just this definition
#endif #endif
#include "ida.hpp" #include "ida.hpp"
#include "idp.hpp" #include "idp.hpp"
#include "allins.hpp" #include "allins.hpp"
@ -1971,8 +1973,8 @@ class __IDAPython_Completion_Util(object):
def dir_of(m, prefix): def dir_of(m, prefix):
return [x for x in dir(m) if x.startswith(prefix)] return [x for x in dir(m) if x.startswith(prefix)]
@staticmethod @classmethod
def get_completion(id, prefix): def get_completion(cls, id, prefix):
try: try:
m = sys.modules['__main__'] m = sys.modules['__main__']
@ -1985,11 +1987,11 @@ class __IDAPython_Completion_Util(object):
return (None, None) return (None, None)
else: else:
# search in the module # search in the module
completion = __IDAPython_Completion_Util.dir_of(m, prefix) completion = cls.dir_of(m, prefix)
# no completion found? looking from the global scope? then try the builtins # no completion found? looking from the global scope? then try the builtins
if not completion and c == 1: if not completion and c == 1:
completion = __IDAPython_Completion_Util.dir_of(__builtin__, prefix) completion = cls.dir_of(__builtin__, prefix)
return (m, completion) if completion else (None, None) return (m, completion) if completion else (None, None)