Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 03:49:32PM -0700, Raju Subramanian wrote: > When size limit is reached in the middle of processing a dir, > the report ends up containing oldest files. This change adds > an optional param in the plugin to prioritize newer files. > > Feature #9937 > Requested-by: Ronald Lee

[ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
When size limit is reached in the middle of processing a dir, the report ends up containing oldest files. This change adds an optional param in the plugin to prioritize newer files. Feature #9937 Requested-by: Ronald Lee Signed-off-by: Raju Subramanian --- AUTHORS |

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Reid Price
This looks good to me, thanks. Few nits that don't effect correctness: Unnecessary lines in try block, move this path_entries.append((path, s)) to outside the block >From a style nit perspective, there are a few line continuations and indentations that seem non-standard. google style doesn't

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 03:06:54PM -0700, Raju Subramanian wrote: > When size limit is reached in the middle of processing a dir, > the report ends up containing oldest files. This change adds > an optional param in the plugin to prioritize newer files. > > Feature #9937 > Requested-by: Ronald Lee

[ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
When size limit is reached in the middle of processing a dir, the report ends up containing oldest files. This change adds an optional param in the plugin to prioritize newer files. Feature #9937 Requested-by: Ronald Lee Signed-off-by: Raju Subramanian --- AUTHORS |

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
Changing to OSError. On Fri, Mar 23, 2012 at 3:00 PM, Ben Pfaff wrote: > On Fri, Mar 23, 2012 at 02:57:49PM -0700, Raju Subramanian wrote: > > When size limit is reached in the middle of processing a dir, > > the report ends up containing oldest files. This change adds > > an optional param in t

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ethan Jackson
> It looks OK to me (although "except Exception" seems a bit overbroad). It should catch an OSError: http://docs.python.org/library/exceptions.html#exceptions.OSError The problem with "except Exception" is you swallow exceptions that are indicative of bugs. If something throws an AssertionError

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 02:57:49PM -0700, Raju Subramanian wrote: > When size limit is reached in the middle of processing a dir, > the report ends up containing oldest files. This change adds > an optional param in the plugin to prioritize newer files. > > Feature #9937 > Requested-by: Ronald Lee

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 02:58:24PM -0700, Raju Subramanian wrote: > On Fri, Mar 23, 2012 at 2:39 PM, Ben Pfaff wrote: > > > That's fine with. Omitting such files would also be fine, I guess. > > But the new behavior appeared, at a glance, to be that we don't catch > > exceptions in os.stat() at

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
On Fri, Mar 23, 2012 at 2:39 PM, Ben Pfaff wrote: > That's fine with. Omitting such files would also be fine, I guess. > But the new behavior appeared, at a glance, to be that we don't catch > exceptions in os.stat() at all. No? > > No. I have added that check in the latest patch I sent. > On

[ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
When size limit is reached in the middle of processing a dir, the report ends up containing oldest files. This change adds an optional param in the plugin to prioritize newer files. Feature #9937 Requested-by: Ronald Lee Signed-off-by: Raju Subramanian --- AUTHORS |

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
That's fine with. Omitting such files would also be fine, I guess. But the new behavior appeared, at a glance, to be that we don't catch exceptions in os.stat() at all. No? On Fri, Mar 23, 2012 at 02:37:21PM -0700, Raju Subramanian wrote: > The old behaviour was if os.stat() failed, it would sti

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
The old behaviour was if os.stat() failed, it would still add the file to the report but just wouldn't update the counter tracking the sizes. Do you want to maintain this behaviour? On Fri, Mar 23, 2012 at 2:26 PM, Ben Pfaff wrote: > On Fri, Mar 23, 2012 at 02:22:23PM -0700, Raju Subramanian wro

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
> > > + > > +def file_output(cap, path_list, newest_first = False): > > +""" > > +If newest_first is True, the list of files in path_list is sorted > > +by file modification time in descending order, else its sorted > > +in ascending order. > > +""" > > if cap in entries: >

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 02:22:23PM -0700, Raju Subramanian wrote: > When size limit is reached in the middle of processing a dir, > the report ends up containing oldest files. This change adds > an optional param in the plugin to prioritize newer files. > > Feature #9937 > Requested-by: Ronald Lee

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
> > > I think that fcmp(x,y) can just "return cmp(x[1].st_mtime, y[1].st_mtime)". > Removed. Implemented what Reid suggested. > I think that the try...except around the arithmetic in file_output is > no longer necessary. removed. > However, I don't think that this is safe: > > +path_

[ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
When size limit is reached in the middle of processing a dir, the report ends up containing oldest files. This change adds an optional param in the plugin to prioritize newer files. Feature #9937 Requested-by: Ronald Lee Signed-off-by: Raju Subramanian --- AUTHORS |

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Reid Price
On Fri, Mar 23, 2012 at 1:43 PM, Ben Pfaff wrote: > On Fri, Mar 23, 2012 at 01:37:53PM -0700, Raju Subramanian wrote: > > On Fri, Mar 23, 2012 at 1:28 PM, Ben Pfaff wrote: > > > > > On Fri, Mar 23, 2012 at 01:22:54PM -0700, Raju Subramanian wrote: > > > > > The tree_output function is documented

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 01:37:53PM -0700, Raju Subramanian wrote: > On Fri, Mar 23, 2012 at 1:28 PM, Ben Pfaff wrote: > > > On Fri, Mar 23, 2012 at 01:22:54PM -0700, Raju Subramanian wrote: > > > > The tree_output function is documented as processing files less nested > > > > in the directory tre

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
On Fri, Mar 23, 2012 at 1:28 PM, Ben Pfaff wrote: > On Fri, Mar 23, 2012 at 01:22:54PM -0700, Raju Subramanian wrote: > > > The tree_output function is documented as processing files less nested > > > in the directory tree before those deeper in the directory tree. It > > > doesn't do that anymo

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 01:22:54PM -0700, Raju Subramanian wrote: > > The tree_output function is documented as processing files less nested > > in the directory tree before those deeper in the directory tree. It > > doesn't do that anymore, so you should update the documentation. > > > > > I don'

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
I am addressing the rest of the comments from you and Reid. I need more clarification about this particular comment. > The tree_output function is documented as processing files less nested > in the directory tree before those deeper in the directory tree. It > doesn't do that anymore, so you sh

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Reid Price
Contextless notes inline On Mar 23, 2555 BE, at 7:10, Raju Subramanian wrote: > When size limit is reached in the middle of processing a dir, > the report ends up containing oldest files. This change adds > an optional param in the plugin to prioritize newer files. > > Feature #9937 > Requested

Re: [ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Ben Pfaff
On Fri, Mar 23, 2012 at 07:10:20AM -0700, Raju Subramanian wrote: > When size limit is reached in the middle of processing a dir, > the report ends up containing oldest files. This change adds > an optional param in the plugin to prioritize newer files. > > Feature #9937 > Requested-by: Ronald Lee

[ovs-dev] [PATCH] ovs-bugtool: Add ability to prioritize files by date.

2012-03-23 Thread Raju Subramanian
When size limit is reached in the middle of processing a dir, the report ends up containing oldest files. This change adds an optional param in the plugin to prioritize newer files. Feature #9937 Requested-by: Ronald Lee Signed-off-by: Raju Subramanian --- AUTHORS |