Gajim - 2015-10-06


  1. tmolitor arune: no, i sent you the change .py file to test a couple of days ago...I used the httpupload plugin and posted it in this muc...
  2. tmolitor arune: I changed it together with the "first pil then gtk image preview rendering" change...
  3. tmolitor arune: I want to wait for your test under windows before I commit this...because I want to make sure the tempfile handling works correctly under windows...
  4. arune tmolitor: yeah, right
  5. arune I got it but forgot it depends on me
  6. Johannes I now get this "AttributeError: module 'locale' has no attribute 'bindtextdomain'" upon startup on osx, also the autogen-script does not like that intltool is not in the standard-path with homebrew+osx, and it appears to not like the bsd versions
  7. Johannes and upon verification module locale loads fine, anyhow does indeed not have such an attribute
  8. Johannes hey, I've got the UI to render on osx with a few additions. it even renders to quartz, not only x11
  9. Johannes however it does not yet integrate with the osx-menubar and also its does not connect but fails with Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/nbxmpp/dispatcher_nb.py", line 497, in dispatch handler['func'](session, stanza) File "/usr/local/lib/python3.5/site-packages/nbxmpp/auth_nb.py", line 425, in SASLHandler r = 'c=' + scram_base64(bytes(self.scram_gs2) TypeError: string argument without an encoding
  10. Link Mauve Johannes, I think you should be using nbxmpp from hg.
  11. Link Mauve I’m not sure this is the issue, but it’s a good first step.
  12. Johannes where would the hg for it be?
  13. Link Mauve Right alongside where you got Gajim from.
  14. Link Mauve On http://hg.gajim.org/
  15. arune Asterix, I'm getting this error when trying to install the latest httpupload plugin (one that needs PIL) with the windows Gajim version you sent me with built in support for PIL: Traceback (most recent call last): File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\plugin_installer\plugin_installer.py", line 337, in on_plugin_downloaded plugins = self.scan_dir_for_plugin(plugin_dir) File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\plugin_installer\plugin_installer.py", line 444, in scan_dir_for_plugin if not issubclass(module_attr, GajimPlugin) or \ File "src\common\demandimport.py", line 86, in __getattribute__ File "src\common\demandimport.py", line 58, in _load File "c:\python27\lib\site-packages\PIL\Image.py", line 67, in <module> File "src\common\demandimport.py", line 86, in __getattribute__ File "src\common\demandimport.py", line 58, in _load File "ExtensionLoader_PIL__imaging.py", line 22, in <module> File "ExtensionLoader_PIL__imaging.py", line 21, in __bootstrap__ ImportError: No module named None
  16. Asterix Johannes‎: if you're able to make Gajim work under OSX, I'd be very happy to include needed patches! and if you want to improve it and make a package that would be awesome!
  17. Asterix arune: ok I'll look
  18. Link Mauve I can help with the Homebrew package, I already maintain libepoxy there.
  19. Asterix nice!
  20. Link Mauve I wish I had an usable, graphical access to that OS though. :/
  21. faixh Asterix, how do I add changes to the gotr plugin (the carbons thing)? Do I hope that someone reacts to my PR on github or do I just suggest a patch directly at trac-plugins?
  22. Asterix faixh: Gajim doesn't use Github, so don't expect me to react :) A patch on trac-plugins would be perfect.
  23. Asterix faixh: have you seen other tickets openes for this plugin?
  24. faixh well I know that gajim does not, but there is a repo for gotr there. That's why I thought that changes might go through that repo and only afterwards are merged into trac-plugins
  25. arune ( https://github.com/python-otr/gajim-otr )
  26. faixh Asterix, no other open ticets, but there where some merged PRs which where not merged into trac-plugins as far as I can see
  27. arune Asterix, I got the plugin updated with 0.16.4 (without pil) and then reinstalled gajim with PIL. Then it could do "from PIL import Image" successfully but then I got this trace at first use, thumb = Image.open(path_to_file) Traceback (most recent call last): File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 274, in upload_complete thumb = Image.open(path_to_file) File "src\common\demandimport.py", line 86, in __getattribute__ File "src\common\demandimport.py", line 58, in _load File "c:\python27\lib\site-packages\PIL\Image.py", line 67, in <module> File "src\common\demandimport.py", line 86, in __getattribute__ File "src\common\demandimport.py", line 58, in _load File "ExtensionLoader_PIL__imaging.py", line 22, in <module> File "ExtensionLoader_PIL__imaging.py", line 21, in __bootstrap__ ImportError: No module named None
  28. arune hm, Asterix please see ^
  29. arune for me I could live with using gtk for resize, I don't know if tmolitor agrees though :)
  30. arune tmolitor, I got this when trying out your combined version (PIL/gtk)
  31. arune Traceback (most recent call last): File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 316, in upload_complete log.info("Using thumbnail jpeg quality %d (image size: %d bytes)" % (quality, len(thumb))) UnboundLocalError: local variable 'quality' referenced before assignment
  32. arune which probably means that the resize with gtk failed, will remove the try and see what the problem is
  33. arune tmolitor, ohh:
  34. arune Traceback (most recent call last): File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 294, in upload_complete loader.close() GError: Unrecognised image file format
  35. arune tmolitor, I tried to work around like in this post: http://stackoverflow.com/a/19303924/2514161 but then I got more errors later on
  36. Asterix faixh: ho really! afflux isn't nice then :/
  37. Asterix faixh: he closed all tickers on trac-plugins: https://trac-plugins.gajim.org/query?status=accepted&status=assigned&status=closed&status=new&status=reopened&component=OffTheRecordPlugin&col=id&col=summary&col=status&col=owner&col=type&col=priority&col=time&order=priority
  38. faixh Asterix, those two commits https://github.com/python-otr/gajim-otr/commit/ca941b0b4374722143d9065acc809b90c9dc9b69 and https://github.com/python-otr/gajim-otr/commit/3e7d4620c81c793bf067129cbc6fd8289667df56
  39. arune tmolitor, maybe it actually failes to open the file just before (thumb = content_file.read()) because I printed the size of the thumb variable after opening the file and the size is 5!
  40. Asterix faixh: ok thanks I'll commit them in our repos. And about the tickets I listed, if you're interested in looking at them, that would be nice!
  41. Asterix faixh: and, by the way, are you interested by maitaining gotr?
  42. faixh Asterix, I don't really use otr, so maintaining it would not make sense. I only have to use it with very few people and this carbon-thing annoyed me most, that's why I changed that.
  43. faixh I
  44. faixh I'll post the changes to trac-plugins, then (as soon as I added some more processing hints)
  45. Asterix faixh: ok thanks for that
  46. tmolitor arune: okay...give me a moment...I recently changed a few other things in the plugin...could you test this new version? maybe I fixed your bugs already by accident :)
  47. arune the contents of thumb after reading the file is (base64): iVBORwo=
  48. arune according to http://www.freeformatter.com/base64-encoder.html that is �PNG
  49. arune (I've tested several files and all results in a thumb variable of size 5)
  50. tmolitor seems like the file got cut after the first 5 bytes...
  51. tmolitor arune: that's very strange...
  52. tmolitor https://xmpp-upload.datenknoten.me/-br3Vey7Wu4NBfiBX37qzQ3WxpA/2dPqfjEKoUPEU/httpupload.py
  53. tmolitor arune: that's the actual version...could you test this version?
  54. tmolitor arune: which content_file do you mean? the one resulting from opening path_to_file or the one at temp_file?
  55. arune tmolitor, line 327
  56. tmolitor arune: in the new version I just posted or in the old version?
  57. tmolitor I don't have the old version here anymore...
  58. tmolitor asterix: why do I get kicked by isida when I use the httpupload plugin to post the link of some file?
  59. tmolitor https://xmpp-upload.datenknoten.me/-br3Vey7Wu4NBfiBX37qzQ3WxpA/2dPqfjEKoUPEU/httpupload.py
  60. tmolitor asterix: when I write a message containing the link manually I get kicked, too
  61. Asterix tmolitor: hmmm too long work probably ...
  62. Asterix tmolitor: hmmm too long word probably ...
  63. tmolitor asterix: no, it's just a link, the link I send just a moment ago...
  64. tmolitor asterix: oh sorry...I read "work" instead of "word" :D
  65. tmolitor asterix: yes, that could be the case...
  66. arune tmolitor, in the new version, the same issue in the new btw
  67. tmolitor arune: please try to use this: with open(path_to_file, 'rb') as content_file:
  68. tmolitor maybe the next char in your sample images is a newline and that's the reason the data is cut at this point...because windows reads the file as text and not as binary...
  69. tmolitor the "b" after the "r" should make it a binary read...
  70. arune tmolitor, that did fix the reading of the file! great
  71. arune but there's another issue...
  72. tmolitor arune: what issue? :) lets fix it, too :)
  73. arune I'm not sure :)
  74. arune the image posted in the muc is just white
  75. arune and very small maybe
  76. arune and this is the log...
  77. arune 2015-10-06 21:27:12 (I) gajim.plugin_system: Saving temporary jpeg image to 'c:\users\anru\appdata\local\temp\gajim_httpupload_scaled_tmpqsj1tz.jpeg'... 2015-10-06 21:27:12 (I) gajim.plugin_system: thumbnail jpeg quality 100 produces an image of size 386... 2015-10-06 21:27:12 (I) gajim.plugin_system: Using thumbnail jpeg quality 100 (image size: 386 bytes)
  78. tmolitor arune: oh...that's strange...small in pixels or small in bytes? small in bytes would make sense...because encoding just a white image in jpeg is very effective...
  79. tmolitor arune: it is using the gtk resize variant?
  80. tmolitor arune: there should be something like this in the logs then: "PIL not available, using GTK for image downsampling"
  81. arune AHA, there is another open(temp_file, 'r')
  82. tmolitor arune: yes...there are two of them ;) one for the initial image and one for the downsampled file...
  83. tmolitor and the pil branch of the code has one, too...
  84. arune IT WORKS!
  85. tmolitor well, no...the pil code doesn't use a temporary file, sorry...
  86. tmolitor great!!
  87. tmolitor arune: does pil work under windows also?
  88. arune tmolitor, no, I pasted the backtrace like 1 or 2 hours ago
  89. arune tmolitor, https://conference.gajim.org:5281/pastebin/7e6f084c-a665-4386-9c79-81c942ae71e6
  90. tmolitor arune: oh, okay...I don't know if I added the demandimport config correctly in the last version...
  91. tmolitor there should be something like "demandimport.ignore += ['builtins', '__builtin__', 'PIL']"
  92. tmolitor otherwise the detection of pil is not working correctly...
  93. tmolitor arune: please try again with the new version...
  94. arune right, https://trac-plugins.gajim.org/browser/httpupload/httpupload.py
  95. arune installing gajim with pil again
  96. tmolitor arune: yes, that could be the cause for your trace 2 hours ago...
  97. tmolitor arune could you test it with this version?
  98. tmolitor https://xmpp-upload.datenknoten.me/-br3Vey7Wu4NBfiBX37qzQ3WxpA/2TZ1GRhb1f17h/httpupload.py
  99. arune tmolitor, testing
  100. tmolitor arune: thanks for your help by the way!!!
  101. arune what... Traceback (most recent call last): File "src\dialogs.py", line 1488, in on_dialog_response File "src\dialogs.py", line 4769, in on_ok File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 393, in on_file_dialog_ok if not is_supported or true: NameError: global name 'true' is not defined
  102. tmolitor arune: oh, sorry...I tested something...one moment...
  103. tmolitor https://xmpp-upload.datenknoten.me/-br3Vey7Wu4NBfiBX37qzQ3WxpA/0sPgm6f7N9JH9/httpupload.py
  104. tmolitor arune: this should work :)
  105. arune (I think I've restarted gajim like 20 times within an hour or so)
  106. tmolitor (wow, that's a lot :D )
  107. arune works but 2015-10-06 21:50:39 (I) gajim.plugin_system: PIL not available, using GTK for image downsampling
  108. tmolitor that's strange...could you try to set pil_available = True in line 22?
  109. arune testing
  110. arune tmolitor, nope: Traceback (most recent call last): File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 310, in upload_complete thumb = Image.open(path_to_file) NameError: global name 'Image' is not defined
  111. Asterix faixh: I merged diff from upstream
  112. bot RSS: Feeds for Gajim Plugins • Changeset [692:bbf3c1708352]: merge patches from upstream merge patches from upstream https://trac-plugins.gajim.org/changeset/bbf3c1708352d0f3b576291bd83eb059cf4e7c2b
  113. tmolitor arune: oh :( well...it seems like PIL is not available...
  114. arune yes, I think we will have to live with gtk on windows
  115. arune gtk resize
  116. tmolitor arune: could you substitute this: try: from PIL import Image pil_available = True except: pil_available = False with a simple import?
  117. Asterix no, we should be able to have PIL
  118. Asterix I am able to import Image on my dev machine
  119. tmolitor arune: when there is no try except around it you should get a more descriptive backtrace...
  120. arune tmolitor, what is an simple import?
  121. Link Mauve Hasn’t PIL been replaced with Pillow for a l
  122. Link Mauve Hasn’t PIL been replaced with Pillow for a long time?
  123. tmolitor arune: this: from PIL import Image
  124. tmolitor Link Mauve, yes, but the lib still is named PIL ;)
  125. Link Mauve Oh ok.
  126. arune tmolitor, actually, I get no backtrace, but the plugin doesn't seem to be loaded (no upload buttons)
  127. tmolitor arune: it should produce a backtrace immediately when you start gajim
  128. tmolitor arune: or when you activate the previously deactivated plugin
  129. arune it is'nt even listed in the plugin manager
  130. tmolitor arune: well, that is because of the failed PIL import
  131. tmolitor arune: under linux I get a backtrace in the console when I start gajim with a not working import in the plugin
  132. Asterix under win, isn't it in AppData\Roaming\Gajim\xxx.log?
  133. Asterix gajim.log or gajim.exe.log?
  134. arune Asterix, not the backtraces, they pop up
  135. arune the actual log goes in a file yes
  136. arune now I placed the import just in the function that needs PIL and get a backtrace:
  137. arune Traceback (most recent call last): File "C:\Users\anru\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 290, in upload_complete from PIL import Image File "src\common\demandimport.py", line 95, in _demandimport File "c:\python27\lib\site-packages\PIL\Image.py", line 66, in <module> File "src\common\demandimport.py", line 95, in _demandimport File "ExtensionLoader_PIL__imaging.py", line 22, in <module> File "ExtensionLoader_PIL__imaging.py", line 21, in __bootstrap__ ImportError: No module named None
  138. tmolitor ar​une: what import statement is in c:\python27\lib\site-packages\PIL\Image.py", line 66?
  139. tmolitor this has to be added to the demandimport ignore list, too...
  140. Asterix from PIL import _imaging as core
  141. tmolitor arune: and if it still fails afterwards, the next failing import has to be added also...until it works...
  142. tmolitor okay...
  143. tmolitor then add PIL._imaging to the ignroe list...
  144. tmolitor asterix: could demandimport be disabled for the httpupload plugin?
  145. arune adding PIL._imaging did not help
  146. arune and can't find any python27-folder on the windows computer
  147. tmolitor arune: ask asterix where this folder should be when gajim is installed using the windows installer...
  148. tmolitor arune: you could search for Image.py also...
  149. Asterix in library.zip
  150. arune and that contains a bunch of pyc files :/
  151. arune I'm off to bed. Thanks guys! great work!
  152. tmolitor arune: ok, sleep well and thanks for your help!
  153. tmolitor asterix: could we simply disable demandimport for the complete plugin?
  154. tmolitor asterix: qould be nice if we could fix this pil thing on windows...