Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : Calendar Generator v0.3


IanHelgesen
02-22-2008, 08:19 PM
Greetings all,
I've been wanting a calendar for my Iliad, and was not too satisfied with the Dates program that has been ported to it. Of course, the proper solution would be to polish Dates and adapt it to the Iliads interface, but I'm not that good a programmer. So, instead, I've put together a python script that will generate a pdf calendar for the current month. It uses hyperlinks to add some interactivity, so that, for instance, clicking on a day will will zoom in to a daily overview. Clicking on the title will take you back to the month view. Being a pdf, you can scribble on this to your hearts content, and use the pagebar to flip through days/weeks. While I am not yet done with this, it has reached a point where I thought it might be useful to others, so I'm uploading my current version.

Current features:
Month, week, and day views.
Scribbles and pagebar navigation.

Upcoming features:
Get events from Google Calendar.
Iliad port (Currently it must by run on your computer and the file transfered to the Iliad. This can easily be set up to happen automatically, but an Iliad port would allow you to update the events without need of a computer)

Installation:
You will need Python with the Reportlab libraries. Go to www.python.org for instructions for you platform.
Once you have this installed, simply run the Calendar.py script, and the pdf will be generated in the current directory. I've also attached the calendar for this month, in case anyone wants to play with it, without mucking about with Python.

Suggestions and comments are much appreciated.

daudi
02-23-2008, 02:39 AM
Very nice! And I just had an interesting experience looking at this on my laptop. I went to a day view and wanted to go to the next page. My hand automatically went to find the flipbar.

Iņigo
03-02-2008, 05:50 PM
Hi there,

some weeks ago I also started to write a python program to automatically generate a year agenda in .pdf format.
I haven't taken a look at Ian code yet, but looking at the .pdfs, results are similar.

These days I haven't got any time to continue improving it but I expect to finish the program in March.

Of course, all comments are welcome.

Best regards,
Iņigo Serna

templario
03-27-2008, 01:11 PM
Very nice pdfs and very useful. Iņigo, have you had time to finish your "agenda". I think itīs a very useful file just if i knew python.

Thanks.

templario
03-27-2008, 01:37 PM
I tried installed Python with the Reportlab libraries on a windows machine, but i must be doing something wrong since i canīt run any of the above scripts.

Thanks.

IanHelgesen
03-28-2008, 08:39 PM
Are you getting any error messages? I'm no python guru, but I might be able to help figure out what's going wrong. Otherwise, I do plan to put together a nice package once I get it running on the Iliad (just need to find time to work on it again).

templario
03-29-2008, 04:02 AM
Thanks for the reply, no no error, just it opens a dos windows for a second but nothing happens. I suppose i installed it right, i downloaded python for windows and saved the ReportLab libraries for windows in the Dlls folder. Then i run either your script or Iņigoīs and they run (they have the phython icon) but nothing happens (dos windows for a sec and thats all).

Thanks for your help.

Jose

Iņigo
03-30-2008, 09:37 AM
Hi,

: "i downloaded python for windows and saved the ReportLab libraries for windows in the Dlls folder"

I suppose you mean python2.5 DLL directory, and not windows system directory.
This should be ok.

Also note that both Ian's program and mine are command line applications; so you should run them inside a terminal window (in windows: run => cmd.exe).
Then, go to the directory you have put the files in ("cd path_to_files") and type "python Calendar.py" to run Ian's program or "python c.py" to run mine.
Note you must have python interpreter in your PATH (python installation program for windows does it afaik).

Both programs creates .pdf files in current directory. Look for "Calendar.pdf" or "agenda-2008.pdf".

Please try it again and show us the error messages that appears in the terminal if it doesn't work.

Disclaimer: I don't use windows myself so perhaphs some of the above indications are not totally correct.


As Ian, I don't have much time to finish the program, but it is in my TODO list, someday...

Best regards,
Iņigo

PD: I've attached a slightly modified version. This accepts some parameters.
Run with "python iliad-agenda --help" for options.

templario
03-30-2008, 02:28 PM
Hi, thanks for replying.

I followed your instructions and the message that i get in the terminal window when i type python Calendar.py or python c.py is:

"python" is not recognized as an internal or external command, operable program or batch file.
Thanks for helping.

Jose

templario
03-30-2008, 02:48 PM
I think i made some progress. I open a Python shell in windows and loaded your scripts so i actually can see all the lines of the script (of course itīs chinese for me). Then i go to run, and there i click in "Run Module F5" and i get this message:

Traceback (most recent call last):
File "E:\Iliad\Iliad scripts\Calendar.py", line 2, in <module>

from reportlab.pdfgen import canvas
ImportError: No module named reportlab.pdfgen

So i donīt know if i do it right, note that i donīt use a dos shell i use python as a windows application.

Thanks again.

MicheleC
04-01-2008, 08:37 PM
Go to Reportlab.org at http://www.reportlab.org/ and download the toolkit. Unzip it to the Python directory so you end up with for example c:\Python25\reportlab\pdfgen. Move the Calendar.py file to the Python directory and run from there.

templario
04-02-2008, 04:10 AM
Thanks MicheleC, now i got it working.