Category Archives: Openprinting

Loging the #openprinting irc channel

The IRC channel is nice in theory for team wide casual communication. Unfortunately you need critical mass for it to do this task well. Often #openprinting will only have me and Till in it. Occasionally others will be present and only very occasionally will conversation occur. Since I’m new to the project I want to intercept as much inter-team communication as possible. Thus I’ve setup my home server with the irc client Irssi which logs all communication, then a perl script to clean the log and FTP it to my site. Finally one line of php to print it out on it’s own page.

Truthfully I wrote it up on a whime, but I do look forward to not missing out on chats.

Reusable code in DB.pm for import/export to/from DB

After asking Till some guestions I’ve figured out what’s left to write.

DB.pm already has:
Perl -> XML
SQL -> Perl (For printers and drivers)
XML -> Perl (For printers and drivers)

That only leaves me to write:
Perl -> SQL
SQL -> Perl (For options)
XML -> Perl (For options)

Functionality wise a good majority of hte code is already there. I also already have a function for create the tables from schema. After this I need to create a function to import a single XML and then a second function which calls the first function on all the XMLs.

Foomatic SQLite Progress as of November 22nd

As of today, November 22nd, Foomatic can operate from a sqlite DB. On the Foomatic side this required only two lines of code.

my $dbfile = "$libdir/db/openprinting.db";
$this->{'dbh'} = DBI->connect("dbi:SQLite:dbname=$dbfile","","");

Foomatic will only use SQLite if there is not a mySQL credentials file yet is a SQLite DB. To make my SQLite copy of the DB I exported it from mySQL. The mySQL db was created using a php script written for openprint.org. Since XML -> mySQL -> SQLite is a most impractical build process my next task is to write what ever is needed to go XML -> SQLite.

When I was first consulting Till about what I needed to do there was the general assumption that I would be expending DB.pm with this importation functionality. Yet when I sat down to plan my approach I designed an external script. When I mentioned this to Till he reiterated about including everything in DB.pm. A bit of a facepalm moment since his point is so logical. DB.pm already has quite a bit of the functionality I need. So far I have only taken a cursory glance at what DB.pm has to offer. I know that there is functions in there I can use but I will have to take pen and paper and figure out what exactly I’ll use and what I need to write.