151 lastModified = QDateTime(QDate(year, month, day), QTime(hour, minute)) |
152 lastModified = QDateTime(QDate(year, month, day), QTime(hour, minute)) |
152 urlInfo.setLastModified(lastModified) |
153 urlInfo.setLastModified(lastModified) |
153 |
154 |
154 def __splitUnixLine(self, line): |
155 def __splitUnixLine(self, line): |
155 """ |
156 """ |
156 Split a line of a Unix like directory listing into meta data, |
157 Private method to split a line of a Unix like directory listing. |
157 number of links, user, group, size, month, day, year or time |
158 |
158 and name. |
159 It splits the line into meta data, number of links, user, group, size, |
159 |
160 month, day, year or time and name. |
|
161 |
|
162 @param line directory line to split (string) |
160 @return tuple of nine strings giving the meta data, |
163 @return tuple of nine strings giving the meta data, |
161 number of links, user, group, size, month, day, year or time |
164 number of links, user, group, size, month, day, year or time |
162 and name |
165 and name |
163 @exception FtpDirLineParserError Raised if the line is not of a |
166 @exception FtpDirLineParserError Raised if the line is not of a |
164 recognized Unix format. |
167 recognized Unix format. |
190 """ |
193 """ |
191 Private method to parse a Unix style directory listing line. |
194 Private method to parse a Unix style directory listing line. |
192 |
195 |
193 @param line directory line to be parsed (string) |
196 @param line directory line to be parsed (string) |
194 @return URL info object containing the valid data (E5UrlInfo) |
197 @return URL info object containing the valid data (E5UrlInfo) |
195 @exception FtpDirLineParserError Raised if the line is not of a |
|
196 recognized Unix format. |
|
197 """ |
198 """ |
198 modeString, nlink, user, group, size, month, day, \ |
199 modeString, nlink, user, group, size, month, day, \ |
199 yearOrTime, name = self.__splitUnixLine(line) |
200 yearOrTime, name = self.__splitUnixLine(line) |
200 |
201 |
201 if name in [".", ".."]: |
202 if name in [".", ".."]: |
304 listings. It tries Unix style first and if that fails switches |
305 listings. It tries Unix style first and if that fails switches |
305 to Windows style. If that fails as well, an exception is raised. |
306 to Windows style. If that fails as well, an exception is raised. |
306 |
307 |
307 @param line directory line to be parsed (string) |
308 @param line directory line to be parsed (string) |
308 @return URL info object containing the valid data (E5UrlInfo) |
309 @return URL info object containing the valid data (E5UrlInfo) |
309 @exception FtpDirLineParserError Raised if the line is not of a |
|
310 recognized format. |
|
311 """ |
310 """ |
312 if self.__ignoreLine(line): |
311 if self.__ignoreLine(line): |
313 return None |
312 return None |
314 |
313 |
315 try: |
314 try: |