From 2c2849525801761ba8e480b1fb88c9c6fa37b246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 13 Jun 2005 10:18:07 +0000 Subject: [PATCH] * remove a guideline --- src/CODING | 5 ++--- src/pisi/installdb.py | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/CODING b/src/CODING index 9f93a3be..3c604d8b 100644 --- a/src/CODING +++ b/src/CODING @@ -8,9 +8,8 @@ Guidelines with a trailing slash, and please use the dirnames in pisiconfig 2. Python indentation is usually 4 chars. -3. willUse boyNames() -4. Use single quotes for strings if possible -5. Follow python philosophy of 'batteries included' +3. Use single quotes for strings if possible +4. Follow python philosophy of 'batteries included' Suggestions ------------ diff --git a/src/pisi/installdb.py b/src/pisi/installdb.py index 4432831f..bbc09cb1 100644 --- a/src/pisi/installdb.py +++ b/src/pisi/installdb.py @@ -3,7 +3,23 @@ import shelve -d = shelve.open( db_dir + '/fuck yeah') +d = shelve.open( db_dir + '/install.dbm') + +class InstallDBError(Exception): + pass + + + +def isRecorded(name, version, release): + return d.has_key( (name, version, release) ) def isInstalled(name, version, release): + return d.has_key( (name, version, release) ) + +def install( name, version, release, state): + if isInstalled(name,version,release): + raise InstallDBError("already installed") + d[ (name,version,release) ] = state +def remove( name, version, release): + if