comparison Tests/Toolbox.py @ 532:f96c023ce523

dicom-web X-Forwarded headers
author Alain Mazy <am@osimis.io>
date Mon, 24 Apr 2023 10:43:27 +0200
parents 933fe1bbce4f
children 3f8eebe85c37
comparison
equal deleted inserted replaced
531:8a920ab91cf4 532:f96c023ce523
352 c = int(tmp[2]) 352 c = int(tmp[2])
353 return (a > major or 353 return (a > major or
354 (a == major and b > minor) or 354 (a == major and b > minor) or
355 (a == major and b == minor and c >= revision)) 355 (a == major and b == minor and c >= revision))
356 356
357 def IsPluginVersionAbove(orthanc, plugin, major, minor, revision):
358 v = DoGet(orthanc, '/plugins/%s' % plugin)['Version']
359
360 if v == 'mainline':
361 return True
362 else:
363 tmp = v.split('.')
364 if len(tmp) >= 3:
365 a = int(tmp[0])
366 b = int(tmp[1])
367 c = int(tmp[2])
368 return (a > major or
369 (a == major and b > minor) or
370 (a == major and b == minor and c >= revision))
371 elif len(tmp) >= 2:
372 a = int(tmp[0])
373 b = int(tmp[1])
374 return (a > major or
375 (a == major and b > minor))
376 else:
377 return False
357 378
358 class ExternalCommandThread: 379 class ExternalCommandThread:
359 @staticmethod 380 @staticmethod
360 def ExternalCommandFunction(arg, stop_event, command, env): 381 def ExternalCommandFunction(arg, stop_event, command, env):
361 with open(os.devnull, 'w') as devnull: 382 with open(os.devnull, 'w') as devnull: