Skip to content

Commit 95a032e

Browse files
committed
Rebuild file:property<state> of class<File> is renamed from property<status>.
1 parent d671176 commit 95a032e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

easierfile/file.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __del__(self):
5656
pass
5757

5858
def __lock(self, is_lock):
59-
if self.status["exist"]:
59+
if self.state["exist"]:
6060
if is_lock:
6161
self.__m_file = open(self.__m_static_info["path"])
6262
_lock_file(self.__m_file)
@@ -72,7 +72,7 @@ def __lock(self, is_lock):
7272
raise FileNotFoundError("File was about to be unoccupied, but not found: " + self.__m_static_info["path"])
7373

7474
def create(self):
75-
if not self.status["exist"]:
75+
if not self.state["exist"]:
7676
if not os.path.exists(self.__m_static_info["dir_path"]): # Create the file directory if it doesn't exist, so that code<open()> doesn't throw the exception.
7777
os.mkdir(self.__m_static_info["dir_path"])
7878
try:
@@ -89,11 +89,11 @@ def create(self):
8989
def delete(self):
9090
if self.__m_is_lock:
9191
self.__lock(False)
92-
if self.status["exist"]:
92+
if self.state["exist"]:
9393
os.remove(self.__m_static_info["path"])
9494

9595
def rewrite(self,content):
96-
if self.status["exist"]:
96+
if self.state["exist"]:
9797
"""
9898
Automatically obtain the most suitable encoding format for the input content.
9999
@@ -106,7 +106,7 @@ def rewrite(self,content):
106106
raise FileNotFoundError("File not found: " + self.__m_static_info["path"])
107107

108108
def append(self,content):
109-
if self.status["exist"]:
109+
if self.state["exist"]:
110110
file_temp = open(self.__m_static_info["path"], "a", encoding=chardet.detect(content.encode())["encoding"])
111111
file_temp.write(content)
112112
file_temp.close()
@@ -115,7 +115,7 @@ def append(self,content):
115115

116116
@property
117117
def content(self):
118-
if self.status["exist"]:
118+
if self.state["exist"]:
119119
"""
120120
Automatically obtain the most suitable encoding format for the output content.
121121
@@ -154,7 +154,7 @@ def get_info_encoding():
154154
return info
155155

156156
@property
157-
def status(self):
157+
def state(self):
158158
def get_status_file_lock():
159159
return self.__m_is_lock
160160

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "easierfile"
3-
version = "2.3.0"
3+
version = "3.0.0"
44
description = "An easier-to-use Python package that object-oriented encapsulates Python traditional built-in file operations."
55
license = "MIT"
66
authors = ["leoweyr <[email protected]>"]

0 commit comments

Comments
 (0)