theodox / mGui

Python module for cleaner maya GUI layout syntax
MIT License
123 stars 23 forks source link

Problem instantiating menus with menu_loader.py #85

Closed theodox closed 7 years ago

theodox commented 7 years ago

Original report here:

am trying to run mGui.menu_loader with a yaml file, copying the example you show in your post, and yet I can't. I have the error Error: AttributeError: file D:\packages\mayaBase\mGui\menu_loader.py line 173: 'str' object has no attribute 'instantiate' Maybe I forgot something ... I have the latest Pyyaml version installed (3.12)

The disqus link for the blog post this was attached to is busted, so creating this for tracking.

theodox commented 7 years ago

Here's a couple of test to try and help debug this:

1) Do you get an import error if you try import yaml in the code which is calling the menu loader? 2) What's the text encoding on the file? I've tried it with ascii and UTF-8; if you're using something else that might be a problem for yaml 3) Could you post a direct copy of the yaml you're trying to load? 4) I've added a menu loader example in the #79 branch, which will be going live in the next few days. You can try that branch and see if it makes a difference

brumenn commented 7 years ago

I've tried your possibilities and now I can make it works. I had no import error with import yaml, the text encoding was UTF-8, and the yaml content was a copy of your's on the "mGui updates" post.

But with the #79 branch, it's work perfectly ! With the same yaml file as before, so maybe there just somes issues with the old version.

Thank's for your quick answers, your time and your amazing work ! Best regards

theodox commented 7 years ago

Glad it works. Actually the #79 branch was merged and released as version 2.2 yesterday, it includes a couple of fixes so you might want to standardize on it

https://github.com/theodox/mGui/releases/tag/2.2

On Tue, Jul 25, 2017 at 2:02 PM, Nicolas Castelli notifications@github.com wrote:

I've tried your possibilities and now I can make it works. I had no import error with import yaml, the text encoding was UTF-8, and the yaml content was a copy of your's on the "mGui updates" post.

But with the #79 https://github.com/theodox/mGui/pull/79 branch, it's work perfectly ! With the same yaml file as before, so maybe there just somes issues with the old version.

Thank's for your quick answers, your time and your amazing work ! Best regards

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/theodox/mGui/issues/85#issuecomment-317871222, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3mGNba1lFu9KTNLPNnOztJE_5EFlphks5sRlfXgaJpZM4OgVB7 .