foni / dicompyler

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

Calling dicompyler as class fails without wx installed #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to import a dicompyler module from within another python code, i.e., 
>>> from dicompyler import dvhcalc

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

File "Test.py"
    from dicompyler import dvhcalc
File ".../dicompyler/__init__.py"
    from main import start, __version__
File ".../dicompyler/main.py"
    import wx
ImportError: No module named wx

What version of the product are you using? On what operating system?

Dicompyler 0.4.1-1 on solaris (Pinnacle box)

Please provide any additional information below.

In file __init__.py, please consider moving all import commands to within the 
'__main__' code, as follows:

if __name__ == '__main__':
    from main import start, __version__
    import dicompyler.main()
    dicompyler.main.start()

That way, one can use dicompyler as a class in other codes without having to 
install wx. Thank you.

Original issue reported on code.google.com by scott.p....@gmail.com on 1 Apr 2014 at 8:58

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for the suggestion and code changes. I will consider this for the 
next version as this change would be helpful for non-gui users.

Original comment by bastula on 2 Apr 2014 at 2:26

GoogleCodeExporter commented 9 years ago
I´m having the same problem! ImportError: No module named wx!

Original comment by pedroarg...@gmail.com on 4 Apr 2014 at 11:44

GoogleCodeExporter commented 9 years ago
dicompyler by itself was not intended to be used standalone without a GUI. 
However, it might be considered spinning off the DICOM parser and related 
modules into a separate package. That way those tools can be used by GUI and 
non-GUI projects.

Original comment by bastula on 6 Apr 2014 at 7:01