Bug 82158

Summary: add a Tree abstraction to test-webkitpy to better encapsulate things
Product: WebKit Reporter: Dirk Pranke <dpranke>
Component: New BugsAssignee: Dirk Pranke <dpranke>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ojan, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
fix typos
none
rename _Tree to TestDirectoryTree none

Description Dirk Pranke 2012-03-25 19:01:03 PDT
add a Tree abstraction to test-webkitpy to better encapsulate things
Comment 1 Dirk Pranke 2012-03-25 19:08:28 PDT
Created attachment 133712 [details]
Patch
Comment 2 Dirk Pranke 2012-03-25 19:10:38 PDT
Created attachment 133713 [details]
fix typos
Comment 3 Adam Barth 2012-03-26 10:26:23 PDT
Comment on attachment 133713 [details]
fix typos

View in context: https://bugs.webkit.org/attachment.cgi?id=133713&action=review

> Tools/Scripts/webkitpy/test/main.py:238
> +class _Tree(object):

Do you mean a DirectoryTree?  "Tree" is a very broad name.  This code seems very specific to Python packages.
Comment 4 Dirk Pranke 2012-03-26 11:11:44 PDT
Comment on attachment 133713 [details]
fix typos

View in context: https://bugs.webkit.org/attachment.cgi?id=133713&action=review

>> Tools/Scripts/webkitpy/test/main.py:238
>> +class _Tree(object):
> 
> Do you mean a DirectoryTree?  "Tree" is a very broad name.  This code seems very specific to Python packages.

Yes, it refers to directory trees and is intended to by very python-specific. DirectoryTree is a fine name; other suggestions welcome.
Comment 5 Adam Barth 2012-03-26 14:15:31 PDT
Comment on attachment 133713 [details]
fix typos

I'd rename _Tree to something more specific (and maybe put it at the top of the file?).  There's an argument that says we should put the new class in its own module, which would have the benefit of making test-webkitpy smaller.  If we did that we, we'd probably want to use filesystem rather than os.path.  I think it's a question of how far you'd like to shave this yak.
Comment 6 Dirk Pranke 2012-03-26 14:22:28 PDT
(In reply to comment #5)
> (From update of attachment 133713 [details])
> I'd rename _Tree to something more specific (and maybe put it at the top of the file?).  There's an argument that says we should put the new class in its own module, which would have the benefit of making test-webkitpy smaller.  If we did that we, we'd probably want to use filesystem rather than os.path.  I think it's a question of how far you'd like to shave this yak.

Okay, I will rename and move it. 

I don't see much advantage to putting it in a different file, since I don't think anyone else will want to use it, and main.py isn't very big as it is.

Thanks for the review!
Comment 7 Dirk Pranke 2012-03-26 14:56:06 PDT
Created attachment 133899 [details]
rename _Tree to TestDirectoryTree
Comment 8 Dirk Pranke 2012-03-26 14:58:25 PDT
Committed r112150: <http://trac.webkit.org/changeset/112150>