Comments (8)
I tried updating my token by selecting and enabling all checkboxes, thereby providing the token access to do anything/everything. After a :CBInit and entering the token again I now receive the following error:
TypeError: 'NoneType' object has no attribute '__getitem__'
This would truly be a great plugin if I can just get it to work, cutting and pasting from one machine to another via a cloud-based clipboard and file store.
Any ideas where I should look from here?
Here's the system:
Vim 7.4.1530
Linux hammer 4.4.0 #1 SMP Mon Jan 11 22:25:06 CST 2016 x86_64 AMD Opteron(tm) Processor 6128 AuthenticAMD GNU/Linux
Python 2.7.11
from cloudboard.vim.
Only check on gist
is enough to go.
It seems that gist API returned something unexpected, could you please add below line at cloudboard.py:35 to print out the response from https://api.github.com/gists?
print gists
from cloudboard.vim.
Here's what I got after adding/inserting:
print gists
after line 35 in ~/.vim/bundle/cloudboard.vim/plugin/cloudboard.py
http://screencast.com/t/5oL9S5DPl
from cloudboard.vim.
Or perhaps this is what you wanted to see?
http://awesomescreenshot.com/04e5ucacc0
Let me know because it seems to be a really great plugin if I can just get it to work
from cloudboard.vim.
I did not see anything wrong in the response from https://api.github.com/gists. To debug the issue, save below snippet as a file t.py, run python t.py <your_token_here>
.
import base64, os, sys
import urllib, urllib2, json
def request(url, headers, data=None, httpErrorHandler=None, json_decode=True):
req = urllib2.Request(url, data)
for k in headers.keys():
req.add_header(k, headers[k])
try:
response = urllib2.urlopen(req)
jstr = response.read()
except urllib2.HTTPError, e:
jstr = '{"error": "%s"}' % e
if httpErrorHandler:
httpErrorHandler(e)
except urllib2.URLError, e:
jstr = '{"error": "%s"}' % e
ret = jstr
if json_decode:
ret = json.loads(jstr)
return ret
reload(sys)
sys.setdefaultencoding('utf8')
gists = request('https://api.github.com/gists', {'Authorization': 'token %s' % sys.argv[1]})
for g in gists:
print g['description'][:10]
print g['files']
from cloudboard.vim.
Thanks Brook!
Here's what I got when running that script:
$ python ./t.py 5f6285f749072a20b12e207eb4b6f4a1d9bf084b
Install tm
{u'install_tmux_centos6.sh': {u'size': 830, u'raw_url': u'https://gist.githubusercontent.com/tallship/5119391/raw/12ec5ded22188802b66b0f981b27243f00c9152b/install_tmux_centos6.sh', u'type': u'application/x-sh', u'language': u'Shell', u'filename': u'install_tmux_centos6.sh'}}
Traceback (most recent call last):
File "./t.py", line 27, in <module>
print g['description'][:10]
TypeError: 'NoneType' object has no attribute '__getitem__'
I went and generated another token after this so not to worry about the one above.
from cloudboard.vim.
This commit 2032a76 should fix the issue, please have a try.
from cloudboard.vim.
Yes, it works flawlessly now - and this is going to be an invaluable tool keeping files up and ready to paste into vim for quick deployments, etc.
Thank you so much for addressing this and the fix Brook!
from cloudboard.vim.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudboard.vim.