Re: [Zim-wiki] Custom plugins installation

2015-07-08 Thread Güven , Ugur Murat
Hi Jakub,

thank you for the update. Please let me summarize my findings (as a Windows 8.1 
64 Bit User) so far:


· I downloaded and installed Graphviz for Windows from 
http://www.graphviz.org : ok

· You need to add the Graphviz bin path to the PATH variable, which is 
mentioned on the download page for Graphviz: ok

· Double check with Diagram plugin if Graphviz works: ok

· I installed pydot with easy_install.exe: ok

· pydot issues:

o   import pydot does not work, therefore you can’t enable the plugin in Zim

o   Found this: 
http://stackoverflow.com/questions/15951748/pydot-and-graphviz-error-couldnt-import-dot-parser-loading-of-dot-files-will

o   Uninstalled pyparsing and installed older version

o   import pydot works: ok

· When I start your plugin, I get the same Dialog as for the 
diagrameditor.: ok

o   Trying to Preview gives following errors:

§  global name ‘pydot’ is not defined -- somehow the import pydot did not work
Did a manual ‘import pydot’ in Python interpreter: ok

§  Added Import pydot to the import statements: ok

· If I’m not mistaken, you need Graphviz as well. Therefore I suggest 
to change the check_dependencies method slightly like following:
 @classmethod
  def check_dependencies(klass):
 has_dotcmd = Application(dotcmd).tryexec()
 has_dotmod = True
 try:
import pydot
 except ImportError:
has_dotmod = False
 return (has_dotmod and has_dotcmd), \
[(pydot, has_dotmod, True), (GraphViz, has_dotcmd, True)]


· Finally your plugin worked and looks great!

· I found following issue:

o   If you add a blank line without adding anything (but with a tab), you get 
an error ‘InvocationException’ -- syntax error in line 10 near ‘[‘
maybe you want to make sure that there is not empty line with a tab

Please find attached the modified version.

Thank you for this very nice plugin!

Regards,
Murat



From: Zim-wiki 
[mailto:zim-wiki-bounces+murat.gueven=ts.fujitsu@lists.launchpad.net] On 
Behalf Of NorfCran
Sent: Mittwoch, 8. Juli 2015 00:47
To: Alessandro La Fauci
Cc: zim-wiki@lists.launchpad.net
Subject: Re: [Zim-wiki] Custom plugins installation

Dear All,
I have tried to adjust the plugin and tested on Window 8.1 and Linux Debian 
(Jessie) with ZIM-Wiki version 0.63 (source) and Python 2.7. There was an issue 
with the text variable passed and import of pydot module caused that the plugin 
was not present on the list since it failed on import. The plugin is available 
from a BUG page https://bugs.launchpad.net/zim/+bug/1472408 as a file 
(suggested by Murat Güvenhttps://launchpad.net/%7Emurat-gueven), the plugin 
page has been also updated with a link to the plugin.

It was slightly complicated to install the module pydot on Windows machine, but 
easy_install utility limited the procedure to few lines:
Firstly I downloaded the installation script of easy_install from 
https://bootstrap.pypa.io/ez_setup.py and executed with installed python 2.7 
compiler. The installation script is described in more details on 
https://pypi.python.org/pypi/setuptools. Secondly the dydot can be installed by 
the following command:
C:\Python27\Scripts\easy_install.exe pydot
With Linux it was simple, the Debian repository provides python-pydot package, 
which can be installed through command:
# apt-get install python-pydot

After all the ZIM-Wiki running from code should provide the treemap plugin on 
the list of plugins and it should be possible to activate it as far as 
dependencies are fulfilled.
Hope this helps.
All the best,
Jakub


On 2 July 2015 at 23:13, NorfCran 
norfc...@gmail.commailto:norfc...@gmail.com wrote:
Dear Jaap and Alessandro,
I have tried to test the plugin against ZIM versio 0.62 and it failed with the 
following error:

INFO: This is zim 0.62
DEBUG: Python version is sys.version_info(major=2, minor=7, micro=6, 
releaselevel='final', serial=0)
...
ERROR: Could not generate image
Traceback (most recent call last):
  File /usr/lib/pymodules/python2.7/zim/plugins/base/imagegenerator.py, line 
338, in generate_image
imagefile, logfile = self.generator.generate_image(text)
  File /home/norfcran/.local/share/zim/plugins/treemapeditor.py, line 69, in 
generate_image
text = text.split(\n)
AttributeError: 'list' object has no attribute 'split'

On the other other hand ZIM version 0.63 generates the graph image correctly. 
It seems that the text variable is a string in 0.63 instead of a list in 0.62,
therefore I have changed it to split the text with the up to date version of 
the plugin suitable for ZIM version 0.63.
Furthermore the plugin depends on python-pydot package.
All the best,
Jakub


On 28 June 2015 at 21:10, Jaap Karssenberg 
jaap.karssenb...@gmail.commailto:jaap.karssenb...@gmail.com wrote:
Hi Alessandro,
Sounds like you installed the plugin correctly. The fact that the .pyc file 
is created shows that zim tries to load the plugin. However if it does

Re: [Zim-wiki] Custom plugins installation

2015-06-29 Thread Güven , Ugur Murat
Hi NorfCran,

I was going to try out your plugin as well, but it does not work if you 
copy/paste from the wiki page due to wrong indentation as you stated.
I must admit that I’m too lazy to correct each line. Or do you have a quick 
procedure on how to correct wrong indentation?

May be you can provide the plugin in the manner I provided my plugins? See this 
as an example:
https://github.com/jaap-karssenberg/zim-wiki/wiki/Autocompletion-Plugin


· First create a Feature request as a bug

· then attach the working py file to the bug

· Link to the file in the wiki page

I was wondering if your plugin could be used to display the relation of pages 
to each other (not that I have a concrete use case out of it, just
out of curiosity how that picture could look like).

Regards,
Murat


From: Zim-wiki 
[mailto:zim-wiki-bounces+murat.gueven=ts.fujitsu@lists.launchpad.net] On 
Behalf Of NorfCran
Sent: Montag, 29. Juni 2015 00:46
To: Alessandro La Fauci
Cc: zim-wiki@lists.launchpad.net
Subject: Re: [Zim-wiki] Custom plugins installation

Dear Alessandro,
it is great to have a feedback from somebody, who intends to use the plugin. I 
personally used mainly the custom tool and made a conversion of the custom tool 
to the native plugin. I have identified and fixed the issue, tested the plugin 
and it should work correctly now. Please be sure that you paste the code from 
the wiki 
pagehttps://github.com/jaap-karssenberg/zim-wiki/wiki/TreeMap-plugin-%28converted-Text2mindmap-custom-tool%29
 and there is a right indentation (Python is sensitive to mixed tabs and 
spaces). I use very up to date version of ZIM-Wiki 0.63 from PPA. Please let me 
know, if there is still an issue and I will try to solve it for you.
All the best,
NorfCran

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] Custom plugins installation

2015-06-28 Thread Jaap Karssenberg
Hi Alessandro,

Sounds like you installed the plugin correctly. The fact that the .pyc
file is created shows that zim tries to load the plugin. However if it does
not show up, there may be an error in the plugin that prevents it from
loading.

Try running zim with zim -D to get debug output and open the preferences
window. The error while loading the plugin should show up there.

Regards,

Jaap


On Wed, Jun 24, 2015 at 10:57 AM, Alessandro La Fauci alafa...@yahoo.it
wrote:

 Dear Zim team,

 I would really like to install and use the TreeMap plugin published on
 this page

 https://github.com/jaap-karssenberg/zim-wiki/wiki/Plugins

 I saved and put the code in folder ~/.local/share/zim/plugins , the file
 is saved as tremapeditor.py. After starting Zim i found another file in
 the same directory called tremapeditor.pyc.

 Nevertheless the plugin doesn't appear under preferences  plugins, and I
 can't see any new option in all the other menus.

 What should I do to correctly install this plugin.

 Thank you in advance

 Cheers

 A



 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] Custom plugins installation

2015-06-28 Thread NorfCran
Dear Alessandro,

it is great to have a feedback from somebody, who intends to use the
plugin. I personally used mainly the custom tool and made a conversion of
the custom tool to the native plugin. I have identified and fixed the
issue, tested the plugin and it should work correctly now. Please be sure
that you paste the code from the wiki page
https://github.com/jaap-karssenberg/zim-wiki/wiki/TreeMap-plugin-%28converted-Text2mindmap-custom-tool%29
and there is a right indentation (Python is sensitive to mixed tabs and
spaces). I use very up to date version of ZIM-Wiki 0.63 from PPA. Please
let me know, if there is still an issue and I will try to solve it for you.

All the best,
NorfCran


On 28 June 2015 at 21:10, Jaap Karssenberg jaap.karssenb...@gmail.com
wrote:

 Hi Alessandro,

 Sounds like you installed the plugin correctly. The fact that the .pyc
 file is created shows that zim tries to load the plugin. However if it does
 not show up, there may be an error in the plugin that prevents it from
 loading.

 Try running zim with zim -D to get debug output and open the preferences
 window. The error while loading the plugin should show up there.

 Regards,

 Jaap


 On Wed, Jun 24, 2015 at 10:57 AM, Alessandro La Fauci alafa...@yahoo.it
 wrote:

 Dear Zim team,

 I would really like to install and use the TreeMap plugin published on
 this page

 https://github.com/jaap-karssenberg/zim-wiki/wiki/Plugins

 I saved and put the code in folder ~/.local/share/zim/plugins , the file
 is saved as tremapeditor.py. After starting Zim i found another file in
 the same directory called tremapeditor.pyc.

 Nevertheless the plugin doesn't appear under preferences  plugins, and I
 can't see any new option in all the other menus.

 What should I do to correctly install this plugin.

 Thank you in advance

 Cheers

 A



 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp



 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp