我已經廣泛使用了GIMP 2和WebSockets(在java和js中),但我是Python新手。GIMP Python和websockets
我想在我的GIMP的插件使用的WebSocket客戶端,所以我給自己買了Python的2.7.14(隨PIP)和我已經運行安裝在此的WebSocket實施來找到說明:https://github.com/websocket-client/websocket-client
我看到它取決於'six'和'backports.ssl_match_hostname',所以我使用pip來安裝兩個,已經安裝了6個,並且更新了backports。
我的插件如下:
#!/usr/bin/env python
from gimpfu import *
import websocket
def python_pytest(img, layer) :
# Actual plug-in code will go here
ws = websocket.WebSocket()
ws.connect("ws://example.com/websocket", http_proxy_host="proxy_host_name", http_proxy_port=3128)
return
register(
"python_fu_pytest", #Name so other scripts can find us
"Collaborative Editing", #Short Desc
"WebSocket based collaborative editing", #Long description
"Jonathan Crowder", #Author
"Open Source", #Copyright Holder
"2017", #Copyright Date
"NetCanvas", #Plugin name in menus
"*", #Image types we can handle
[], #Params shown to user
[], #Return values
python_pytest, #Main function
menu="<Image>/NetCanvas") #Where to show in menus
main()
如果我擺脫的WebSocket相關的代碼,它似乎工作得很好,但我得到這個錯誤與上面的代碼:
(gimp-2.8.exe:5508): LibGimpBase-WARNING **: gimp-2.8.exe: gimp_wire_read(): error
Querying plug-in: 'C:\Users\Jonathan\.gimp-2.8\plug-ins\netcanvas.py'
(gimp-2.8.exe:5508): LibGimpBase-WARNING **: gimp-2.8.exe: gimp_wire_read(): error
我不是調試的朝聖者,但我沒有足夠的信息來弄清楚什麼是錯誤的。我得到了使用命令的輸出:
gimp-2.8 --verbose --console-messages
我在做什麼錯? gimp python插件能否讀取我已安裝的庫?有沒有辦法從gimp中獲得更多信息?我以爲--verbose實際上會......好,詳細。
編輯 - 只是要清楚,這是我整個日誌,櫃面你以爲我不包括多汁的調試信息..:
INIT: gimp_load_config
Parsing 'C:\Users\Jonathan\.gimp-2.8\unitrc'
Parsing 'C:\Program Files\GIMP 2\etc\gimp\2.0\gimprc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\gimprc'
gimp_composite: verbose=no
Processor instruction sets: +mmx +sse +sse2 -3dnow -altivec -vis
Adding theme 'Default' (C:\Program Files\GIMP 2\share\gimp\2.0\themes\Default)
Adding theme 'Small' (C:\Program Files\GIMP 2\share\gimp\2.0\themes\Small)
Writing 'C:\Users\Jonathan\.gimp-2.8\themerc'
Trying splash 'C:\Users\Jonathan\.gimp-2.8\gimp-splash.png' ... failed
Trying splash 'C:\Program Files\GIMP 2\share\gimp\2.0\images\gimp-splash.png' ..
. OK
INIT: gimp_initialize
INIT: gimp_real_initialize
INIT: gui_initialize_after_callback
INIT: gimp_restore
Parsing 'C:\Users\Jonathan\.gimp-2.8\parasiterc'
Loading 'brush factory' data
Loading 'dynamics factory' data
Loading 'pattern factory' data
Loading 'palette factory' data
Loading 'gradient factory' data
Loading fonts
Loading 'tool preset factory' data
Parsing 'C:\Users\Jonathan\.gimp-2.8\templaterc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\modulerc'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcolor-selector-c
myk.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcolor-selector
-cmyk.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcolor-selector-w
ater.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcolor-selector
-water.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcolor-selector-w
heel.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcolor-selector
-wheel.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcontroller-dx-di
nput.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libcontroller-dx-
dinput.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter-c
olor-blind.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter
-color-blind.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter-g
amma.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter
-gamma.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter-h
igh-contrast.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter
-high-contrast.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter-l
cms.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter
-lcms.dll'
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter-p
roof.dll'
Unloading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter
-proof.dll'
INIT: gui_restore_callback
clipboard: writable pixbuf format: image/png
clipboard: writable pixbuf format: image/bmp
clipboard: writable pixbuf format: image/x-bmp
clipboard: writable pixbuf format: image/x-MS-bmp
clipboard: writable pixbuf format: image/x-icon
clipboard: writable pixbuf format: image/x-ico
clipboard: writable pixbuf format: image/x-win-bitmap
clipboard: writable pixbuf format: image/tiff
clipboard: writable pixbuf format: image/jpeg
Parsing 'C:\Users\Jonathan\.gimp-2.8\sessionrc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\dockrc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\toolrc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\contextrc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-rect-select-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-ellipse-select-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-free-select-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-fuzzy-select-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-by-color-select-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-iscissors-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-foreground-select-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-vector-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-color-picker-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-zoom-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-measure-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-move-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-align-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-crop-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-rotate-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-scale-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-shear-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-perspective-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-flip-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-cage-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-text-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-bucket-fill-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-blend-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-pencil-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-paintbrush-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-eraser-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-airbrush-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-ink-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-clone-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-heal-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-perspective-clone-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-convolve-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-smudge-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-dodge-burn-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-desaturate-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-color-balance-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-hue-saturation-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-colorize-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-brightness-contrast-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-threshold-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-levels-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-curves-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-posterize-tool'
Parsing 'C:\Users\Jonathan\.gimp-2.8\tool-options\gimp-gegl-tool'
INIT: gimp_real_restore
Parsing 'C:\Users\Jonathan\.gimp-2.8\pluginrc'
Querying plug-in: 'C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins\pyconsole.py'
(gimp-2.8.exe:5508): LibGimpBase-WARNING **: gimp-2.8.exe: gimp_wire_read(): err
or
Querying plug-in: 'C:\Users\Jonathan\.gimp-2.8\plug-ins\netcanvas.py'
(gimp-2.8.exe:5508): LibGimpBase-WARNING **: gimp-2.8.exe: gimp_wire_read(): err
or
Writing 'C:\Users\Jonathan\.gimp-2.8\pluginrc'
Starting extension: 'extension-script-fu'
INIT: gui_restore_after_callback
Parsing 'C:\Users\Jonathan\.gimp-2.8\menurc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\devicerc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\controllerrc'
Parsing 'C:\Users\Jonathan\.gimp-2.8\colorrc'
loading menu 'C:\Program Files\GIMP 2\share\gimp\2.0\menus\image-menu.xml' for/
image-menubar
Loading module 'C:\Program Files\GIMP 2\lib\gimp\2.0\modules\libdisplay-filter-l
cms.dll'
EXIT: gimp_exit
EXIT: gui_exit_callback
Writing 'C:\Users\Jonathan\.gimp-2.8\sessionrc'
Writing 'C:\Users\Jonathan\.gimp-2.8\dockrc'
Writing 'C:\Users\Jonathan\.gimp-2.8\colorrc'
Writing 'C:\Users\Jonathan\.gimp-2.8\menurc'
Writing 'C:\Users\Jonathan\.gimp-2.8\controllerrc'
Writing 'C:\Users\Jonathan\.gimp-2.8\toolrc'
EXIT: gimp_real_exit
Writing 'C:\Users\Jonathan\.gimp-2.8\templaterc'
Writing 'C:\Users\Jonathan\.gimp-2.8\parasiterc'
Writing 'C:\Users\Jonathan\.gimp-2.8\unitrc'
EXIT: gui_exit_after_callback
EXIT: app_exit_after_callback
(Type any character to close this window)
感謝您的快速回復,我將在今晚編寫代碼並報告我要做什麼來解決它。我想我會先試着將GIMP連接到系統python,但最終我只是爲了看看發生了什麼。 –