Merge pull request #12 from lallousx86/minor-mods

Some minor fixes
This commit is contained in:
Elias Bachaalany
2017-06-22 16:06:15 -07:00
committed by GitHub
5 changed files with 39 additions and 54 deletions
+8 -1
View File
@@ -15,7 +15,14 @@ def main():
seg = getseg(ea)
# Loop from segment start to end
func = get_next_func(seg.startEA)
func_ea = seg.startEA
# Get a function at the start of the segment (if any)
func = get_func(func_ea)
if func is None:
# No function there, try to get the next one
func = get_next_func(func_ea)
seg_end = seg.endEA
while func is not None and func.startEA < seg_end:
funcea = func.startEA
+26 -27
View File
@@ -1535,38 +1535,37 @@ bool pywraps_notify_when_t::notify_va(int slot, va_list va)
in_notify = true;
int old = slot == NW_OPENIDB_SLOT ? va_arg(va, int) : 0;
for ( ref_vec_t::iterator it = table[slot].begin(), it_end = table[slot].end();
it != it_end;
++it )
{
for ( ref_vec_t::iterator it = table[slot].begin(), it_end = table[slot].end();
it != it_end;
++it )
// Form the notification code
newref_t py_code(PyInt_FromLong(1 << slot));
ref_t py_result;
switch ( slot )
{
// Form the notification code
newref_t py_code(PyInt_FromLong(1 << slot));
ref_t py_result;
switch ( slot )
{
case NW_CLOSEIDB_SLOT:
case NW_INITIDA_SLOT:
case NW_TERMIDA_SLOT:
{
py_result = newref_t(PyObject_CallFunctionObjArgs(it->o, py_code.o, NULL));
break;
}
case NW_OPENIDB_SLOT:
{
newref_t py_old(PyInt_FromLong(old));
py_result = newref_t(PyObject_CallFunctionObjArgs(it->o, py_code.o, py_old.o, NULL));
}
case NW_CLOSEIDB_SLOT:
case NW_INITIDA_SLOT:
case NW_TERMIDA_SLOT:
{
py_result = newref_t(PyObject_CallFunctionObjArgs(it->o, py_code.o, NULL));
break;
}
if ( PyW_GetError(&err) || py_result == NULL )
{
PyErr_Clear();
warning("notify_when(): Error occured while notifying object.\n%s", err.c_str());
ok = false;
}
}
case NW_OPENIDB_SLOT:
{
newref_t py_old(PyInt_FromLong(old));
py_result = newref_t(PyObject_CallFunctionObjArgs(it->o, py_code.o, py_old.o, NULL));
}
break;
}
if ( PyW_GetError(&err) || py_result == NULL )
{
PyErr_Clear();
warning("notify_when(): Error occured while notifying object.\n%s", err.c_str());
ok = false;
}
}
in_notify = false;
// Process any delayed notify_when() calls that
+2 -20
View File
@@ -26,12 +26,14 @@ class Choose(object):
if (flags & Choose2.CH_MODAL) == 0:
self.refhack = self
def sizer(self):
"""
Callback: sizer - returns the length of the list
"""
return len(self.list)
def getl(self, n):
"""
Callback: getl - get one item from the list
@@ -44,30 +46,10 @@ class Choose(object):
return "<Empty>"
def ins(self):
pass
def update(self, n):
pass
def edit(self, n):
pass
def enter(self, n):
print "enter(%d) called" % n
def destroy(self):
pass
def get_icon(self, n):
pass
def choose(self):
"""
choose - Display the choose dialogue
+1 -1
View File
@@ -276,7 +276,7 @@ private:
PYW_GIL_GET;
pycall_res_t pyres(PyObject_CallMethod(self, (char *)S_ON_CLOSE, NULL));
// Delete this instance if none modal and not embedded
// Delete this instance if non-modal and not embedded
if ( !is_modal() && get_embedded() == NULL )
delete this;
}
+2 -5
View File
@@ -87,7 +87,7 @@ class Choose2(object):
"""
Activates or creates a chooser window
@param modal: Display as modal dialog
@return: For modal choosers it will return the selected item index (0-based)
@return: For modal choosers it will return the selected item index (0-based) or -1 if no selection
"""
if modal:
self.flags |= Choose2.CH_MODAL
@@ -207,17 +207,14 @@ class Choose2(object):
# Triggered when the 'Refresh' is called from the popup menu item.
#
# @param n: The currently selected line (0-based) at the time of the refresh call
# @return: Return the number of elements
# @return: Return the new selected line
# """
# return self.n
#
# def OnRefreshed(self):
# """
# Triggered when a refresh happens (for example due to column sorting)
# @param n: Line number (0-based)
# @return: Return the number of elements
# """
# return self.n
#
# def OnCommand(self, n, cmd_id):
# """Return int ; check add_chooser_command()"""