Browse Source

Merge branch 'master' of wiscigt.powertheword.com:labkey/nixsuite

Andrej 3 years ago
parent
commit
ba386f6279
3 changed files with 17 additions and 18 deletions
  1. BIN
      remoteResources/.resources.json.swp
  2. 4 9
      remoteResources/resources.json
  3. 13 9
      wrapper/nixWrapper.py

BIN
remoteResources/.resources.json.swp


+ 4 - 9
remoteResources/resources.json

@@ -4,11 +4,6 @@
 		"branch":"master",
 		"modules":[]
 	},
-	"orthancInterface":{
-		"url":"http://wiscigt.powertheword.com/andrej.studen/orthancinterface/-/archive/master/orthancinterface-master.zip",
-		"branch":"master",
-		"modules":[]
-	},
 	"irAEMM":{
 		"url":"http://wiscigt.powertheword.com/oil/iraemm/-/archive/master/iraemm-master.zip",
 		"branch":"master",
@@ -19,13 +14,13 @@
 		"branch":"SlicerExtensionIndex",
 		"modules":["labkeyBrowser"]
 	},
-	"EMBRACE":{
-		"url":"http://wiscigt.powertheword.com/oil/EMBRACE/-/archive/master/EMBRACE-master.zip",
+	"parseConfig":{
+		"url":"http://wiscigt.powertheword.com/labkey/parseconfig/-/archive/master/parseconfig-master.zip",
 		"branch":"master",
 		"modules":[]
 	},
-	"DICOMtools":{
-		"url":"http://wiscigt.powertheword.com/labkey/DICOMtools/-/archive/master/DICOMtools-master.zip",
+	"orthancInterface":{
+		"url":"http://wiscigt.powertheword.com/andrej.studen/orthancinterface/-/archive/master/orthancinterface-master.zip",
 		"branch":"master",
 		"modules":[]
 	}

+ 13 - 9
wrapper/nixWrapper.py

@@ -73,7 +73,19 @@ def loadModule(slicer,qt,name,moduleName):
     slicer.util.selectModule(moduleName)
 
 
-def loadLibrary(name):
+def loadLibrary(name,doReload=True):
+
+    installDir=getSuitePath()
+    finalName=os.path.join(installDir,name)
+    if os.path.isdir(finalName):
+        if not doReload:
+            #1 keep existing copy, return
+            sys.path.append(finalName)
+            return
+        else:
+            #1 remove existing copy
+            shutil.rmtree(finalName)
+    
     #load library from git, store it at a default location and 
     #add path to the python sys
     remoteSources=getResources()
@@ -101,14 +113,6 @@ def loadLibrary(name):
     r.release_conn()
     
     #2 Unzip
-    installDir=getSuitePath()
-
-    #3 remove existing copy
-    finalName=os.path.join(installDir,name)
-    if os.path.isdir(finalName):
-        shutil.rmtree(finalName)
-
-    #unzip
     with zipfile.ZipFile(tempFile,'r') as zip_ref:
         zip_ref.extractall(installDir)