Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the __name__ variable in plugins #379

Open
pslacerda opened this issue Jul 27, 2024 · 0 comments
Open

Question about the __name__ variable in plugins #379

pslacerda opened this issue Jul 27, 2024 · 0 comments

Comments

@pslacerda
Copy link
Contributor

Why I need to use "pmg_tk.startup.XDrugPy" when testing for __name__ when loading plugins? I test for __name__ because I can't use pymol.Qt from command line scripts.

if __name__ in ["pymol", "pmg_tk.startup.XDrugPy"]:
    import pymol

    QWidget = pymol.Qt.QtWidgets.QWidget
    ...

https://gist.github.com/pslacerda/1e6a14cbe3fc7aeb2425e0a5d74ddc78#file-xdrugpy-py-L853

Note: I'm using PyMOL 2.6 LTS.

@pslacerda pslacerda changed the title Question about the __name__ variable in scripts Question about the __name__ variable in plugins Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant