Преглед на файлове

Running version on windows

Andrej Studen @ Win7 преди 7 години
родител
ревизия
e65c602971
променени са 2 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. 1 1
      labkeySlicerPythonExtension/labkeySlicerPythonExtension.py
  2. 9 2
      labkeySlicerPythonExtension/slicerNetwork.py

+ 1 - 1
labkeySlicerPythonExtension/labkeySlicerPythonExtension.py

@@ -198,7 +198,7 @@ class labkeySlicerPythonExtensionWidget(ScriptedLoadableModuleWidget):
 
   def onCaCertButtonClicked(self):
       filename=qt.QFileDialog.getOpenFileName(None,'Open authority certificate',
-               self.startDir, filter='*.crt')
+               self.startDir, '*.crt')
       if not(filename) :
          print "No file selected"
          return

+ 9 - 2
labkeySlicerPythonExtension/slicerNetwork.py

@@ -76,10 +76,17 @@ class labkeyURIHandler(slicer.vtkURIHandler):
         except:
             if not os.path.isdir(path):
                 raise
-        local=open(dest,'w')
+        local=open(dest,'wb')
         #make sure we are at the begining of the file
-        remote.seek(0)
+        
+	#check file size
+	remote.seek(0,2)
+	sz=remote.tell()
+	print "Remote size: {0}".format(sz)
+	
+	remote.seek(0)
         shutil.copyfileobj(remote,local)
+	print "Local size: {0}".format(local.tell())
         local.close()
 
     def StageFileWrite(self,source,dest):