Python Crontab 1.4 Released

Today I’ve put the finishing touches on python-crontab 1.4. This release updates the tests and fixes a couple of bugs as well as two really interesting features.

The first is the ability to pull a log from a crontab or cronjob. When creating a crontab in the usual way you can specify a optional log file, if not specified the value ‘/var/log/syslog’ is substituted. The log attribute then provides you a filtered log view which limits the lines returned by the iterator to those attributed to the user your crontab controls. This is of course by default the ‘root’ user, but can be other users too.

Conversely each job in the crontab can return a log iterator which limits the retuned entries to those for this job only. This allows the programmer to tell when cron jobs were last run.

The second large feature is the scheduler. Using the croniter python module, this feature returns date/times when cron jobs would run from any given datetime offset. This allows the programmer to compile a list of datetimes when the job would run in the future and in the past. Use the schedule attribute from the cron job object.

You can download the new release here: python-crontab-1.4 on PyPi

XBMC Librarian (New Addon)

Hello Community,

I’ve finished writing a new addon for xbmc (the tv media center for Ubuntu) called Librarian. She will take a look at your impressive video library and check for various inconsistencies and potential problems which you might want to look into. This 1.0 release includes the following features:

  • List Movie Files not Included in the Database
  • List Movies which have incorrect length, i.e. misidentified or corrupt (requires ffmpeg installed)
  • Lists TV Shop Episodes separately with both above features
  • Tells you which seasons and which episodes of each show you’re missing
  • Shows you which TV Show Paths are being ignored completely.

More checking can be added as good ideas come in, I’ve also written an addon module called xbmcdata which wraps sqlite3 the xbmc httpapi to give a consistant inside xbmc and outside testing/scripting interface. This makes addon development _much_ easier. For instance listing movies is now just a case of:

from xbmcdata import Movies

for movie in Movies():
    print "%s (%s)" % (unicode(movie), movie['Year'])

Please download the code here: http://divajutta.com/doctormo/doctormo-xbmc-addons.tar.gz and install in ~/.xbmc/addons/ then test, entry is available under ‘Programs’. Please report issues back to me with full logs from ~/.xbmc/temp/xbmc.log included.

Have fun.