Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Issue 10500004: Die build.py, Die: Part 2 (LocalFetcher, Handlebar support, build script) (Closed)

Created:
8 years, 6 months ago by cduvall
Modified:
8 years, 6 months ago
CC:
chromium-reviews, mihaip-chromium-reviews_chromium.org, clintstaley, not at google - send to devlin
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Die build.py, Die: Part 2 (LocalFetcher, Handlebar support, build script) I implemented/tested the local fetcher and minimal template support. I also wrote a script that will run the server in the local file system, and as a bonus, clean itself up on ^C. Part 1: http://codereview.chromium.org/10387225/ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=140465

Patch Set 1 #

Total comments: 28

Patch Set 2 : Changes and comments #

Total comments: 11

Patch Set 3 : Clean up and template fetcher #

Patch Set 4 : Local is now a branch #

Total comments: 5

Patch Set 5 : TemplateFetcher now has dictionary interface #

Total comments: 10

Patch Set 6 : More changes #

Total comments: 2

Patch Set 7 : Added parens #

Unified diffs Side-by-side diffs Delta from patch set Stats (+340 lines, -35 lines) Patch
A chrome/common/extensions/docs/server2/.gitignore View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/branch_utility.py View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
A chrome/common/extensions/docs/server2/build_server.py View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/echo_handler.py View 1 2 3 4 5 2 chunks +48 lines, -22 lines 0 comments Download
A chrome/common/extensions/docs/server2/local_fetcher.py View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/local_fetcher_test.py View 1 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/start_dev_server.py View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A + chrome/common/extensions/docs/server2/subversion_fetcher.py View 1 1 chunk +6 lines, -5 lines 0 comments Download
A + chrome/common/extensions/docs/server2/subversion_fetcher_test.py View 1 1 chunk +9 lines, -7 lines 0 comments Download
A chrome/common/extensions/docs/server2/template_fetcher.py View 1 2 3 4 5 6 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/template_fetcher_test.py View 1 2 3 4 5 1 chunk +46 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/template_utility.py View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/template_utility_test.py View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/local_fetcher/test1.txt View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/local_fetcher/test2.txt View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/local_fetcher/test3.txt View 1 chunk +1 line, -0 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/subversion_fetcher/branch1/test.txt View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/subversion_fetcher/branch2/test.txt View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/test.txt View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_fetcher/a/test1.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_fetcher/a/test2.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_fetcher/b/test1.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_utility/test1.html View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_utility/test1.json View 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_utility/test1_tmpl.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_utility/test2.html View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_utility/test2.json View 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/test_data/template_utility/test2_tmpl.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/test_urlfetch.py View 1 2 chunks +3 lines, -1 line 0 comments Download
A chrome/common/extensions/docs/template2/public/browserAction.html View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
cduvall
Here's my initial upload of my most recent work.
8 years, 6 months ago (2012-06-01 22:57:19 UTC) #1
cduvall
8 years, 6 months ago (2012-06-02 00:25:42 UTC) #2
Aaron Boodman
Sweet. +kalman, fyi http://codereview.chromium.org/10500004/diff/1/chrome/common/extensions/docs/server2/build_server.py File chrome/common/extensions/docs/server2/build_server.py (right): http://codereview.chromium.org/10500004/diff/1/chrome/common/extensions/docs/server2/build_server.py#newcode9 chrome/common/extensions/docs/server2/build_server.py:9: THIRD_PARTY_DIR = sys.path[0] + '/../../../../../third_party/' Not ...
8 years, 6 months ago (2012-06-02 07:50:22 UTC) #3
cduvall
http://codereview.chromium.org/10500004/diff/1/chrome/common/extensions/docs/server2/build_server.py File chrome/common/extensions/docs/server2/build_server.py (right): http://codereview.chromium.org/10500004/diff/1/chrome/common/extensions/docs/server2/build_server.py#newcode9 chrome/common/extensions/docs/server2/build_server.py:9: THIRD_PARTY_DIR = sys.path[0] + '/../../../../../third_party/' On 2012/06/02 07:50:22, Aaron ...
8 years, 6 months ago (2012-06-02 19:12:04 UTC) #4
Aaron Boodman
http://codereview.chromium.org/10500004/diff/1/chrome/common/extensions/docs/server2/build_server.py File chrome/common/extensions/docs/server2/build_server.py (right): http://codereview.chromium.org/10500004/diff/1/chrome/common/extensions/docs/server2/build_server.py#newcode10 chrome/common/extensions/docs/server2/build_server.py:10: LOCAL_THIRD_PARTY_DIR = sys.path[0] + '/third_party/' On 2012/06/02 19:12:05, cduvall ...
8 years, 6 months ago (2012-06-03 05:43:14 UTC) #5
not at google - send to devlin
Thanks. Browsed over everything, just have a couple of drive-by comments. http://codereview.chromium.org/10500004/diff/2003/chrome/common/extensions/docs/server2/build_server.py File chrome/common/extensions/docs/server2/build_server.py (right): ...
8 years, 6 months ago (2012-06-04 04:37:08 UTC) #6
Aaron Boodman
http://codereview.chromium.org/10500004/diff/2003/chrome/common/extensions/docs/server2/build_server.py File chrome/common/extensions/docs/server2/build_server.py (right): http://codereview.chromium.org/10500004/diff/2003/chrome/common/extensions/docs/server2/build_server.py#newcode5 chrome/common/extensions/docs/server2/build_server.py:5: On 2012/06/04 04:37:08, kalman wrote: > I was totally ...
8 years, 6 months ago (2012-06-04 06:29:09 UTC) #7
not at google - send to devlin
http://codereview.chromium.org/10500004/diff/2003/chrome/common/extensions/docs/server2/template_utility.py File chrome/common/extensions/docs/server2/template_utility.py (right): http://codereview.chromium.org/10500004/diff/2003/chrome/common/extensions/docs/server2/template_utility.py#newcode14 chrome/common/extensions/docs/server2/template_utility.py:14: return rendered_template On 2012/06/04 06:29:09, Aaron Boodman wrote: > ...
8 years, 6 months ago (2012-06-04 06:36:29 UTC) #8
not at google - send to devlin
Oops slightly screwed up that code example. Try again: --- bar.html --- Hello from bar! ...
8 years, 6 months ago (2012-06-04 06:38:54 UTC) #9
not at google - send to devlin
Screwed it up again! Ok this time will be right. --- bar.html --- Hello from ...
8 years, 6 months ago (2012-06-04 06:40:19 UTC) #10
cduvall
I added a TemplateFetcher class to fetch compiled templates and cache them in the process. ...
8 years, 6 months ago (2012-06-04 21:53:25 UTC) #11
cduvall
Local is now a branch like 'dev', 'stable'... Cleaned up echo_handler.py.
8 years, 6 months ago (2012-06-04 22:25:55 UTC) #12
not at google - send to devlin
To answer your question in the overall comments: yep, it should work well for partials, ...
8 years, 6 months ago (2012-06-04 23:09:51 UTC) #13
not at google - send to devlin
More generally, something like def Instance(object): """Contains the configuration for a single "instance" of the ...
8 years, 6 months ago (2012-06-04 23:43:50 UTC) #14
not at google - send to devlin
http://codereview.chromium.org/10500004/diff/20001/chrome/common/extensions/docs/server2/template_fetcher_test.py File chrome/common/extensions/docs/server2/template_fetcher_test.py (right): http://codereview.chromium.org/10500004/diff/20001/chrome/common/extensions/docs/server2/template_fetcher_test.py#newcode31 chrome/common/extensions/docs/server2/template_fetcher_test.py:31: t_fetcher.FetchTemplate('b', 'test1.tmpl') Two little things here: I thought we ...
8 years, 6 months ago (2012-06-04 23:52:26 UTC) #15
Aaron Boodman
On 2012/06/04 23:43:50, kalman wrote: > More generally, something like > > def Instance(object): > ...
8 years, 6 months ago (2012-06-05 00:31:58 UTC) #16
cduvall
> I like this... Clark, wdyt? I like it too. I'll implement this and the ...
8 years, 6 months ago (2012-06-05 00:38:15 UTC) #17
Aaron Boodman
https://chromiumcodereview.appspot.com/10500004/diff/19031/chrome/common/extensions/docs/server2/echo_handler.py File chrome/common/extensions/docs/server2/echo_handler.py (right): https://chromiumcodereview.appspot.com/10500004/diff/19031/chrome/common/extensions/docs/server2/echo_handler.py#newcode61 chrome/common/extensions/docs/server2/echo_handler.py:61: template = template_fetcher[PUBLIC_TEMPLATE_PATH + filename] Like kalman suggested, I ...
8 years, 6 months ago (2012-06-05 00:50:04 UTC) #18
not at google - send to devlin
https://chromiumcodereview.appspot.com/10500004/diff/19031/chrome/common/extensions/docs/server2/template_fetcher.py File chrome/common/extensions/docs/server2/template_fetcher.py (right): https://chromiumcodereview.appspot.com/10500004/diff/19031/chrome/common/extensions/docs/server2/template_fetcher.py#newcode25 chrome/common/extensions/docs/server2/template_fetcher.py:25: if (self._branch, key) not in TEMPLATE_CACHE: On 2012/06/05 00:50:04, ...
8 years, 6 months ago (2012-06-05 00:56:10 UTC) #19
cduvall
https://chromiumcodereview.appspot.com/10500004/diff/19031/chrome/common/extensions/docs/server2/template_fetcher.py File chrome/common/extensions/docs/server2/template_fetcher.py (right): https://chromiumcodereview.appspot.com/10500004/diff/19031/chrome/common/extensions/docs/server2/template_fetcher.py#newcode25 chrome/common/extensions/docs/server2/template_fetcher.py:25: if (self._branch, key) not in TEMPLATE_CACHE: On 2012/06/05 00:50:04, ...
8 years, 6 months ago (2012-06-05 01:07:37 UTC) #20
Aaron Boodman
lgtm https://chromiumcodereview.appspot.com/10500004/diff/30002/chrome/common/extensions/docs/server2/template_fetcher.py File chrome/common/extensions/docs/server2/template_fetcher.py (right): https://chromiumcodereview.appspot.com/10500004/diff/30002/chrome/common/extensions/docs/server2/template_fetcher.py#newcode28 chrome/common/extensions/docs/server2/template_fetcher.py:28: if time.clock() - compile_time > CACHE_TIMEOUT: Add parens ...
8 years, 6 months ago (2012-06-05 01:20:22 UTC) #21
cduvall
8 years, 6 months ago (2012-06-05 01:22:03 UTC) #22
https://chromiumcodereview.appspot.com/10500004/diff/30002/chrome/common/exte...
File chrome/common/extensions/docs/server2/template_fetcher.py (right):

https://chromiumcodereview.appspot.com/10500004/diff/30002/chrome/common/exte...
chrome/common/extensions/docs/server2/template_fetcher.py:28: if time.clock() -
compile_time > CACHE_TIMEOUT:
On 2012/06/05 01:20:22, Aaron Boodman wrote:
> Add parens around the subtraction to make order of operations clear.

Done.

Powered by Google App Engine
This is Rietveld 408576698