forked from ma6174/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Your Name Here
committed
Aug 27, 2012
1 parent
dc7f328
commit 2b980b9
Showing
292 changed files
with
7,508 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
markdown-1.2.2.vba: call delete('/home/ma6174/.vim/ftdetect/markdown.vim')|call delete('/home/ma6174/.vim/snippets/markdown.snippets')|call delete('/home/ma6174/.vim/syntax/markdown.vim') | ||
mark.vba: call delete('/home/ma6174/.vim/autoload/mark.vim')|call delete('/home/ma6174/.vim/autoload/mark/palettes.vim')|call delete('/home/ma6174/.vim/plugin/mark.vim')|call delete('/home/ma6174/.vim/doc/mark.txt') |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
let g:netrw_dirhistmax =10 | ||
let g:netrw_dirhist_cnt =2 | ||
let g:netrw_dirhist_1='/home/ma6174/.vim/ftplugin/python' | ||
let g:netrw_dirhist_2='/media/M_hM_=M_M_dM__M_6M_hM_5M__DM_fM__VM__Y/YUNIO/program/python/poj' | ||
let g:netrw_dirhist_1='/media/M_hM_=M_M_dM__M_6M_hM_5M__DM_fM__VM__Y/YUNIO/program/python/lovesnow-deepin-music-player-a9be3e0' | ||
let g:netrw_dirhist_2='/media/M_hM_=M_M_dM__M_6M_hM_5M__DM_fM__VM__Y/YUNIO/program/python' |
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,52 @@ | ||
#!/usr/bin/env python | ||
#coding=utf-8 | ||
import urllib | ||
import json | ||
#ret = '''{"translation":["苹果"],"basic":{"phonetic":"'æpl","explains":["n. 苹果;家伙"]},"query":"apple","errorCode":0,"web":[{"value":["苹果","苹果公司","苹果汁","美国苹果"],"key":"Apple"},{"value":["苹果电脑","苹果电脑公司","苹果计算机","苹果公司"],"key":"Apple Computer"},{"value":["苹果公司","苹果","果公司","苹果股份有限公司"],"key":"Apple Inc"},{"value":["大苹果","纽约","大苹果城","纽约的别称"],"key":"big apple"},{"value":["苹果皮"],"key":"apple skin"},{"value":["苹果馅饼","苹果饼","苹果排","苹果蛋糕"],"key":"apple tart"},{"value":["苹果日报","韩版恶作之吻造型曝光"],"key":"Apple Daily"},{"value":["垫脚箱","因在早期电影制作中"],"key":"APPLE BOXES"},{"value":["炸苹果饼"],"key":"apple fritter"},{"value":["查拉尔·阿佩尔","阿佩尔","由查拉尔阿"],"key":"Gerald Apple"}]}''' | ||
def dealjson(ret): | ||
ret = json.loads(ret) | ||
error = ret['errorCode'] | ||
print error | ||
if error == 20: | ||
print '要翻译的文本过长' | ||
elif error == 30: | ||
print '无法进行有效的翻译' | ||
elif error == 40: | ||
print '不支持的语言类型' | ||
elif error == 50: | ||
print '无效的key' | ||
elif error == 0: | ||
trans = ret['translation'] | ||
for i in trans: | ||
print i | ||
print ret['query'] | ||
if 'basic' in ret.keys(): | ||
explain = ret['basic']['explains'] | ||
for i in explain: | ||
print i | ||
web =ret['web'] | ||
for i in web: | ||
print i['key'], | ||
for j in i['value']: | ||
print j, | ||
|
||
def youdao(word): | ||
word = urllib.quote(word) | ||
print word | ||
url = 'http://fanyi.youdao.com/openapi.do?keyfrom=ACM-OnlineJudge&key=2091830782&type=data&doctype=json&version=1.1&q='+word | ||
ret = urllib.urlopen(url).read() | ||
dealjson(ret) | ||
|
||
|
||
if __name__=='__main__': | ||
while True: | ||
word = raw_input('input: ') | ||
if word == '': | ||
continue | ||
word = urllib.quote(word) | ||
print word | ||
url = 'http://fanyi.youdao.com/openapi.do?keyfrom=ACM-OnlineJudge&key=2091830782&type=data&doctype=json&version=1.1&q='+word | ||
ret = urllib.urlopen(url).read() | ||
dealjson(ret) | ||
|
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.