Qucs / qucs-test

Qucs Project test suite and scripts repository
5 stars 14 forks source link

args.process causes issue if os.name==nt #17

Closed ldpgh closed 7 years ago

ldpgh commented 7 years ago

Try to run ... python run.py --prefix C:\ProgrammeLutz\Qt\Qt4.8.6\bin --add-test C:/Users/kk/.qucs/AAA_kannweg_ist_in_qucs-test__GUI_rect3ddiagram_prj/rect3ddiagram_1x_diode_dblswp_qucs.sch -p

The script exits with

Traceback (most recent call last):
  File "run.py", line 916, in <module>
    nprocs = args.processes
AttributeError: 'Namespace' object has no attribute 'processes'

It seems on Win7Pro (os.name="nt") the return value args of function parse_options() at line 519 has no member variable processes as required by line 919 (nprocs = args.processes).

Root cause seems to be line 514. It prevents adding the required property by if (os.name != 'nt'):. There is no else-branch adding the required member variable.


PS. Ignore the strange parameter to --prefix. It's a hack to get qucs.exe created with QtCreator running. Qucsator path is manipulated to get it running.

ldpgh commented 7 years ago

Just to proceed for the moment. The value nprocs = args.processes has been replaced by nprocs = None

guitorri commented 7 years ago

If you are browsing the code on GitHub, if you click on the line number it creates a link directly to that line ( you can also choose a version of the file). If you copy and paste we can directly go to the lines you mentioned.

in3otd commented 7 years ago

ops, that's me that here forgot that multiprocessing was used also for printing.

ldpgh commented 7 years ago

@in3otd ... it seems if arg.print section needs to be modified as well. It creates strange

. . .
Running :  C:\ProgrammeLutz\Qt\Qt4.8.6\bin\qucs.exe -p -i C:\Users\kk\qucs\qucs-test\testsuite\TR_single_balanced_prj\single_balanced.sch -o C:\Users\kk\qucs\qucs-test\testsuite\TR_single_balanced_prj\single_balanced.pdf
Running :  C:\ProgrammeLutz\Qt\Qt4.8.6\bin\qucs.exe -p -i C:\Users\kk\qucs\qucs-test\testsuite\TR_supply_prj\supply.sch -o C:\Users\kk\qucs\qucs-test\testsuite\TR_supply_prj\supply.pdf
Running :  C:\ProgrammeLutz\Qt\Qt4.8.6\bin\qucs.exe -p -i C:\Users\kk\qucs\qucs-test\testsuite\TR_sym_osci_prj\sym_osci.sch -o C:\Users\kk\qucs\qucs-test\testsuite\TR_sym_osci_prj\sym_osci.pdf
Traceback (most recent call last):
  File "run.py", line 933, in <module>
    results = [p.get() for p in testsp] # get results
  File "C:\ProgrammeLutz\Python\Python2.7.12\lib\multiprocessing\pool.py", line 567, in get
    raise self._value
NameError: global name 'maxTime' is not defined
ldpgh commented 7 years ago

Comment removed ... ldpgh

in3otd commented 7 years ago

yep, --add-test is for adding a project to the testsuite; to select a project to print use --project. Se examples of usage here (in any case, printing may not work well on Windows due to the above-mentioned multiprocessing stuff)

in3otd commented 7 years ago

@ldpgh, see #18 for a fix to make printing working on Windows also.