jiffies / gouyong Goto Github PK
View Code? Open in Web Editor NEWYoudao,Translate,Dict.Best experience of get word from screen in Linux.
Youdao,Translate,Dict.Best experience of get word from screen in Linux.
更新了最新的windows.py文件后,可以启动了。但是火狐浏览器无法划词翻译。
liangsh@lsh-dev:~/Downloads/marisa-0.2.4$ GouYong
[INFO 2015-01-19 19:14:23,541 youdaoQuery]:cache folder exists.
Traceback (most recent call last):
File "/usr/local/bin/GouYong", line 9, in
load_entry_point('GouYong==0.3', 'gui_scripts', 'GouYong')()
File "/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/window.py", line 256, in main
pop=Popup()
File "/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/window.py", line 32, in init
self.init_textview()
File "/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/window.py", line 36, in init_textview
self.textbuffer = Gtk.TextBuffer.new()
File "/usr/lib/python2.7/dist-packages/gi/types.py", line 72, in constructor
return info.invoke(cls, _args, *_kwargs)
TypeError: new() takes exactly 1 argument (0 given)
获取某个单词,偏慢出现窗口,差不多3-5秒,而且不是空白的,就是一闪而过。
操作系统:
➜ /home/greenhand2learn >uname -a [2016-09-29 10:24:23]
Linux Anonymous 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux
➜ /home/greenhand2learn >lsb_release -a [2016-09-29 10:24:25]
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: kali-rolling
Codename: kali-rolling
运行报错信息
/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/window.py:2: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gdk,Gtk,GLib,WebKit,GObject
/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/window.py:2: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gdk,Gtk,GLib,WebKit,GObject
/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/window.py:2: PyGIWarning: WebKit was imported without specifying a version first. Use gi.require_version('WebKit', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gdk,Gtk,GLib,WebKit,GObject
[INFO 2016-09-29 10:18:27,940 youdaoQuery]:cache folder exists.
/usr/local/lib/python2.7/dist-packages/GouYong-0.3-py2.7.egg/GouYong/src/indicator.py:3: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
from gi.repository import AppIndicator3 as appindicator
[INFO 2016-09-29 10:18:29,273 window]:textbuffer init <Gtk.TextBuffer object at 0x7f9a60ecf8c0 (GtkTextBuffer at 0x2d8d980)>.
[INFO 2016-09-29 10:18:29,275 dict_manager]:['stardict-21shijishuangxiangcidian-2.4.2', 'lazy-dict']
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-8u102-b14.1-2-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
============Not Found fmt and trie,analysis now.
[INFO 2016-09-29 10:18:32,031 dict_manager]:载入/usr/share/GouYong/dict/lazy-dict/懒虫简明英汉词典
[DEBUG 2016-09-29 10:18:32,095 record]:work run
(GouYong:22255): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
[DEBUG 2016-09-29 10:18:33,489 window]:Not working.
[DEBUG 2016-09-29 10:18:33,489 window]:need at 26110661
[DEBUG 2016-09-29 10:18:33,489 utils]:elapsed time: 0.004053 ms
[DEBUG 2016-09-29 10:18:34,808 window]:Not working.
[DEBUG 2016-09-29 10:18:34,808 window]:need at 26111981
[DEBUG 2016-09-29 10:18:34,809 utils]:elapsed time: 0.005007 ms
[DEBUG 2016-09-29 10:18:36,976 window]:Not working.
[DEBUG 2016-09-29 10:18:36,977 window]:need at 26114149
[DEBUG 2016-09-29 10:18:36,977 utils]:elapsed time: 0.005007 ms
[DEBUG 2016-09-29 10:18:38,400 window]:Not working.
[DEBUG 2016-09-29 10:18:38,400 window]:need at 26115573
[DEBUG 2016-09-29 10:18:38,401 utils]:elapsed time: 0.003815 ms
[DEBUG 2016-09-29 10:18:38,577 window]:Not working.
[DEBUG 2016-09-29 10:18:38,577 window]:need at 26115749
无法ctrl+c停止运行,一直显示这个
[DEBUG 2016-09-29 10:24:53,984 window]:Signal callback already woking.
[DEBUG 2016-09-29 10:24:54,153 window]:Signal callback already woking.
[DEBUG 2016-09-29 10:24:54,488 window]:Signal callback already woking.
使用fedora 20进行测试,顺便打了个 rpm包(https://copr.fedoraproject.org/coprs/mosquito/myrepo/)
本机依赖:
修改了以下几点:
self.textbuffer = Gtk.TextBuffer.new()
self.textbuffer = Gtk.TextBuffer.new(table=None)
执行出错:
$ gouyong
[INFO 2014-10-28 03:32:45,305 dict_manager]:['stardict-21shijishuangxiangcidian-2.4.2', 'lazy-dict']
java version "1.7.0_65"
OpenJDK Runtime Environment (fedora-2.5.2.5.fc20-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
Traceback (most recent call last):
File "/usr/bin/gouyong", line 9, in
load_entry_point('gouyong==0.2', 'gui_scripts', 'gouyong')()
File "/usr/lib/python2.7/site-packages/gouyong/src/window.py", line 248, in main
dm.open_dict()
File "/usr/lib/python2.7/site-packages/gouyong/src/dict_manager.py", line 38, in open_dict
self.dict = Dictionary(os.path.join(self.dict_dir,dict_name))
File "/usr/lib/python2.7/site-packages/gouyong/src/../lib/pystardict.py", line 439, in init
self.idx = _StarDictIdx(dict_prefix=filename_prefix, container=self)
File "/usr/lib/python2.7/site-packages/gouyong/src/../lib/pystardict.py", line 183, in init
self.trie = marisa.Trie(fmt,dict)
TypeError: init() takes exactly 1 argument (3 given)
尝试修复:
注释了/usr/lib/python2.7/site-packages/gouyong//lib/pystardict.py的148, 149, 183, 184, 189, 190 之后,可以成功运行,并使用网络取词功能,但本机词典不可用。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.