ECToo / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

Callback for logging menu build throwing errors #244

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the problem.

# Error: CallbackError: file 
d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\internal\factories.py line 744: 
Error executing callback <bound method LoggingMenu.refresh of 
ui.LoggingMenu('MayaWindow|pymelLoggingControl')> - refresh - module 
pymel.tools.loggingControl - 
d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\tools\loggingControl.py, line 113

Original message:
Traceback (most recent call last):
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\internal\factories.py", line 742, in callback
    res = origCallback( *newargs )
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\tools\loggingControl.py", line 121, in refresh
    self.refreshLoggingMenu()
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\tools\loggingControl.py", line 35, in refreshLoggingMenu
    self.buildSubMenu(self, logging.root)
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\tools\loggingControl.py", line 65, in buildSubMenu
    pymel.menuItem(l="Remove", p=parent, ob=True, c=pymel.Callback(logger.removeHandler, item))
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\internal\factories.py", line 764, in newUiFunc
    return beforeUiFunc(*args, **kwargs)
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\internal\factories.py", line 878, in newFuncWithReturnFunc
    res = beforeReturnFunc(*args, **kwargs)
  File "d:\dropbox\nick\auxiliary\__2.6_64\PyMel\pymel\internal\pmcmds.py", line 134, in wrappedCmd
    res = new_cmd(*new_args, **new_kwargs)
RuntimeError: Option box items must be inserted after valid menu items. # 

What Version of Maya are you using?

On what operating system? (be as specific as possible and include service
packs, 64bit vs 32bit, etc)

Win7x64

What Version of PyMEL are you using?

1.0.3

What is the expected output? What do you see instead?

If possible, provide a few lines of code to reproduce the problem. It helps
us if your code will reproduce the problem from a new scene.

Does maya.cmds exhibit the same problem?

N/A

Please provide any additional information below.

Apologize for the wonky path that pymel sources from.

The issue seems to be int he option box building for the logging menu.
This is a complaint, not an error per se because the entire menu builds, 
including all our internal loggers, etc... correctly (AFAIK).

It happens on every click of the menu, which I assume is re-building everytime, 
so, same error everytime.

Original issue reported on code.google.com by amor...@gmail.com on 1 May 2011 at 5:20

GoogleCodeExporter commented 9 years ago
I changed line 65 in pymel\tools\loggingControl.py from:

pymel.menuItem(l="Remove", p=parent, ob=parent, 
c=pymel.Callback(logger.removeHandler, item))

INTO:

pymel.menuItem(l="Remove", p=levelsMenu, c=pymel.Callback(logger.removeHandler, 
item))

and it seems to give the desired behavior of removing the handler.

Original comment by amor...@gmail.com on 1 May 2011 at 5:27

GoogleCodeExporter commented 9 years ago
updating to 1.0.3 fixed this issue for me.

Original comment by geordiem...@gmail.com on 9 Aug 2011 at 5:04