Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(459)

Issue 183117: using Route GTFS Object

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 3 months ago by calidion
Modified:
7 years, 4 months ago
Reviewers:
xan, weiliu, baiming, leio.chen, lychen, qiaojian
CC:
xinxing_google.com, lishuangfeng_gmail.com
Base URL:
http://scheduleeditor.googlecode.com/svn/trunk/python/
Visibility:
Public.

Patch Set 1 #

Total comments: 48

Patch Set 2 : updated #

Patch Set 3 : updated #

Total comments: 2

Patch Set 4 : add parseRoutes #

Patch Set 5 : updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -142 lines) Patch
M gtfsscheduleviewer/files/route.js View 1 chunk +0 lines, -58 lines 0 comments Download
M gtfsscheduleviewer/files/style.css View 2 chunks +1 line, -3 lines 0 comments Download
M gtfsscheduleviewer/files/transit_editor.js View 1 2 3 4 10 chunks +231 lines, -81 lines 0 comments Download

Messages

Total messages: 11
calidion
using Route GTFS Object to update route list
14 years, 3 months ago (2010-01-05 07:01:34 UTC) #1
baiming
http://codereview.appspot.com/183117/diff/1/2 File gtfsscheduleviewer/files/transit_editor.js (right): http://codereview.appspot.com/183117/diff/1/2#newcode220 gtfsscheduleviewer/files/transit_editor.js:220: function fetchPatterns(routeId) { Add comments for this function. http://codereview.appspot.com/183117/diff/1/2#newcode221 ...
14 years, 3 months ago (2010-01-05 08:57:39 UTC) #2
calidion
updated http://codereview.appspot.com/183117/diff/1/2 File gtfsscheduleviewer/files/transit_editor.js (right): http://codereview.appspot.com/183117/diff/1/2#newcode231 gtfsscheduleviewer/files/transit_editor.js:231: var div = document.createElement("div"); On 2010/01/05 08:57:39, baiming ...
14 years, 3 months ago (2010-01-05 09:52:41 UTC) #3
baiming
http://codereview.appspot.com/183117/diff/1/2 File gtfsscheduleviewer/files/transit_editor.js (right): http://codereview.appspot.com/183117/diff/1/2#newcode662 gtfsscheduleviewer/files/transit_editor.js:662: this.fetcher.getRoutes(this, this.id, function(data) { Yes, directly using "this" in ...
14 years, 3 months ago (2010-01-05 12:56:22 UTC) #4
calidion
it would be much clearer to comment on the newly uploaded side 2010/1/5 <baiming@google.com> > ...
14 years, 3 months ago (2010-01-05 14:39:20 UTC) #5
baiming
I just wanna reply closely to what you said, to keep the context. 2010/1/5 李白,字一日 ...
14 years, 3 months ago (2010-01-06 01:07:32 UTC) #6
calidion
updated. http://codereview.appspot.com/183117/diff/1/2 File gtfsscheduleviewer/files/transit_editor.js (right): http://codereview.appspot.com/183117/diff/1/2#newcode662 gtfsscheduleviewer/files/transit_editor.js:662: this.fetcher.getRoutes(this, this.id, function(data) { I think you may ...
14 years, 3 months ago (2010-01-06 02:23:34 UTC) #7
calidion
updated
14 years, 3 months ago (2010-01-06 09:23:41 UTC) #8
baiming
LGTM. Thanks for the changes! http://codereview.appspot.com/183117/diff/1006/1007 File gtfsscheduleviewer/files/transit_editor.js (right): http://codereview.appspot.com/183117/diff/1006/1007#newcode656 gtfsscheduleviewer/files/transit_editor.js:656: Agency.prototype.getRoutes = function(callback){ Look ...
14 years, 3 months ago (2010-01-06 09:32:41 UTC) #9
baiming
On Wed, Jan 6, 2010 at 5:32 PM, <baiming@google.com> wrote: > LGTM. > > Thanks ...
14 years, 3 months ago (2010-01-06 09:33:54 UTC) #10
calidion
14 years, 3 months ago (2010-01-06 09:37:16 UTC) #11
updated to rev 42

2010/1/6 <baiming@google.com>

> LGTM.
>
> Thanks for the changes!
>
>
> http://codereview.appspot.com/183117/diff/1006/1007
>
> File gtfsscheduleviewer/files/transit_editor.js (right):
>
> http://codereview.appspot.com/183117/diff/1006/1007#newcode656
>
> gtfsscheduleviewer/files/transit_editor.js:656:
> Agency.prototype.getRoutes = function(callback){
> Look at how you are using the callback parameter, in line 582. The
> callback function is not a behavior of the caller Manager, but of the
> agency itself.
> 0) obsolete Agency.prototype.getRoutes()
> 1) make the anonymous function as a member store() or other names
> 2) add a function storeAndShow() { store(); showRoutes(); }
> 3) add a function getRoutesAndShow() {
>  if (this.retrieved_) {
>    this.storeAndShow();
>    return;
>  }
>   this.fetcher.getRoutes(this.id, this, this.storeAndShow);
> }
> 4) Maybe you will need add some other functions in future:
> verify() {...}
> storeAndVerify() { this.store(); this.verify(); }
> getRoutesAndVerify() {
>  if (this.retrieved_) {
>    this.verify();
>    return;
>  }
>   this.fetcher.getRoutes(this.id, this, this.storeAndVerify);
> }
>
> http://codereview.appspot.com/183117/diff/1006/1007#newcode656
>
> gtfsscheduleviewer/files/transit_editor.js:656:
> Agency.prototype.getRoutes = function(callback){
> The root of all evil is the callback parameter of getRoutes, which needs
> to be passed to another async function Fetcher.prototype.getRoutes.
>
> Let's have a look if it really worth being or should be a callback.
>
> option 1: replace callback with event, if the callback is really should
> be done by caller
> option 2: let Agency itself handle the whole procedure, from fetching to
> handling response
>
>
> http://codereview.appspot.com/183117
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b