Print Metamorphoses..

June 3, 2009


last week was pretty mundane, I was mostly with #moodle taking tips and trying to create a plugin for assignments that does printing, constraints uploads to PDFs and also displays them as thumbnails. Martin L had said there is definitely a much better way to do this, and we should be having a meeting this weekend.

From what I understood with moodle is the following:
Moodle has amazing extensibility:

1) It allows plugins to be placed with simple ‘tag’ code

2) You never have to build anything new for a moodle feature, It already exists within the core libraries (lib), you just need to properly play with it.

3) moodle has comments for every three lines of code

Only pitfall is, you can never figure out where to place new code, code which is non-moodle, that is:P

I had taken the existing upload assignments type plugin and made a new type print plugin, added new strings to get_string(). And played with the upload_lib.php so I could do pre-checks for PDF, and was looking up where exactly to put the thumbnail code. I guess this would have made my job quite trivial.



What I had proposed in my previous post is pretty much alive now. To sum up:

I made a 140 line basic print API that (for the time being only) parses filetypes like rtf and odt to cups-pdf, gets a temp pdf, and opens it in Print ( yes, this is the metamorphosis I was talking about, It is Print NOW!). And a new function in takes care of saving the pdfs. homunq had said saving a journal entry by default is good, I will have to edit it sometime.

*From my time with the pycups wrappers and system-config-printer, I’ve discovered that there is great scope to put print devices on share, or print to shared devices, display print queues, cancel jobs and what not. If only thing that might be of some work is, is the page config options. All this I sum upto a +300-400 lines of code in the print API.

Now comes the question of how to display all of this jargon to the sugar user. ‘How and When?’ .Tomeu had said he would help me on this one by posting a mail on the lists, I will also look up other activities and try to create mockups.

Andres and I got to do a few bugsquashing

And we were worried about Rainbow getting in the way, as cups-pdf could save to locations beyond rainbow provided freedom. Thanks to a discussion with Benjamin M. Schwartz, that got sorted out.

And I got around to making this function today:.

def _printPDF (self, _printer, _filename, _title = None):

Plan for the following week:
* Make Mock-ups
* Talk with Andres and team about where everything(such as queues, printer selection etc) would show up
* Talk with Martin and get the moodle plan sketched
* If all works out write out a rigid deadline for each week.

And when I’m not doing any of that:
* Code on elongating the sugar Print API


Hello world!

April 26, 2009

Hello, folks! Well here it is, the blog where I will be writing up all my updates on the project I am working on, i.e. Add Print Support to the XOs.

Well the proposal is now final Print Support

Thanks to homunq, aa, and bemasc for valuable input. Read will now be a victim of lot of abuse :p

And, I hope to work on moodle the first thing I am done with my exams which end on 7th. php is a new beast to me, so I need to fine tune myself to it. Although I have been hacking moodle a while back too, I still dont find enough confidence. Thankfully my mentor is good at it.

Thanks to ajuonline, who recommended wordpress.