robotcode-core 2.3.1__py3-none-any.whl → 2.4.0__py3-none-any.whl

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 +1 @@
1
- __version__ = "2.3.1"
1
+ __version__ = "2.4.0"
@@ -2,7 +2,7 @@ import os
2
2
  import re
3
3
  import sys
4
4
  from pathlib import Path
5
- from typing import Any, Union
5
+ from typing import Any, Optional, Tuple, Union
6
6
 
7
7
 
8
8
  def path_is_relative_to(
@@ -61,8 +61,30 @@ def normalized_path_full(path: Union[str, "os.PathLike[str]"]) -> Path:
61
61
  return Path(*parents)
62
62
 
63
63
 
64
+ FileId = Tuple[int, int]
65
+
66
+
67
+ def file_id(path: Union[str, "os.PathLike[str]", Path]) -> Optional[FileId]:
68
+ """Return the (st_dev, st_ino) tuple for *path*, or ``None`` on error."""
69
+ try:
70
+ st = os.stat(path)
71
+ return (st.st_dev, st.st_ino)
72
+ except OSError:
73
+ return None
74
+
75
+
64
76
  def same_file(path1: Union[str, "os.PathLike[str]", Path], path2: Union[str, "os.PathLike[str]", Path]) -> bool:
65
77
  try:
66
78
  return os.path.samefile(path1, path2)
67
79
  except OSError:
68
80
  return False
81
+
82
+
83
+ def same_file_id(
84
+ id1: Optional[FileId],
85
+ id2: Optional[FileId],
86
+ ) -> bool:
87
+ """Compare two :func:`file_id` values. ``None`` never matches anything."""
88
+ if id1 is None or id2 is None:
89
+ return False
90
+ return id1 == id2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotcode-core
3
- Version: 2.3.1
3
+ Version: 2.4.0
4
4
  Summary: Some core classes for RobotCode
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -1,5 +1,5 @@
1
1
  robotcode/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- robotcode/core/__version__.py,sha256=neZxeMmEfjhVZM6xetRikrBdHWt5T5ehL72ZYdPtJ-E,22
2
+ robotcode/core/__version__.py,sha256=yLaFvd-K80rs_ClRVYULStijkok4RfYSaanIt_E-aKM,22
3
3
  robotcode/core/async_tools.py,sha256=pU12trR8-w4oUoLXiV5uGQ9weGZS25b_DXCNwbbhcfI,12843
4
4
  robotcode/core/concurrent.py,sha256=JyxhRf_lR2EF1sUsEOU4mMrk-FkhGPM41HRvWHxQ_9g,7597
5
5
  robotcode/core/documents_manager.py,sha256=z-x8gwj8YslGOeTUHaHbZpN5fdPi9yUeY0vIo1ZP6fA,5922
@@ -23,10 +23,10 @@ robotcode/core/utils/glob_path.py,sha256=E52LTG0l6vppBAlD3SvFO5FkAiZY3ePPZ1T4OfU
23
23
  robotcode/core/utils/inspect.py,sha256=IGSVUHZeMiErnUeLSb-tD1SlyKjHzvei9U--P7dXhFs,1134
24
24
  robotcode/core/utils/logging.py,sha256=Hy4tBLmEKiXWxPimcdytwUECpy2z8hBz4osCHwizYtg,19670
25
25
  robotcode/core/utils/net.py,sha256=y2snkr70G0RFDK8-46VQiDtmkscWxzRRuJTUh1BPwjs,828
26
- robotcode/core/utils/path.py,sha256=-2LjHfgDCHDrCTgGiQkB-gvVxisKmeoos2xtN92dJ8c,1853
26
+ robotcode/core/utils/path.py,sha256=gm5wiQp72jutP6xN51gF02CzvAwARczsIIUto9C_Qgc,2410
27
27
  robotcode/core/utils/process.py,sha256=nwTTmAyjcDybcO_fq0ZbZK_76ndBFO324z9cxni8TuU,679
28
28
  robotcode/core/utils/safe_eval.py,sha256=ES12mwdqNH4iHsP23sEBW6_bgGjS5DKFfgSfxP97-ok,1448
29
29
  robotcode/core/utils/version.py,sha256=uXcvqOFLbaSH5EWL6OwRDZjGteFzwaqt0Ll2Rf5h008,1373
30
- robotcode_core-2.3.1.dist-info/METADATA,sha256=asDaZ-8IW4AJ7TUCasVea9BxKPdHSRyZjUAnCd3FzKs,2705
31
- robotcode_core-2.3.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
32
- robotcode_core-2.3.1.dist-info/RECORD,,
30
+ robotcode_core-2.4.0.dist-info/METADATA,sha256=-DMaBY0C4puWBc3EMEMT2ni2RmIxJn-Cd1MhjetMQgY,2705
31
+ robotcode_core-2.4.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
32
+ robotcode_core-2.4.0.dist-info/RECORD,,