pyloid 0.18.0__tar.gz → 0.18.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyloid
3
- Version: 0.18.0
3
+ Version: 0.18.2
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyloid"
3
- version = "0.18.0"
3
+ version = "0.18.2"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -24,14 +24,21 @@ def get_production_path(path: Optional[str] = None) -> Optional[str]:
24
24
  >>> else:
25
25
  >>> print("Not in a production environment.")
26
26
  """
27
- if getattr(sys, 'frozen', False):
27
+ if is_production():
28
28
  # Nuitka
29
- base_path = os.path.dirname(sys.executable)
29
+ if hasattr(sys, '_MEIPASS'):
30
+ # PyInstaller
31
+ base_path = sys._MEIPASS
32
+ else:
33
+ # Nuitka의 경우 실행 파일이 있는 디렉토리를 기준으로 함
34
+ base_path = os.path.dirname(os.path.abspath(sys.argv[0]))
35
+
30
36
  return os.path.join(base_path, path) if path else base_path
31
37
  else:
32
- # If running as a regular Python script
38
+ # 일반 Python 스크립트로 실행 중일
33
39
  return None
34
40
 
41
+
35
42
  def is_production() -> bool:
36
43
  """
37
44
  Checks if the current environment is a production environment.
@@ -49,6 +56,10 @@ def is_production() -> bool:
49
56
  >>> else:
50
57
  >>> print("Not in production environment.")
51
58
  """
59
+ # Nuitka 환경 확인을 추가
60
+ if '__compiled__' in globals():
61
+ return True
62
+ # PyInstaller 환경 확인
52
63
  return getattr(sys, 'frozen', False)
53
64
 
54
65
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes