src/eric7/EricNetwork/EricUrlInfo.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
14 14
15 class EricUrlPermission(enum.IntEnum): 15 class EricUrlPermission(enum.IntEnum):
16 """ 16 """
17 Class defining the URL permissions. 17 Class defining the URL permissions.
18 """ 18 """
19
19 READ_OWNER = 0o0400 20 READ_OWNER = 0o0400
20 WRITE_OWNER = 0o0200 21 WRITE_OWNER = 0o0200
21 EXE_OWNER = 0o0100 22 EXE_OWNER = 0o0100
22 READ_GROUP = 0o0040 23 READ_GROUP = 0o0040
23 WRITE_GROUP = 0o0020 24 WRITE_GROUP = 0o0020
29 30
30 class EricUrlInfo: 31 class EricUrlInfo:
31 """ 32 """
32 Class implementing a replacement for QUrlInfo. 33 Class implementing a replacement for QUrlInfo.
33 """ 34 """
35
34 def __init__(self): 36 def __init__(self):
35 """ 37 """
36 Constructor 38 Constructor
37 """ 39 """
38 self.__valid = False 40 self.__valid = False
39 41
40 self.__permissions = 0 42 self.__permissions = 0
41 self.__size = 0 43 self.__size = 0
42 self.__isDir = False 44 self.__isDir = False
43 self.__isFile = True 45 self.__isFile = True
44 self.__isSymlink = False 46 self.__isSymlink = False
48 self.__name = "" 50 self.__name = ""
49 self.__owner = "" 51 self.__owner = ""
50 self.__group = "" 52 self.__group = ""
51 self.__lastModified = QDateTime() 53 self.__lastModified = QDateTime()
52 self.__lastRead = QDateTime() 54 self.__lastRead = QDateTime()
53 55
54 def isValid(self): 56 def isValid(self):
55 """ 57 """
56 Public method to check the validity of the object. 58 Public method to check the validity of the object.
57 59
58 @return flag indicating validity (boolean) 60 @return flag indicating validity (boolean)
59 """ 61 """
60 return self.__valid 62 return self.__valid
61 63
62 def setName(self, name): 64 def setName(self, name):
63 """ 65 """
64 Public method to set the name. 66 Public method to set the name.
65 67
66 @param name name to be set (string) 68 @param name name to be set (string)
67 """ 69 """
68 self.__name = name 70 self.__name = name
69 self.__valid = True 71 self.__valid = True
70 72
71 def setPermissions(self, permissions): 73 def setPermissions(self, permissions):
72 """ 74 """
73 Public method to set the permissions. 75 Public method to set the permissions.
74 76
75 @param permissions permissions to be set (integer) 77 @param permissions permissions to be set (integer)
76 """ 78 """
77 self.__permissions = permissions 79 self.__permissions = permissions
78 self.__valid = True 80 self.__valid = True
79 81
80 def setDir(self, isDir): 82 def setDir(self, isDir):
81 """ 83 """
82 Public method to indicate a directory. 84 Public method to indicate a directory.
83 85
84 @param isDir flag indicating a directory (boolean) 86 @param isDir flag indicating a directory (boolean)
85 """ 87 """
86 self.__isDir = isDir 88 self.__isDir = isDir
87 self.__valid = True 89 self.__valid = True
88 90
89 def setFile(self, isFile): 91 def setFile(self, isFile):
90 """ 92 """
91 Public method to indicate a file. 93 Public method to indicate a file.
92 94
93 @param isFile flag indicating a file (boolean) 95 @param isFile flag indicating a file (boolean)
94 """ 96 """
95 self.__isFile = isFile 97 self.__isFile = isFile
96 self.__valid = True 98 self.__valid = True
97 99
98 def setSymLink(self, isSymLink): 100 def setSymLink(self, isSymLink):
99 """ 101 """
100 Public method to indicate a symbolic link. 102 Public method to indicate a symbolic link.
101 103
102 @param isSymLink flag indicating a symbolic link (boolean) 104 @param isSymLink flag indicating a symbolic link (boolean)
103 """ 105 """
104 self.__isSymLink = isSymLink 106 self.__isSymLink = isSymLink
105 self.__valid = True 107 self.__valid = True
106 108
107 def setOwner(self, owner): 109 def setOwner(self, owner):
108 """ 110 """
109 Public method to set the owner. 111 Public method to set the owner.
110 112
111 @param owner owner to be set (string) 113 @param owner owner to be set (string)
112 """ 114 """
113 self.__owner = owner 115 self.__owner = owner
114 self.__valid = True 116 self.__valid = True
115 117
116 def setGroup(self, group): 118 def setGroup(self, group):
117 """ 119 """
118 Public method to set the group. 120 Public method to set the group.
119 121
120 @param group group to be set (string) 122 @param group group to be set (string)
121 """ 123 """
122 self.__group = group 124 self.__group = group
123 self.__valid = True 125 self.__valid = True
124 126
125 def setSize(self, size): 127 def setSize(self, size):
126 """ 128 """
127 Public method to set the size. 129 Public method to set the size.
128 130
129 @param size size to be set (integer) 131 @param size size to be set (integer)
130 """ 132 """
131 self.__size = size 133 self.__size = size
132 self.__valid = True 134 self.__valid = True
133 135
134 def setWritable(self, isWritable): 136 def setWritable(self, isWritable):
135 """ 137 """
136 Public method to a writable entry. 138 Public method to a writable entry.
137 139
138 @param isWritable flag indicating a writable entry (boolean) 140 @param isWritable flag indicating a writable entry (boolean)
139 """ 141 """
140 self.__isWritable = isWritable 142 self.__isWritable = isWritable
141 self.__valid = True 143 self.__valid = True
142 144
143 def setReadable(self, isReadable): 145 def setReadable(self, isReadable):
144 """ 146 """
145 Public method to a readable entry. 147 Public method to a readable entry.
146 148
147 @param isReadable flag indicating a readable entry (boolean) 149 @param isReadable flag indicating a readable entry (boolean)
148 """ 150 """
149 self.__isReadable = isReadable 151 self.__isReadable = isReadable
150 self.__valid = True 152 self.__valid = True
151 153
152 def setLastModified(self, dt): 154 def setLastModified(self, dt):
153 """ 155 """
154 Public method to set the last modified date and time. 156 Public method to set the last modified date and time.
155 157
156 @param dt date and time to set (QDateTime) 158 @param dt date and time to set (QDateTime)
157 """ 159 """
158 self.__lastModified = QDateTime(dt) 160 self.__lastModified = QDateTime(dt)
159 self.__valid = True 161 self.__valid = True
160 162
161 def setLastRead(self, dt): 163 def setLastRead(self, dt):
162 """ 164 """
163 Public method to set the last read date and time. 165 Public method to set the last read date and time.
164 166
165 @param dt date and time to set (QDateTime) 167 @param dt date and time to set (QDateTime)
166 """ 168 """
167 self.__lastRead = QDateTime(dt) 169 self.__lastRead = QDateTime(dt)
168 self.__valid = True 170 self.__valid = True
169 171
170 def name(self): 172 def name(self):
171 """ 173 """
172 Public method to get the name. 174 Public method to get the name.
173 175
174 @return name (string) 176 @return name (string)
175 """ 177 """
176 return self.__name 178 return self.__name
177 179
178 def permissions(self): 180 def permissions(self):
179 """ 181 """
180 Public method to get the permissions. 182 Public method to get the permissions.
181 183
182 @return permissions (integer) 184 @return permissions (integer)
183 """ 185 """
184 return self.__permissions 186 return self.__permissions
185 187
186 def owner(self): 188 def owner(self):
187 """ 189 """
188 Public method to get the owner. 190 Public method to get the owner.
189 191
190 @return owner (string) 192 @return owner (string)
191 """ 193 """
192 return self.__owner 194 return self.__owner
193 195
194 def group(self): 196 def group(self):
195 """ 197 """
196 Public method to get the group. 198 Public method to get the group.
197 199
198 @return group (string) 200 @return group (string)
199 """ 201 """
200 return self.__group 202 return self.__group
201 203
202 def size(self): 204 def size(self):
203 """ 205 """
204 Public method to get the size. 206 Public method to get the size.
205 207
206 @return size (integer) 208 @return size (integer)
207 """ 209 """
208 return self.__size 210 return self.__size
209 211
210 def lastModified(self): 212 def lastModified(self):
211 """ 213 """
212 Public method to get the last modified date and time. 214 Public method to get the last modified date and time.
213 215
214 @return last modified date and time (QDateTime) 216 @return last modified date and time (QDateTime)
215 """ 217 """
216 return QDateTime(self.__lastModified) 218 return QDateTime(self.__lastModified)
217 219
218 def lastRead(self): 220 def lastRead(self):
219 """ 221 """
220 Public method to get the last read date and time. 222 Public method to get the last read date and time.
221 223
222 @return last read date and time (QDateTime) 224 @return last read date and time (QDateTime)
223 """ 225 """
224 return QDateTime(self.__lastRead) 226 return QDateTime(self.__lastRead)
225 227
226 def isDir(self): 228 def isDir(self):
227 """ 229 """
228 Public method to test, if the entry is a directory. 230 Public method to test, if the entry is a directory.
229 231
230 @return flag indicating a directory (boolean) 232 @return flag indicating a directory (boolean)
231 """ 233 """
232 return self.__isDir 234 return self.__isDir
233 235
234 def isFile(self): 236 def isFile(self):
235 """ 237 """
236 Public method to test, if the entry is a file. 238 Public method to test, if the entry is a file.
237 239
238 @return flag indicating a file (boolean) 240 @return flag indicating a file (boolean)
239 """ 241 """
240 return self.__isFile 242 return self.__isFile
241 243
242 def isSymLink(self): 244 def isSymLink(self):
243 """ 245 """
244 Public method to test, if the entry is a symbolic link. 246 Public method to test, if the entry is a symbolic link.
245 247
246 @return flag indicating a symbolic link (boolean) 248 @return flag indicating a symbolic link (boolean)
247 """ 249 """
248 return self.__isSymlink 250 return self.__isSymlink
249 251
250 def isWritable(self): 252 def isWritable(self):
251 """ 253 """
252 Public method to test, if the entry is writable. 254 Public method to test, if the entry is writable.
253 255
254 @return flag indicating writable (boolean) 256 @return flag indicating writable (boolean)
255 """ 257 """
256 return self.__isWritable 258 return self.__isWritable
257 259
258 def isReadable(self): 260 def isReadable(self):
259 """ 261 """
260 Public method to test, if the entry is readable. 262 Public method to test, if the entry is readable.
261 263
262 @return flag indicating readable (boolean) 264 @return flag indicating readable (boolean)
263 """ 265 """
264 return self.__isReadable 266 return self.__isReadable
265 267
266 def isExecutable(self): 268 def isExecutable(self):
267 """ 269 """
268 Public method to test, if the entry is executable. 270 Public method to test, if the entry is executable.
269 271
270 @return flag indicating executable (boolean) 272 @return flag indicating executable (boolean)
271 """ 273 """
272 return self.__isExecutable 274 return self.__isExecutable

eric ide

mercurial