changeset 2002:1bb0a9716876

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Nov 2022 15:07:06 +0100
parents e943a84da9ac
children 963f28eb40cb 6a96a1920fd8
files OrthancStone/Resources/SyncOrthancFolder.py OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Resources/SyncOrthancFolder.py	Wed Nov 02 14:56:35 2022 +0100
+++ b/OrthancStone/Resources/SyncOrthancFolder.py	Wed Nov 02 15:07:06 2022 +0100
@@ -29,7 +29,13 @@
 import multiprocessing
 import os
 import stat
-import urllib2
+import sys
+
+if sys.version_info[0] < 3:
+    from urllib import urlopen
+else:
+    from urllib.request import urlopen
+
 
 TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc')
 REPOSITORY = 'https://hg.orthanc-server.com/orthanc/raw-file'
@@ -54,7 +60,7 @@
     branch = x[0]
     source = x[1]
     target = os.path.join(TARGET, x[2])
-    print target
+    print(target)
 
     try:
         os.makedirs(os.path.dirname(target))
@@ -63,8 +69,8 @@
 
     url = '%s/%s/%s' % (REPOSITORY, branch, source)
 
-    with open(target, 'w') as f:
-        f.write(urllib2.urlopen(url).read())
+    with open(target, 'wb') as f:
+        f.write(urlopen(url).read())
 
 
 commands = []
--- a/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp	Wed Nov 02 14:56:35 2022 +0100
+++ b/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp	Wed Nov 02 15:07:06 2022 +0100
@@ -1382,7 +1382,7 @@
     }
 
   public:
-    ProbingAnnotation(AnnotationsSceneLayer& that) :
+    explicit ProbingAnnotation(AnnotationsSceneLayer& that) :
       Annotation(that),
       probedLayer_(that.GetProbedLayer()),
       probeChanged_(true),