You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: easierfile/file.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ def __del__(self):
56
56
pass
57
57
58
58
def__lock(self, is_lock):
59
-
ifself.status["exist"]:
59
+
ifself.state["exist"]:
60
60
ifis_lock:
61
61
self.__m_file=open(self.__m_static_info["path"])
62
62
_lock_file(self.__m_file)
@@ -72,7 +72,7 @@ def __lock(self, is_lock):
72
72
raiseFileNotFoundError("File was about to be unoccupied, but not found: "+self.__m_static_info["path"])
73
73
74
74
defcreate(self):
75
-
ifnotself.status["exist"]:
75
+
ifnotself.state["exist"]:
76
76
ifnotos.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.
77
77
os.mkdir(self.__m_static_info["dir_path"])
78
78
try:
@@ -89,11 +89,11 @@ def create(self):
89
89
defdelete(self):
90
90
ifself.__m_is_lock:
91
91
self.__lock(False)
92
-
ifself.status["exist"]:
92
+
ifself.state["exist"]:
93
93
os.remove(self.__m_static_info["path"])
94
94
95
95
defrewrite(self,content):
96
-
ifself.status["exist"]:
96
+
ifself.state["exist"]:
97
97
"""
98
98
Automatically obtain the most suitable encoding format for the input content.
99
99
@@ -106,7 +106,7 @@ def rewrite(self,content):
106
106
raiseFileNotFoundError("File not found: "+self.__m_static_info["path"])
0 commit comments