Skip to content

Commit

Permalink
Standardize use of version numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
RKrahl committed Apr 30, 2020
1 parent f7b91a6 commit 5f7e957
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/examples/icatexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
default='USER')
client, conf = config.getconfig()

if client.apiversion < '4.4':
if client.apiversion < '4.4.0':
raise RuntimeError("Sorry, ICAT version %s is too old, need 4.4.0 or newer."
% client.apiversion)
client.login(conf.auth, conf.credentials)
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/icatimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
default='USER')
client, conf = config.getconfig()

if client.apiversion < '4.4':
if client.apiversion < '4.4.0':
raise RuntimeError("Sorry, ICAT version %s is too old, need 4.4.0 or newer."
% client.apiversion)
client.login(conf.auth, conf.credentials)
Expand Down
4 changes: 2 additions & 2 deletions icat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def __init__(self, url, idsurl=None,
self.apiversion = Version(apiversion)
log.debug("Connect to %s, ICAT version %s", url, self.apiversion)

if self.apiversion < '4.3':
if self.apiversion < '4.3.0':
warn(ClientVersionWarning(self.apiversion, "too old"))
self.entityInfoCache = {}
self.typemap = getTypeMap(self)
Expand Down Expand Up @@ -370,7 +370,7 @@ def getAuthenticatorInfo(self):
except suds.WebFault as e:
raise translateError(e)
except suds.MethodNotFound as e:
if self.apiversion < '4.9':
if self.apiversion < '4.9.0':
raise VersionMethodError("getAuthenticatorInfo",
self.apiversion)
else:
Expand Down
8 changes: 4 additions & 4 deletions icat/ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def getIcatUrl(self):
try:
return self.opener.open(req).read().decode('ascii')
except (HTTPError, IDSError) as e:
raise self._versionMethodError("getIcatUrl", '1.4', e)
raise self._versionMethodError("getIcatUrl", '1.4.0', e)

def isReadOnly(self):
"""See if the server is configured to be readonly.
Expand Down Expand Up @@ -344,7 +344,7 @@ def write(self, selection):
try:
self.opener.open(req)
except (HTTPError, IDSError) as e:
raise self._versionMethodError("write", '1.9', e)
raise self._versionMethodError("write", '1.9.0', e)

def reset(self, selection):
"""Reset data so that they can be queried again.
Expand All @@ -354,7 +354,7 @@ def reset(self, selection):
try:
self.opener.open(req)
except (HTTPError, IDSError) as e:
raise self._versionMethodError("reset", '1.6', e)
raise self._versionMethodError("reset", '1.6.0', e)

def prepareData(self, selection, compressFlag=False, zipFlag=False):
"""Prepare data for a subsequent :meth:`~icat.ids.IDSClient.getData`
Expand Down Expand Up @@ -388,7 +388,7 @@ def getDatafileIds(self, selection):
result = self.opener.open(req).read().decode('ascii')
return json.loads(result)['ids']
except (HTTPError, IDSError) as e:
raise self._versionMethodError("getDatafileIds", '1.5', e)
raise self._versionMethodError("getDatafileIds", '1.5.0', e)

def getData(self, selection,
compressFlag=False, zipFlag=False, outname=None, offset=0):
Expand Down
2 changes: 1 addition & 1 deletion icatdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
default='YAML')
client, conf = config.getconfig()

if client.apiversion < '4.3':
if client.apiversion < '4.3.0':
raise RuntimeError("Sorry, ICAT version %s is too old, need 4.3.0 or newer."
% client.apiversion)
client.login(conf.auth, conf.credentials)
Expand Down
2 changes: 1 addition & 1 deletion icatingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"but required for uploadDatafiles.")
conf.dataDir = os.path.abspath(conf.dataDir)

if client.apiversion < '4.3':
if client.apiversion < '4.3.0':
raise RuntimeError("Sorry, ICAT version %s is too old, need 4.3.0 or newer."
% client.apiversion)
client.login(conf.auth, conf.credentials)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_03_getversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_get_icat_version():
# python-icat supports ICAT server 4.3 or newer. But actually, we
# just want to check that client.apiversion is set and supports
# comparison with version strings.
assert client.apiversion > '1.0'
assert client.apiversion > '1.0.0'
print("\nConnect to %s\nICAT version %s\n" % (conf.url, client.apiversion))


Expand Down
2 changes: 1 addition & 1 deletion wipeicat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
config = icat.config.Config(ids="optional")
client, conf = config.getconfig()

if client.apiversion < '4.3':
if client.apiversion < '4.3.0':
raise RuntimeError("Sorry, icat.server version %s is too old, "
"need 4.3.0 or newer." % client.apiversion)
if client.ids and client.ids.apiversion < '1.6.0':
Expand Down

0 comments on commit 5f7e957

Please sign in to comment.