View Issue Details

IDProjectCategoryView StatusLast Update
0002194Slicer4Core: QtTestingpublic2012-07-30 07:19
Reporterfinetjul Assigned ToBenjaminLong  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0002194: Configure ApplicationsSlicerAppData.py into build tree
Description

From Julien - June 13, 2012:

In CMakeLists.txt of SlicerApp/Testing/Python
You generate a python file in the source code:
configure_file(
ApplicationsSlicerAppData.py.in
${CMAKE_CURRENT_SOURCE_DIR}/ApplicationsSlicerAppData.py
)
The source code should never be changed. Can you please generate that file in the CURRENT_BINARY_DIR instead ?

TagsNo tags attached.

Activities

jcfr

jcfr

2012-06-13 13:18

administrator   ~0004815

//--------------
Benjaming - June 13, 2012:

the ApplicationsSlicerAppData.py are with the other python files because we include it.
How can I include it if ApplicationsSlicerAppData.py is far away ?
Thanks,
Benjamin

//--------------
Jc - June 13, 2012:

Python path / sys.path is your friend. You could look at how things are done with python_unit_test.
Jc

//--------------
Benjaming - June 13, 2012:

What about adding the file into Base/Pyhton/Slicer ?
and after I should be able to do "from Slicer import ApplicationsSlicerAppData"

jcfr

jcfr

2012-06-13 13:23

administrator   ~0004816

Make sens, I also propose the file is renamed:
ApplicationsSlicerAppDataPaths.py.in / ApplicationsSlicerAppDataPaths.py

BenjaminLong

BenjaminLong

2012-06-13 13:45

reporter   ~0004818

Last edited: 2012-06-13 13:51

every files are named lowercase in this directory.
Maybe we should name it : appdatapath.py or appdata.py instead

jcfr

jcfr

2012-06-13 14:01

administrator   ~0004819

Indeed, the idea is to follow this convention [1]

slicerappdatapaths.py

May be we could add the file into a folder named "datapaths", it means we would have:

slicer/datapaths/slicerapp.py

Later we could then add file like these ones if it makes sens:

slicer/datapaths/baseqtcore.py
slicer/datapaths/baseqtgui.py
slicer/datapaths/mrml.py

What do you think ?

[1] http://www.python.org/dev/peps/pep-0008/#package-and-module-names

BenjaminLong

BenjaminLong

2012-06-13 14:05

reporter   ~0004821

As long as we don't need more path, we should stay with slicerappdatapaths.py

finetjul

finetjul

2012-06-13 14:06

administrator   ~0004822

Last edited: 2012-06-13 14:06

Jc: "Indeed, the idea is to follow this convention [1]"
-> can you update the Slicer coding style guide ?

jcfr

jcfr

2012-06-13 14:15

administrator   ~0004823

1) slicerappdatapaths.py sounds good to me. Make sure the file is not installed, it wouldn't make sens.

2) Python guidelines have been updated. See http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Developers/Style_Guide/Python#Guidelines

BenjaminLong

BenjaminLong

2012-06-13 14:28

reporter   ~0004825

fixed in r20354:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=20354

jcfr

jcfr

2012-06-13 16:20

administrator   ~0004827

The file "Python/slicer/slicerappdatapaths.py" should NOT be committed, it currently contain hard coded value !

The file Applications/SlicerApp/Testing/Python/slicerappdatapaths.py.in should be configured into the the build directory:

${Slicer_BINARY_DIR}/bin/Python/slicer

BenjaminLong

BenjaminLong

2012-06-14 10:05

reporter   ~0004831

Fixed in r20363
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=20363

jcfr

jcfr

2012-06-14 10:23

administrator   ~0004832

I suggested the use of "${Slicer_BINARY_DIR}/bin/Python/slicer" because I anticipated that you would keep the file "slicerappdatapaths.py.in" in "pplications/SlicerApp/Testing/Python/"

I would recommend to move the file "slicerappdatapaths.py.in"

If you convince me that moving "slicerappdatapaths.py.in" is not what we should do, use ${CMAKE_CURRENT_BINARY_DIR}/slicer/slicerappdatapaths.py instead of "${Slicer_BINARY_DIR}/bin/Python/slicer/slicerappdatapaths.py". See http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Base/Python/CMakeLists.txt?view=markup&pathrev=20363#l59

BenjaminLong

BenjaminLong

2012-06-14 12:34

reporter   ~0004835

Fixed in r20366
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=20366

jcfr

jcfr

2012-06-14 12:40

administrator   ~0004836

Thanks :)

Make also sure to fix indent, it is missing two spaces. See http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Applications/SlicerApp/Testing/Python/CMakeLists.txt?view=markup&pathrev=20366#l166

jcfr

jcfr

2012-07-27 15:40

administrator   ~0005398

Dear issue reporter,

Good news :) Slicer developers SOLVED the problem you reported - YOU now need to VERIFY and CLOSE this issue.

Issue History

Date Modified Username Field Change
2012-06-13 12:13 jcfr New Issue
2012-06-13 12:13 jcfr Status new => assigned
2012-06-13 12:13 jcfr Assigned To => BenjaminLong
2012-06-13 12:13 jcfr Reporter jcfr => finetjul
2012-06-13 12:13 jcfr Target Version => Slicer 4.2.0 - Sept 1st 2012
2012-06-13 13:18 jcfr Note Added: 0004815
2012-06-13 13:23 jcfr Note Added: 0004816
2012-06-13 13:45 BenjaminLong Note Added: 0004818
2012-06-13 13:51 BenjaminLong Note Edited: 0004818
2012-06-13 14:01 jcfr Note Added: 0004819
2012-06-13 14:05 BenjaminLong Note Added: 0004821
2012-06-13 14:06 finetjul Note Added: 0004822
2012-06-13 14:06 finetjul Note Edited: 0004822
2012-06-13 14:15 jcfr Note Added: 0004823
2012-06-13 14:28 BenjaminLong Note Added: 0004825
2012-06-13 14:28 BenjaminLong Status assigned => resolved
2012-06-13 14:28 BenjaminLong Resolution open => fixed
2012-06-13 16:20 jcfr Note Added: 0004827
2012-06-13 16:20 jcfr Status resolved => assigned
2012-06-14 10:05 BenjaminLong Note Added: 0004831
2012-06-14 10:05 BenjaminLong Status assigned => resolved
2012-06-14 10:23 jcfr Note Added: 0004832
2012-06-14 10:33 jcfr Status resolved => assigned
2012-06-14 12:34 BenjaminLong Note Added: 0004835
2012-06-14 12:34 BenjaminLong Status assigned => resolved
2012-06-14 12:40 jcfr Note Added: 0004836
2012-07-27 15:40 jcfr Note Added: 0005398
2012-07-30 07:19 finetjul Status resolved => closed
2012-07-30 07:19 finetjul Fixed in Version => Slicer 4.2.0 - October 1st 2012