Scripting with the Entropy codebase

I’m not a python developer myself at all, but I was just curious about the great codebase that Fabio wrote and documented.

Knowing I have the repository database on my hard disc I figured it should be simple to let it list the last 100 changed packages.

This is how its done:

# -*- coding: iso-8859-1 -*-
from entropy.client.interfaces import Client
import time

client = Client()
repo = client.open_repository("")
cur = repo._cursor().execute

for row in repo._cursor().execute('SELECT `extrainfo`.`datecreation`,`baseinfo`.`atom` FROM `baseinfo`,`extrainfo` WHERE `baseinfo`.`idpackage` = `extrainfo`.`idpackage` ORDER BY `extrainfo`.`datecreation` DESC LIMIT 100'):
	my_time = float(row[0])
	human_time = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime(my_time))
	print human_time,' ',row[1]


If you want to know about the table layout, visually, you can use dev-db/sqlitebrowser

The database is located here:


or here


  1. Planet Sabayon Brasil » Montando Scripts com o Entropy codebase.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 171 other followers

%d bloggers like this: