57 Private method to check, if the line should be ignored. |
57 Private method to check, if the line should be ignored. |
58 |
58 |
59 @param line to check (string) |
59 @param line to check (string) |
60 @return flag indicating to ignore the line (boolean) |
60 @return flag indicating to ignore the line (boolean) |
61 """ |
61 """ |
62 return line.strip() == "" or \ |
62 return ( |
|
63 line.strip() == "" or |
63 line.strip().lower().startswith("total ") |
64 line.strip().lower().startswith("total ") |
|
65 ) |
64 |
66 |
65 def __parseUnixMode(self, modeString, urlInfo): |
67 def __parseUnixMode(self, modeString, urlInfo): |
66 """ |
68 """ |
67 Private method to parse a Unix mode string modifying the |
69 Private method to parse a Unix mode string modifying the |
68 given URL info object. |
70 given URL info object. |
195 Private method to parse a Unix style directory listing line. |
197 Private method to parse a Unix style directory listing line. |
196 |
198 |
197 @param line directory line to be parsed (string) |
199 @param line directory line to be parsed (string) |
198 @return URL info object containing the valid data (E5UrlInfo) |
200 @return URL info object containing the valid data (E5UrlInfo) |
199 """ |
201 """ |
200 modeString, nlink, user, group, size, month, day, \ |
202 modeString, nlink, user, group, size, month, day, yearOrTime, name = ( |
201 yearOrTime, name = self.__splitUnixLine(line) |
203 self.__splitUnixLine(line) |
|
204 ) |
202 |
205 |
203 if name in [".", ".."]: |
206 if name in [".", ".."]: |
204 return None |
207 return None |
205 |
208 |
206 urlInfo = E5UrlInfo() |
209 urlInfo = E5UrlInfo() |
295 |
298 |
296 permissions = (E5UrlInfo.ReadOwner | E5UrlInfo.WriteOwner | |
299 permissions = (E5UrlInfo.ReadOwner | E5UrlInfo.WriteOwner | |
297 E5UrlInfo.ReadGroup | E5UrlInfo.WriteGroup | |
300 E5UrlInfo.ReadGroup | E5UrlInfo.WriteGroup | |
298 E5UrlInfo.ReadOther | E5UrlInfo.WriteOther) |
301 E5UrlInfo.ReadOther | E5UrlInfo.WriteOther) |
299 if ext in [".exe", ".com", ".bat", ".cmd"]: |
302 if ext in [".exe", ".com", ".bat", ".cmd"]: |
300 permissions |= E5UrlInfo.ExeOwner | E5UrlInfo.ExeGroup | \ |
303 permissions |= ( |
301 E5UrlInfo.ExeOther |
304 E5UrlInfo.ExeOwner | E5UrlInfo.ExeGroup | E5UrlInfo.ExeOther |
|
305 ) |
302 urlInfo.setPermissions(permissions) |
306 urlInfo.setPermissions(permissions) |
303 |
307 |
304 return urlInfo |
308 return urlInfo |
305 |
309 |
306 def parseLine(self, line): |
310 def parseLine(self, line): |