aarronc / hutton-helper

data collection tool to aid in better management of the BGS
9 stars 4 forks source link

Clash with USS Survey? #66

Closed sporebat closed 5 years ago

sporebat commented 6 years ago

They're working OK together for me, but not for a commander reporting in Facebook.

image

NoFoolLikeOne commented 6 years ago

I'll have a look at the USS survey and see what needs doing

NoFoolLikeOne commented 6 years ago

Wasn't working at all for me. The problem was that widgets.py was being picked from USS Survey and so HH was failing.

I am delivering a new version of USS Survey but really you ought to come up with a namespace solution perhaps put your modules in a sub directory like hhlib/widgets.py

NoFoolLikeOne commented 6 years ago

New release of USS Survey delivered. But its possible this sort of thing could occur with other plugins,

sporebat commented 6 years ago

That's why I rewrote sys.path: so we wouldn't inhale other plugins' modules. I'm alarmed it didn't help.

sporebat commented 6 years ago

I've done some testing with USS Survey 4.4.4, Hutton Helper 2.1.16, and EDMC d0487d1 after 3.12.1. I can't yet reproduce our commander's issue despite adjusting EDMC's plug.load_plugins to force both loading orders: HH first, and HH last.

sporebat commented 6 years ago

Note that EDMC's habit of putting each plugin's directory last in sys.path just before importing it would seem to guarantee problems for anyone coming last. Making yourself a "package plugin" by adding __init__.py helps only until the user installs another package plugin with a lexically earlier name.

sporebat commented 6 years ago

Might be mitigated by a change at the USS Survey end but I'm still investigating in case we can get EDMC to fix the architectural problem behind it.

NoFoolLikeOne commented 6 years ago

If you put all your modules in a subdirectory with an empty file __init__.py

alvin
    __init__.py
    widgets.py
   etc.py

then you can import with import alvin.widgets and hopefully get some additional protection from clashes?

Ive just been testing usin the cyrillic account and still getting issues with importing local modules. I'm goint to raise it in the EDMC discord