Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major refactor works with current evernote
- Loading branch information
Showing
9 changed files
with
448 additions
and
802 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
application: clevernote-cli | ||
version: 2 | ||
runtime: python27 | ||
api_version: 1 | ||
threadsafe: yes | ||
|
||
handlers: | ||
- url: /favicon\.ico | ||
static_files: favicon.ico | ||
upload: favicon\.ico | ||
|
||
- url: .* | ||
script: main.app | ||
|
||
libraries: | ||
- name: webapp2 | ||
version: "2.5.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
indexes: | ||
|
||
# AUTOGENERATED | ||
|
||
# This index.yaml is automatically updated whenever the dev_appserver | ||
# detects that a new type of query is run. If you want to manage the | ||
# index.yaml file manually, remove the above marker line (the line | ||
# saying "# AUTOGENERATED"). If you want to manage some indexes | ||
# manually, move them above the marker line. The index.yaml file is | ||
# automatically uploaded to the admin console when you next deploy | ||
# your application using appcfg.py. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
|
||
import base64 | ||
import pickle | ||
import webapp2 | ||
import cgi | ||
|
||
|
||
class MainHandler(webapp2.RequestHandler): | ||
def get(self): | ||
self.response.write('') | ||
|
||
|
||
class OAuthHandler(webapp2.RequestHandler): | ||
def get(self): | ||
token = self.request.get('oauth_token') | ||
verifier = self.request.get('oauth_verifier') | ||
auth_dict = {'token': token, 'verifier': verifier} | ||
data = pickle.dumps(auth_dict) | ||
data64 = base64.b64encode(data) | ||
self.response.write('<html><body>Paste into command line:<br>') | ||
self.response.write('<textArea rows="5" cols="80">') | ||
self.response.write(cgi.escape(data64)) | ||
self.response.write('</textArea></body></html>') | ||
|
||
def post(self): | ||
self.response.write('<html><body>Paste the following Auth String into the prompt in the ' | ||
'command line of clevernote:<pre>') | ||
self.response.write(cgi.escape(self.request.get('oauth_token'))) | ||
self.response.write('</pre></body></html>') | ||
|
||
app = webapp2.WSGIApplication([ | ||
('/', MainHandler), | ||
('/oauth', OAuthHandler) | ||
], debug=True) |
Oops, something went wrong.