Skip to content

Commit

Permalink
src py for version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
陈阳 authored and 陈阳 committed Aug 5, 2017
1 parent 2b65fd6 commit 65c0317
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ def shelloutput(result, toclipboard, location):
os.environ['result'] = result
if location == 'topright':
shell = 'exec ./dialog/Contents/MacOS/cocoaDialog bubble \
--title "翻译结果" \
--icon-file gt.png \
--text "$result"'
--title "翻译结果" \
--icon-file gt.png \
--text "$result"'
else:
shell = 'exec ./dialog/Contents/MacOS/cocoaDialog msgbox\
--title "Google Translate" \
--text "翻译结果" \
--icon-file gt.png \
--informative-text "$result" \
--button1 "OK"'
shell = 'rv=`./dialog/Contents/MacOS/cocoaDialog msgbox \
--title "Google Translate" \
--text "翻译结果" \
--icon-file gt.png \
--informative-text "$result" \
--button1 "OK" --button3 "复制结果"` '
shell = shell + '\n if [ "$rv" == "3" ]; then echo "$result" | /usr/bin/pbcopy ;fi'
os.system(shell)
if toclipboard == '1':
os.system('echo "$result" |/usr/bin/pbcopy')
Expand Down

0 comments on commit 65c0317

Please sign in to comment.