GNOME Bugzilla – Bug 153738
hebrew/gregorian date functions
Last modified: 2009-10-21 00:02:37 UTC
I've made a python plugin, that adds new functions for converting from/to hebrew and gregorian date systems, it may be of interst to others.
Created attachment 31939 [details] the plugin in a tar archive to use it a added it to ./configure.in and plugins/Makefile.am
Thanks. It "does something" for me. That's as far as I am able to test it. It's probebly best to distribute this outside of gnumeric (but that's Jody's call). You may consider replacing Makefile.am with an old fashioned Makefile. You'll lose internationalization, but get rid of the need autotools and intltools. User will have to set prefix and version before installing. Here's what the Makefile could look like: # Simple makefile to install a Python plugin for Gnumeric. # This is how you do it if you don't want autoconf & friends. Note: # no i18n. mkinstalldirs comes with the source of a lot of Gnu programs. prefix = /home/jk/gnome/test version = 1.3.91 gnumeric_plugindir = ${prefix}/lib/gnumeric/${version}/plugins installdir = ${gnumeric_plugindir}/py-hdate INSTALL = /usr/bin/install -c MKINSTALLDIRS = ./mkinstalldirs all: install: $(MKINSTALLDIRS) $(installdir) ${INSTALL} -m 644 py_hdate.py plugin.xml $(installdir) .PHONY: all install
Thank you, It is now in libhdate.sourceforge.net. I used this Makefile to guess the install dir, will this script work on systems other then my system, do I need to change it ? # Simple makefile to install a Python plugin for Gnumeric. # This is how you do it if you don't want autoconf & friends. Note: # no i18n. mkinstalldirs comes with the source of a lot of Gnu programs. prefix = /usr version = 1.3.91 gnumeric_plugindir = ${prefix}/lib/gnumeric/${version}/plugins installdir = ${gnumeric_plugindir}/py-hdate #guess plugin dir version_guess=`gnumeric --version | grep version | cut -f 2 -d \'` gnumeric_plugindir_guess = ${prefix}/lib/gnumeric/${version_guess}/plugins installdir_guess = ${gnumeric_plugindir_guess}/py-hdate gnumeric_plugindir_locale_guess = ~/.gnumeric/${version_guess}/plugins installdir_locale_guess = ${gnumeric_plugindir_locale_guess}/py-hdate INSTALL = /usr/bin/install -c MKINSTALLDIRS = ./mkinstalldirs all: install: $(MKINSTALLDIRS) $(installdir) ${INSTALL} -m 644 py_hdate.py plugin.xml $(installdir) install_global: $(MKINSTALLDIRS) $(installdir_guess) ${INSTALL} -m 644 py_hdate.py plugin.xml $(installdir_guess) install_user: $(MKINSTALLDIRS) $(installdir_locale_guess) ${INSTALL} -m 644 py_hdate.py plugin.xml $(installdir_locale_guess) .PHONY: all install install_global install_user
I set my prefix manually. Having done that, your guessing code almost worked in the shell, all I had to do was remove the spaces around '='. The same code did not work in the makefile, though.
Created attachment 32480 [details] gDesklets pack_sensor modified to pack gnumeric python plugins Hello, Thanks again. I removed the guessing code from the make-file, and used Martin Grimme's pack_sensor (gDesklets) to pack the gnumeric plugin, (I did not ask Martin Grimme's permission, but I think it's ok). This is a very awkward way to do 'cp -r' for two files (its ~200 lines), but it's fun. The pack_plugin script, attached, create an install file that can install to any directory, or if none to the ~/.gnumeric/{ver}/plugins dir.
Let's get this into cvs after we branch
Created attachment 36028 [details] a C version of the plugin (tar.gz) This is a c version of the plugin, i do not know what version is better. I'm not happy about the names of the functions, can you think of more descriptive ones. (need to chang the configure.in and the /plugins/Makfile.am)
Good grief. I completely forgot about this. You have my sincere apologies. I'll merge it for 1.9.2
I forgot about this too. Are there similar functions in Excel/Calc, am I looking in the wrong place ? http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_Date_%26_Time_functions http://office.microsoft.com/en-us/excel/HP051996591033.aspx If we can't copy existing function names, the function names and usage should be similar to existing date/time functions, current naming is looks out of place. Can someone think of better names ?
Fixed.
Btw., someone ought to verify that things still work. That someone is not me.