I'm attempting to set up the sample application produced by Google called 'Dredit' for Python on Google App Engine. Documentation here: https://developers.google.com/drive/examples/python
The application is supposed to be able to open, create, and edit files from the user's Google Drive folder.
Almost everything appears to be working, except for some JavaScript errors that appear in the console on the home page. Also, when I try to create a new document, I can't change the document's title, nor can I edit an existing document's name. However, it does allow me to edit the content of any document. To see for yourself, the app is here: http://www.dredit-python-0515.appspot.com. You'll need a Google Account to sign in.
The errors are different in Chrome's JS console and Firebug, but they seem to center around the angularJS file in my project directory.
The error in Chrome is:
TypeError: Cannot read property 'editable' of undefined
at Object.service.state (http://dredit-python-0515.appspot.com/js/services.js:135:37)
at http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:6128:19
at OPERATORS.| (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:5560:74)
at http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:5879:14
at Object.fn (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:4788:22)
at Object.Scope.$digest (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:7654:38)
at Object.Scope.$apply (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:7855:24)
at done (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:8844:20)
at completeRequest (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:8984:7)
at XMLHttpRequest.xhr.onreadystatechange (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:8954:11)
Any help is greatly appreciated!
I can't get your app to work either, but looking at the stack trace:
The error is coming from the line
} else if (!doc.info.editable) {
return EditorState.READONLY;
}
in http://dredit-python-0515.appspot.com/js/services.js
When this code is called, doc.info is not defined.
For whatever reason, the "state" function is being called before the "createEditor" function which sets the doc.info object.
The easiest fix would be to replace the "else if" on line 135 with
} else if (doc.info && !doc.info.editable) {