Returns the largest file. Yes, this is ugly.
(self)
| 176 | return fname |
| 177 | |
| 178 | def getLargest(self): |
| 179 | """ |
| 180 | Returns the largest file. Yes, this is ugly. |
| 181 | """ |
| 182 | flist_copy = [] |
| 183 | try: |
| 184 | flist_copy = zip(map(os.path.getsize, self), self) |
| 185 | except TypeError: |
| 186 | # there may be lists of lists |
| 187 | temp = self._unwind() |
| 188 | flist_copy = zip(map(os.path.getsize, temp), temp) |
| 189 | flist_copy.sort() |
| 190 | try: |
| 191 | size, fname = flist_copy[(len(flist_copy)-1)] |
| 192 | except IndexError: |
| 193 | # probably an empty list |
| 194 | return None |
| 195 | return fname |
| 196 | |
| 197 | def getOldest(self): |
| 198 | """ |