Set up a Lexmark E120n laser printer on Ubuntu 8.04 LTS Friday, May 30 2008 

  • Download the ppd file and saving it in a temporary directory – such as /tmp
  • Select “Printer -> Add a printer”
  • In the type of printer field “check printer and list” Printer CUPS (IPP) “
  • In the field “URI” type the URI of your printer, for instance  “ipp: / / 192.168.0.49:80″
  • Click on Install driver button
  • Select the file ‘‘LexmarkE120n.ppd” from the directory you saved it.
  • Fill in the fields name, “E120n
  • Click on Apply button

Hands-On #7 Working with gcalendar events on GAD Thursday, May 22 2008 

here are some few conversions needed to have the calendar events “when” objects converted into GAD DateTimeProperty model values.

The first thing we must keep in mind is: the calendar “when” object returns a list to be interacted, and get the calender event start and end time strings.  So, you  should have something like the piece of code below:

query = gdata.calendar.service.CalendarEventQuery(‘default’, ‘private’, ‘full’, text_query)

feed = calendar_service.CalendarQuery(query)
for i, an_event in enumerate(feed.entry):
print ‘\t%s. %s’ % (i, an_event.title.text,)
print ‘\t\t%s. %s’ % (i, an_event.content.text,)
for a_when in an_event.when:
print ‘\t\tStart time: %s’ % (a_when.start_time,)
print ‘\t\tEnd time:   %s’ % (a_when.end_time,)

The start_time and end_time are simple strings in UTC format. Such values looks like something as “2008-05-23T08:30:10.000-03:00″. So you have the date: (2008-05-23), the time (08:30:10.000) and the time zone (-03:00 is one of the Brazilian zone). Once you don´t have a way to enter the seconds, milliseconds and the time zone in a single calendar event, the best thing to do is cut them out. So we will use the slice notation to do that.  Just keep the first 16 characters from the datetime string  [:16], and them proceed with the convertion using the strptime datetime function. This function parses a string input to a datetime object based on a given string format.

Take a look at this simple example:

class DateTime(db.Model):
when = db.DateTimeProperty(auto_now_add=False, required=False)

aDateTime = DateTime()
aDateTime.when = datetime.datetime.strptime(w.start_time[:16],”%Y-%m-%dT%H:%M”)

Hands-On #6 Setting up GData for Google Appengine Tuesday, May 6 2008 

There are some important updates need for having the SDK 1.0.2 and GData API 1.0.13 properly working.

  • Configure the GData libraries:
    In this task list I´m considering that your google appengine installation path is:
    C:\Program Files\Google\google_appengine\. Please adjust this piece of information if it does not match with your location.
  • Download the latest gdata-python-client file and uncompress its content in a temporary folder
  • Copy the entire src folder to C:\Program Files\Google\google_appengine\lib folder
  • Rename the src folder to gdata-python-client
  • Edit the urlfetch.py file located at:
    C:\Arquivos de programas\Google\google_appengine\lib\gdata-python-client\gdata\urlfetch.py
  • replace line 153 content from
    return self.headers[name]
    to
    return self.headers[name.lower()]
  • Replace your C:\Arquivos de programas\Google\google_appengine\google\appengine\api\urlfetch_stub.py by this file hacked urlfetch_stub.py file according to the AppDevEngine Issue 341
  • Edit the root dev_appserver.py located at
    C:\Program Files\Google\google_appengine\dev_appserver.py
  • Add a new line after line 43 with the following content:
    os.path.join(DIR_PATH, ‘lib’, ‘gdata-python-client’),The complete block must look like this:EXTRA_PATHS = [
    DIR_PATH,
    os.path.join(DIR_PATH, 'lib', 'django'),
    os.path.join(DIR_PATH, 'lib', 'webob'),
    os.path.join(DIR_PATH, 'lib', 'gdata-python-client'),
    os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'),
    ]
  • save and close this file
  • Edit the root dev_appserver.py located at
    C:\Arquivos de programas\Google\google_appengine\google\appengine\tools\dev_appserver.py
  • “Change lines 1140-1141 of dev_appserver.py from:if (file_type != self._imp.C_BUILTIN and
    not FakeFile.IsFileAccessible(pathname)):to:

    if (file_type != self._imp.C_BUILTIN and
    file_type != self._imp.C_EXTENSION and
    not FakeFile.IsFileAccessible(pathname))”

    The dev_appserver.py file can be located at <Installation dir>\Google
    \google_appengine\google\appengine\tools

  • Save and close this file