[Zim-wiki] test error under root
I know, I know I'm not supposed to run anything under root... but I have to use zim under root, and up to v0.50 no problem was ever present. Now unfortunately the new zim fails me during test: ... Test File object ... FAIL ... ... Test TagsPageTreeStore index interface ... ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_ref_node: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_iter_has_child: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_ref_node: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_iter_has_child: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_ref_node: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_iter_has_child: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_ref_node: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_iter_has_child: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_ref_node: assertion `VALID_ITER(iter, tree_model)' failed ** (test.py:3426): CRITICAL **: pygtk_generic_tree_model_iter_has_child: assertion `VALID_ITER(iter, tree_model)' failed ok Test Equation Editor plugin ... ok Test Diagram Editor plugin ... ok == FAIL: Test File object -- Traceback (most recent call last): File /usr/src/zim-0.51/tests/fs.py, line 189, in testFile self.assertRaises(FileWriteError, file.write, 'Overwritten!') AssertionError: FileWriteError not raised -- Ran 139 tests in 28.939s FAILED (failures=1) The Test File Object doesnt fail instead when test-ing as a normal user. The pygtk_generic_tree_model* errors are instead present both for the normal user and for root. I am under Fedora FC13, gtk2 version 2.20 python version 2.6.4 pygtk2 version 2.17.0 pygobject2 version 2.21.6 pyxdg version 0.17 xdg-utils version 1.0.2 alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] writing plugins
On 02/10/2011 10:07 AM, s...@z107.de wrote: Hi alessandro, you could post the code of your plugin, then it would be easier to identify your bug. It sound as if a File object is expected somewhere but None is returned and the basename function fails. Does the preview function display your plot correctly? I get the same exception (with the gnu_r_plugin), when I enter incorrect R code, press OK and close the following 'An error occured...' dialog with yes. best regards, stefan On Thu, Feb 10, 2011 at 09:13:00AM +0100, Alessandro Magni wrote: hi people, it is a bit of time since I'm thinking about trying to write some simple plugin - to start with, I wanted to try with aninsert GNUplot plot, since I prefer GNUplot in place of R. I read in the manual to check the HACKING directory, and I tried to follow the code in gnu_r_ploteditor.py to take it as example. I don't know if it is me, but I probably lack a good understanding of the basics. I have in gnuplot_ploteditor.py three classes (InsertGNUPlotPlugin, InsertPlotDialog, PlotGenerator), I have a template _gnuplot.gnu in place, and I have basically changed gnu_r_ploteditor.py as less as possible, just to call gnuplot instead of R. In Zim I have now a Insert-GNUplot option, which calls up an insert window. But any code I use inside it returns a Looks like you found a bug window, telling me AttributeError: 'NoneType' object has no attribute 'basename' Of course you have better things to do than lead me by the hand thru Python development, but - since the HACKING folder is a bit lacking - could you tell me exactly what is expected from a zim plugin, in terms of defined classes etc? Also, what you do suggest as tricks to debug it? Thank you! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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 well, I'm glad you asked! Here it is ... # -*- coding: utf-8 -*- # # gnuplot_ploteditor.py # # This is a plugin for Zim, which allows inserting GNUplot scripts to # have Zim generate plots from them. # # Author: Alessandro Magni ma...@inrim.it # Date: 2010-10-12 # Copyright (c) 2010, released under the GNU GPL v2 or higher # # import gtk import glob from zim.fs import File, TmpFile from zim.plugins import PluginClass from zim.config import data_file from zim.templates import GenericTemplate from zim.applications import Application from zim.gui.imagegeneratordialog import ImageGeneratorDialog # TODO put these commands in preferences gnuplot_cmd = ('gnuplot',) ui_xml = ''' ui menubar name='menubar' menu action='insert_menu' placeholder name='plugin_items' menuitem action='insert_gnuplot'/ /placeholder /menu /menubar /ui ''' ui_actions = ( # name, stock id, label, accelerator, tooltip, read only ('insert_gnuplot', None, _('GNUPlot...'), '', '', False), # T: menu item for insert plot plugin ) class InsertGNUPlotPlugin(PluginClass): plugin_info = { 'name': _('Insert GNUPlot'), # T: plugin name 'description': _('''\ This plugin provides a plot editor for zim based on GNUPlot. '''), # T: plugin description 'help': ':Plugins:GNUPlot Editor', 'author': 'Alessandro Magni', } @classmethod def check_dependencies(klass): return [('GNUPlot',Application(gnuplot_cmd).tryexec())] def __init__(self, ui): PluginClass.__init__(self, ui) if self.ui.ui_type == 'gtk': self.ui.add_actions(ui_actions, self) self.ui.add_ui(ui_xml, self) self.register_image_generator_plugin('gnuplot') def insert_gnuplot(self): dialog = InsertPlotDialog.unique(self, self.ui) dialog.show_all() def edit_object(self, buffer, iter, image): dialog = InsertPlotDialog(self.ui, image=image) dialog.show_all() def do_populate_popup(self, menu, buffer, iter, image): menu.prepend(gtk.SeparatorMenuItem()) item = gtk.MenuItem(_('_Edit GNUPlot')) # T: menu item in context menu item.connect('activate', lambda o: self.edit_object(buffer, iter, image)) menu.prepend(item) class InsertPlotDialog(ImageGeneratorDialog): def __init__(self, ui, image=None): generator = PlotGenerator() ImageGeneratorDialog.__init__(self, ui, _('GNUPlot'), # T: dialog title generator, image
Re: [Zim-wiki] writing plugins
hi Stefan, thank you for your help - I had already a _gnuplot.gnu in /usr/share/zim/templates, I just forgot to tell you! I tried substituting it with yours, but no hope: the error remains the same. Checked permissions also, and they're ok... alessandro On 02/10/2011 02:06 PM, s...@z107.de wrote: Hi alessandro, (sorry for the PM, last mail should go to the mailinglist) your code seems to be ok. But you need a template to the gnuplot code in data/templates/_gnuplot.gnu. I attached a template[1] that should work. best regards, stefan [1] I do not know gnuplot, maybe there are better commands to produce a png file. On Thu, Feb 10, 2011 at 01:30:16PM +0100, Alessandro Magni wrote: On 02/10/2011 10:07 AM, s...@z107.de wrote: Hi alessandro, you could post the code of your plugin, then it would be easier to identify your bug. It sound as if a File object is expected somewhere but None is returned and the basename function fails. Does the preview function display your plot correctly? I get the same exception (with the gnu_r_plugin), when I enter incorrect R code, press OK and close the following 'An error occured...' dialog with yes. best regards, stefan On Thu, Feb 10, 2011 at 09:13:00AM +0100, Alessandro Magni wrote: hi people, it is a bit of time since I'm thinking about trying to write some simple plugin - to start with, I wanted to try with aninsert GNUplot plot, since I prefer GNUplot in place of R. I read in the manual to check the HACKING directory, and I tried to follow the code in gnu_r_ploteditor.py to take it as example. I don't know if it is me, but I probably lack a good understanding of the basics. I have in gnuplot_ploteditor.py three classes (InsertGNUPlotPlugin, InsertPlotDialog, PlotGenerator), I have a template _gnuplot.gnu in place, and I have basically changed gnu_r_ploteditor.py as less as possible, just to call gnuplot instead of R. In Zim I have now a Insert-GNUplot option, which calls up an insert window. But any code I use inside it returns a Looks like you found a bug window, telling me AttributeError: 'NoneType' object has no attribute 'basename' Of course you have better things to do than lead me by the hand thru Python development, but - since the HACKING folder is a bit lacking - could you tell me exactly what is expected from a zim plugin, in terms of defined classes etc? Also, what you do suggest as tricks to debug it? Thank you! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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 -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] writing plugins
Jaap, Stefan, thank you for your help. Running zim with -D (which I knew, but I forgotten about!) did the trick... funny, it wasnt a python error but a stupid gnuplot error - I inserted as a test exp(x) instead of a plot exp(x): zim -D showed the error immediately. Well, the plugin works - if anybody is interested! thank you for your help, again alessandro On 02/10/2011 03:29 PM, Jaap Karssenberg wrote: On Thu, Feb 10, 2011 at 9:13 AM, Alessandro Magnima...@inrim.it wrote: But any code I use inside it returns a Looks like you found a bug window, telling me AttributeError: 'NoneType' object has no attribute 'basename' What you want to do is run zim with zim -D from a terminal, when the error happens it will spit out a stack trace that shows the exact line in the code were it goes wrong. On that line there is some parameter that is None but should probably contain a file object. Work back from that line to where that file should come from. (Btw. latest dev version / next release this stack trace will also be shown in the you found a bug dialog directly to make it a bit easier.) Hope this helps, Jaap -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] extension of screenshot plugin
NorfCran - thanks for the plugin, I installed it and works perfectly! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] memory of cursor position
hi people, I find it a bit annoying that Zim memorizes the cursor position of each page, so that returning to that page it repositions it there. There is any way (I didnt find it in Preferences) to disable it and put the cursor at the beginning of the page each time? As an alternative, where in the source could I find it, to manually disable it??? Thank you! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] Zim 0.49 released !
Though, I got a problem on my mac OSX 10.6.4 while opening editpreference I get Looks like you found a bug KeyError : text_editor hi Philippe, I am trying too to work with zim under OSX, and at the moment I find that what is not working is the setting of the applications to use for opening links, under Preferences-Applications: in my case just the web browser is set (Firefox), while the others are not set. As Jaap pointed out I guess we can edit ~/.config/zim/preferences.conf, but I dont know exactly what to put in there for the file browser. Can you post your preferences.conf so that I can compare it with mine? thanks! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] Zim 0.49 released !
works great here too (Fedora FC13)! I just had some problems/errors during test.py: WARNING: Filesystem encoding is set to ASCII or Latin1, using UTF-8 instead ... Test File object ... FAIL ... Test we get a proper index for files store ... ERROR Test moving and deleting pages in the files store ... ERROR ... runTest (tests.notebook.TestGetNotebook) ... ERROR ... == ERROR: Test we get a proper index for files store -- Traceback (most recent call last): File /usr/src/zim-0.49/tests/stores.py, line 278, in setUp tmpdir = tests.create_tmp_dir(u'stores_TestFiles_\u0421\u0430\u0439') File /usr/src/zim-0.49/tests/__init__.py, line 61, in create_tmp_dir dir = dir.encode(sys.getfilesystemencoding()) UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-29: ordinal not in range(128) == ERROR: Test moving and deleting pages in the files store -- Traceback (most recent call last): File /usr/src/zim-0.49/tests/stores.py, line 278, in setUp tmpdir = tests.create_tmp_dir(u'stores_TestFiles_\u0421\u0430\u0439') File /usr/src/zim-0.49/tests/__init__.py, line 61, in create_tmp_dir dir = dir.encode(sys.getfilesystemencoding()) UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-29: ordinal not in range(128) == ERROR: runTest (tests.notebook.TestGetNotebook) -- Traceback (most recent call last): File /usr/src/zim-0.49/tests/notebook.py, line 28, in runTest root = Dir(tests.create_tmp_dir(u'notebook_TestGetNotebook_\u0421\u0430\u0439')) File /usr/src/zim-0.49/tests/__init__.py, line 61, in create_tmp_dir dir = dir.encode(sys.getfilesystemencoding()) UnicodeEncodeError: 'ascii' codec can't encode characters in position 35-37: ordinal not in range(128) == FAIL: Test File object -- Traceback (most recent call last): File /usr/src/zim-0.49/tests/fs.py, line 188, in testFile self.assertRaises(FileWriteError, file.write, 'Overwritten!') AssertionError: FileWriteError not raised -- Ran 103 tests in 19.532s FAILED (failures=1, errors=3) ... but simply ignoring them, and installing anyway, zim works perfectly! and boys - it is much faster!!! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] sync problems - state of the art
Hi people, I read in http://www.zim-wiki.org/wiki/doku.php?id=resolving_syncing_conflicts about the ideas to resolve sync conflicts, to allow multiple users to use Zim. What is not clear to me is what happens *now* in that regard, in our current version. I ask because with my DMS utility (http://www.zim-wiki.org/wiki/doku.php?id=directory_documentation) I'd like to work with Zim constantly open - while in the background the zimDMS script updates the wiki structure. In fact instead I exit from Zim every evening, since I dont know what would happen if the wiki would change while Zim is open (and frankly I prefer not to have surprises with more than 4000 wiki pages!). alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] background color
not being one who surrenders without fighting, here is how to customize your Zim window colors. 1) customize a GTK style in my Fedora system they are at /usr/share/themes . I chose Simple; edit the colors in the gtkrc file, while previewing the theme: I use the gtk-chtheme application 2) to avoid applying this theme to every running GTK app, you have to launch Zim this way: env GTK2_RC_FILES=/usr/share/themes/Simple/gtk-2.0/gtkrc zim zimbookfile 3) you will still have clashing colors, specially for links, headers... you will set those by editing /root/.config/zim/style.conf enjoy! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] Wiki-Format string
hello people, I wan looking for a way to distinguish the nodes created by my script zimDMS. Can I modify the string Wiki-Format: zim 0.4 to something like Wiki-Format: zim 0.4 zimDMS ... or do I risk ruining something? alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] applications preferences
[I realize that I'm really hammering the mailing list these days... sorry!] Hi people, I am trying to customize better my Zim experience, and I was trying to change the app called on directory links: I'd prefer konqueror, for example, or also a terminal with Midnight Commander - why not? I discovered instead that I'm stuck with one choice only (File Browser: default(xdg)), which launches Dolphin - which I hate. How to customize it? I remember you that I work on KDE... alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] background color
after the answers I received - and the checks I made, I see that it is impossible - by construction - to change the background window color / font color, without changing it in all the GTK apps running, e.g. Firefox, Thunderbird etc, as a change of theme. I have to say that this is a very strong limit, so if I can strike a blow in favor of a new customization option in the next versions, it would be this: not to rely on the GTK theme engine, if it is possible at all. alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] python script to document a folder structure: added to the Wiki
read about it, in section TipsTricks. alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] spaces in nodes
seems to me from a quick search that this has been extensively discussed in the past, so sorry, but I wanted a definitive answer (not to recode everythin twice!). Writing my crawler (zimDMS), I automatically generated a lot of nodes that I saw zim sees as grayed-out. So I believe that, for Zim, any nodefile (.txt) and any related subdirectory has the replacement ' ' - '_', is it correct? If possible I'd like to know moreover: a) this is so just in the immediate - or you believe Zim will stick to it? b) any other custom modification in the link names that I should be aware of? Remember, I generate links on the fly starting from directory names! thanks! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] python script to document a folder structure
I've just finished a very small python script that - given as argument a given folder X - will create a Zim tree mapped on it. By this I mean that for each subfolder of X there will exist a corresponding zim node. I'm using it in crontab running it to constantly checking X, so that if any subtree is added/deleted to/from X, the zim hierarchy of pages will correspondingly be updated. As I mentioned in past posts, I use it to extensively document my very large work directory (X), inserting comments/images in any node of the zim wiki. I dont know if it can be of interest to others (and I'd like to mention that I learned python just 1 week ago, please be kind to me...), so let me know! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] newbie here: info request (for import)
Hi Thosrsten, thanks for the input! It is great news for me that it is possible to have zim-files disseminated around the filesystem... unfortunately I believed it impossible, so I already wrote down my crawler program that puts all the files in a unique directory. It is still a bit rough, but I hope to have it polished in a few days - if it could interest anybody I'll gladly post it here. What worries me about your approach is that it involves changing the Zim program itself, so I fear it could result incompatible in the event of a Zim upgrade - unless the developers hear our call for help and make it available as an option in the program itself. If I may ask, are you using this trick for my same need (i.e. to have an hypertext self-commenting directory structure)? thanks! alessandro Am Montag, den 20.09.2010, 16:51 +0200 schrieb Jaap Karssenberg: On Mon, Sep 20, 2010 at 11:04 AM, Alessandro Magnima...@ wrote: Thank you for your help! I want to ask a further question, though I fear the answer will be no: since the files we are mentioning should be one related to each folder, my ideal situation would be to have one of those positioned at each folder. I fear for now Zim keeps them instead positioned in one unique root folder - there is some workaround possible? I had the same problem here and I simply made 3 changes in zim/stores/files.py add at beginning of file: import os line 53: old: filepath = encode_filename(name)+'.txt' # FIXME hard coded extension new: filepath = encode_filename(name)+'.'+os.sep+'README.txt' # dirty hack line 83: old: elif file.endswith('.txt'): # TODO: do not hard code extension new: elif file.endswith('.'+os.sep+'README.txt'): # dirty hack Now all my page contend is stored in the files README.txt in directories named after the pages. Maybe you will get Problems when renaming pages... I tried to create my own zim/stores/filesindirs.py with a configurable file name, but it looks like there is no way to tell zim to use the new storage(?). regards -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] newbie here: info request (for import)
On 09/22/2010 12:31 PM, Jaap Karssenberg wrote: On Wed, Sep 22, 2010 at 11:37 AM, Alessandro Magnima...@inrim.it wrote: REALLY??? wow, I'm very sorry you spent time for a misunderstanding of mine... but I never saw around any zim hierarchical notebook. Did I miss it in the wiki? I will check ASAP - if it is as I seem to understand from your help, I guess it should solve many problems ... No problem, maybe I should dedicate a section in the manual to explaining the directory structure. You are not the first to miss that zim can do hierarchies. Do you have suggestions how to make this feature more discoverable ? Where would you typically look for something like that? Regards, Jaap A straightfoward way would be to include in the TAR file of the install a demo directory with nested folders where a demo notebook would reside. I rechecked and saw that in fact the manual itself is a hierarchical zim-file. So you could simply point the user to this fact, something like just check where this manual is saved, how easy it is to have a hierarchical wiki! Damn, after playing a bit with it, I fear I'll be unable to use this feature for my use (self-documenting directories). The reason is that Zim takes control of any .txt file it finds, inserting its own header at the beginning. In many places around my filesystem I cannot allow it to do it, there are txt files that must not be changed (lucky me that I tested it in a small subfolder first!) alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] newbie here: info request (for import)
Hi! After a bit of python-learning, I wrote my script. It nicely crawls a given subtree, and generates all the Zim-files in a common directory. Each file has the correct syntax (see example appended), with links to childrenparents. I've still a point I dont understand concerning the ability of Zim to recognize my structure: 1) if I start zim by itself, it gives me this warning on the command line: WARNING: Filesystem encoding is set to ASCII or Latin1, using UTF-8 instead, and a warning box with Upgrade Notebook? This notebook was created by an older of version of zim 2) if I do as you suggest, zim --index . , I got 2 warnings on the command line: WARNING: Filesystem encoding is set to ASCII or Latin1, using UTF-8 instead\nWARNING: This notebook needs to be upgraded to the latest data format, and when I start zim I have however the Upgrade Notebook? warning box. So, I do not see the point of doing zim --index . Also, what'sup with the encoding? They are plain text files, as you can see, e.g.: $ cat campostela.txt Content-Type: text/x-zim-wiki Wiki-Format: zim 0.4 Creation-Date: 2010-09-21T15:11:44.575864 == /0ale/Archive/nastri/campostela == Created Tuesday 21 September 2010 __ PARENT NODES [[nastri|/0ale/Archive/nastri]] CHILDREN NODES [[co67|/0ale/Archive/nastri/campostela/co67]] [[co71|/0ale/Archive/nastri/campostela/co71]] [[results|/0ale/Archive/nastri/campostela/results]] thanks for any help... alessandro On 09/17/2010 05:31 PM, Jaap Karssenberg wrote: On Fri, Sep 17, 2010 at 3:58 PM, Alessandro Magnima...@inrim.it wrote: sorry if it's the wrong place to ask: I just discovered this wiki and find it very promising for what I'd like to do - a simple way to manage my workplace. My problem - and I'd like to know if Zim can solve it - is to take my workplace, i.e. my work directory structure, and in some way import into the wiki, in such a way that for each folder in my directory structure I would have a Zim node. I really cannot do it manually, since my folder structure is a child of many years of work, and the current output of: find /0ale/ -type d | wc gives me 11875 folders :-) As you mention zim uses plain text files for the pages. However there is a header of a few lines on the top of each file. You can do two things 1) Just put all text files in a folder and open that folder as a zim notebook. Zim will miss config files and prompt you to update the notebook. Doing so will add headers to all text files. The disadvantage is that for such a large structure this may take a long time and maybe not so easy to check progress. 2) First create an empty notebook and than add files using a small script to add the headers. Advantage is that you control the process. Disadvantage is that you need to do a bit hacking yourself. Couple of notes that may apply for both cases: * To avoid waiting a long time for the index to build you can run zim --index /path in the terminal to rebuild a sane index of all files. * Any character sequences in your files that conflict with the zim wiki syntax may have unforseen results Of course it is wise to have backups when you try this, I would also advise to put the zim notebook under version control before importing the data, so it is easier to track and rollback small errors. Hope this helps, Jaap -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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] newbie here: info request (for import)
On 09/17/2010 05:31 PM, Jaap Karssenberg wrote: On Fri, Sep 17, 2010 at 3:58 PM, Alessandro Magnima...@inrim.it wrote: sorry if it's the wrong place to ask: I just discovered this wiki and find it very promising for what I'd like to do - a simple way to manage my workplace. My problem - and I'd like to know if Zim can solve it - is to take my workplace, i.e. my work directory structure, and in some way import into the wiki, in such a way that for each folder in my directory structure I would have a Zim node. I really cannot do it manually, since my folder structure is a child of many years of work, and the current output of: find /0ale/ -type d | wc gives me 11875 folders :-) As you mention zim uses plain text files for the pages. However there is a header of a few lines on the top of each file. You can do two things 1) Just put all text files in a folder and open that folder as a zim notebook. Zim will miss config files and prompt you to update the notebook. Doing so will add headers to all text files. The disadvantage is that for such a large structure this may take a long time and maybe not so easy to check progress. 2) First create an empty notebook and than add files using a small script to add the headers. Advantage is that you control the process. Disadvantage is that you need to do a bit hacking yourself. Couple of notes that may apply for both cases: * To avoid waiting a long time for the index to build you can run zim --index /path in the terminal to rebuild a sane index of all files. * Any character sequences in your files that conflict with the zim wiki syntax may have unforseen results Of course it is wise to have backups when you try this, I would also advise to put the zim notebook under version control before importing the data, so it is easier to track and rollback small errors. Hope this helps, Jaap Thank you for your help! I want to ask a further question, though I fear the answer will be no: since the files we are mentioning should be one related to each folder, my ideal situation would be to have one of those positioned at each folder. I fear for now Zim keeps them instead positioned in one unique root folder - there is some workaround possible? Though Python is not my language of choice, I could try to put some code together if it is possible at all... Anyway - after giving me a crash course on python during the weekend I feel rather confident I can work on it. I really think that if I could develop some kind of engine, it could benefit also the Zim project: what do you think? To recap my problem, having a large directory structure where I store all my work / personal projects / ideas / ... I'd like to organize all this, NOT by building some kind of network/wiki manually,slowly copying all my folder structure (really, it's thousands of folders, and they're already well organized), but in some way pointing the program to the root of my folder structure and letting it create a wiki structure isomorph to it, with a node at each folder - and links to children nodes (and possibly also to parents). I could edit each node whenever necessary to describe its content, writing down whatever I want. Most important, with some kind of cron job new nodes would automatically created/deleted with any structure change to my folders... This would create a kind of Document management system. All the DMSs I surveyed in recent days are mostly targeted to large, networked enterprises. Instead, there is nothing available for single users like me with a single machine overloaded with a large amount of data. any input is welcome... alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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
[Zim-wiki] newbie here: info request (for import)
sorry if it's the wrong place to ask: I just discovered this wiki and find it very promising for what I'd like to do - a simple way to manage my workplace. My problem - and I'd like to know if Zim can solve it - is to take my workplace, i.e. my work directory structure, and in some way import into the wiki, in such a way that for each folder in my directory structure I would have a Zim node. I really cannot do it manually, since my folder structure is a child of many years of work, and the current output of: find /0ale/ -type d | wc gives me 11875 folders :-) P.S. I just noticed that zim nodes are simple textfiles, so I tried inserting my info from the commandline, this way: perl -we 'open(F, complex.txt);foreach(@ARGV){print(F [[file://$_|$_]]\n)};close(F)' `find /0ale/excursions/digital/complex/ontologies/ -type d` where a zim-node complex was filled with the list of folders under /0ale/excursions/digital/complex/ontologies/. I'm just not sure if I can do it automatically... any help is really appreciated! alessandro -- ~~~ / Dr.Alessandro Magni \Electromagnetics Division /INRiM Strada delle Cacce 91, 10135 Torino (ITALIA) \Email ma...@inrim.it /Tel: 0039-011-3919821 Fax: 0039-011-3919834 \URL http://www.inrim.it/~magni / Our business in life is not to succeed but to continue to fail \ in high spirits. -- Robert Louis Stevenson ~~~ ___ 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