pyoncat 2.3__tar.gz → 2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyoncat
3
- Version: 2.3
3
+ Version: 2.4
4
4
  Summary: A Python Client for ONCat (the ORNL Neutron Catalog).
5
5
  Keywords: ornl,neutron,metadata,catalog
6
6
  Author: ONCat Support
@@ -28,7 +28,7 @@ from urllib3.exceptions import InsecureRequestWarning
28
28
 
29
29
  from pyoncat.reduction import ReductionFileBuilder
30
30
 
31
- __version__ = "2.3"
31
+ __version__ = "2.4"
32
32
 
33
33
  # Constant for autoreduction user
34
34
  AUTOREDUCTION_USER = "auto"
@@ -1007,9 +1007,9 @@ class _InMemoryTokenStore:
1007
1007
  class FileSystemTokenStore:
1008
1008
  """A token store that persists OAuth tokens to a file on disk.
1009
1009
 
1010
- The file is created if it doesn't already exist, however the parent
1011
- directory must exist and you must have write permissions else an
1012
- exception will be raised.
1010
+ The file is created if it doesn't already exist, including any
1011
+ necessary parent directories. You must have write permissions to
1012
+ the parent directory else an exception will be raised.
1013
1013
 
1014
1014
  This kind of store may be useful for long-lived applications where
1015
1015
  you need to persist the token across uses of the client, and it is
@@ -1051,6 +1051,11 @@ class FileSystemTokenStore:
1051
1051
  token.
1052
1052
 
1053
1053
  """
1054
+ # Create parent directory if it doesn't exist
1055
+ parent_dir = os.path.dirname(self.path)
1056
+ if parent_dir:
1057
+ os.makedirs(parent_dir, exist_ok=True)
1058
+
1054
1059
  with open(self.path, "w") as storage:
1055
1060
  json.dump(token, storage)
1056
1061
 
@@ -7,7 +7,7 @@ build-backend = "poetry.masonry.api"
7
7
  # https://github.com/python-poetry/roadmap/issues/3
8
8
  [tool.poetry]
9
9
  name = "pyoncat"
10
- version = "2.3"
10
+ version = "2.4"
11
11
  description = "A Python Client for ONCat (the ORNL Neutron Catalog)."
12
12
  authors = ["ONCat Support <oncat-support@ornl.gov>"]
13
13
  readme = ["pyoncat/README.md", "pyoncat/LICENSE"]
File without changes
File without changes
File without changes